linux/scripts
Linus Torvalds 78dc53c422 Merge branch 'for-linus2' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security
Pull security subsystem updates from James Morris:
 "In this patchset, we finally get an SELinux update, with Paul Moore
  taking over as maintainer of that code.

  Also a significant update for the Keys subsystem, as well as
  maintenance updates to Smack, IMA, TPM, and Apparmor"

and since I wanted to know more about the updates to key handling,
here's the explanation from David Howells on that:

 "Okay.  There are a number of separate bits.  I'll go over the big bits
  and the odd important other bit, most of the smaller bits are just
  fixes and cleanups.  If you want the small bits accounting for, I can
  do that too.

   (1) Keyring capacity expansion.

        KEYS: Consolidate the concept of an 'index key' for key access
        KEYS: Introduce a search context structure
        KEYS: Search for auth-key by name rather than target key ID
        Add a generic associative array implementation.
        KEYS: Expand the capacity of a keyring

     Several of the patches are providing an expansion of the capacity of a
     keyring.  Currently, the maximum size of a keyring payload is one page.
     Subtract a small header and then divide up into pointers, that only gives
     you ~500 pointers on an x86_64 box.  However, since the NFS idmapper uses
     a keyring to store ID mapping data, that has proven to be insufficient to
     the cause.

     Whatever data structure I use to handle the keyring payload, it can only
     store pointers to keys, not the keys themselves because several keyrings
     may point to a single key.  This precludes inserting, say, and rb_node
     struct into the key struct for this purpose.

     I could make an rbtree of records such that each record has an rb_node
     and a key pointer, but that would use four words of space per key stored
     in the keyring.  It would, however, be able to use much existing code.

     I selected instead a non-rebalancing radix-tree type approach as that
     could have a better space-used/key-pointer ratio.  I could have used the
     radix tree implementation that we already have and insert keys into it by
     their serial numbers, but that means any sort of search must iterate over
     the whole radix tree.  Further, its nodes are a bit on the capacious side
     for what I want - especially given that key serial numbers are randomly
     allocated, thus leaving a lot of empty space in the tree.

     So what I have is an associative array that internally is a radix-tree
     with 16 pointers per node where the index key is constructed from the key
     type pointer and the key description.  This means that an exact lookup by
     type+description is very fast as this tells us how to navigate directly to
     the target key.

     I made the data structure general in lib/assoc_array.c as far as it is
     concerned, its index key is just a sequence of bits that leads to a
     pointer.  It's possible that someone else will be able to make use of it
     also.  FS-Cache might, for example.

   (2) Mark keys as 'trusted' and keyrings as 'trusted only'.

        KEYS: verify a certificate is signed by a 'trusted' key
        KEYS: Make the system 'trusted' keyring viewable by userspace
        KEYS: Add a 'trusted' flag and a 'trusted only' flag
        KEYS: Separate the kernel signature checking keyring from module signing

     These patches allow keys carrying asymmetric public keys to be marked as
     being 'trusted' and allow keyrings to be marked as only permitting the
     addition or linkage of trusted keys.

     Keys loaded from hardware during kernel boot or compiled into the kernel
     during build are marked as being trusted automatically.  New keys can be
     loaded at runtime with add_key().  They are checked against the system
     keyring contents and if their signatures can be validated with keys that
     are already marked trusted, then they are marked trusted also and can
     thus be added into the master keyring.

     Patches from Mimi Zohar make this usable with the IMA keyrings also.

   (3) Remove the date checks on the key used to validate a module signature.

        X.509: Remove certificate date checks

     It's not reasonable to reject a signature just because the key that it was
     generated with is no longer valid datewise - especially if the kernel
     hasn't yet managed to set the system clock when the first module is
     loaded - so just remove those checks.

   (4) Make it simpler to deal with additional X.509 being loaded into the kernel.

        KEYS: Load *.x509 files into kernel keyring
        KEYS: Have make canonicalise the paths of the X.509 certs better to deduplicate

     The builder of the kernel now just places files with the extension ".x509"
     into the kernel source or build trees and they're concatenated by the
     kernel build and stuffed into the appropriate section.

   (5) Add support for userspace kerberos to use keyrings.

        KEYS: Add per-user_namespace registers for persistent per-UID kerberos caches
        KEYS: Implement a big key type that can save to tmpfs

     Fedora went to, by default, storing kerberos tickets and tokens in tmpfs.
     We looked at storing it in keyrings instead as that confers certain
     advantages such as tickets being automatically deleted after a certain
     amount of time and the ability for the kernel to get at these tokens more
     easily.

     To make this work, two things were needed:

     (a) A way for the tickets to persist beyond the lifetime of all a user's
         sessions so that cron-driven processes can still use them.

         The problem is that a user's session keyrings are deleted when the
         session that spawned them logs out and the user's user keyring is
         deleted when the UID is deleted (typically when the last log out
         happens), so neither of these places is suitable.

         I've added a system keyring into which a 'persistent' keyring is
         created for each UID on request.  Each time a user requests their
         persistent keyring, the expiry time on it is set anew.  If the user
         doesn't ask for it for, say, three days, the keyring is automatically
         expired and garbage collected using the existing gc.  All the kerberos
         tokens it held are then also gc'd.

     (b) A key type that can hold really big tickets (up to 1MB in size).

         The problem is that Active Directory can return huge tickets with lots
         of auxiliary data attached.  We don't, however, want to eat up huge
         tracts of unswappable kernel space for this, so if the ticket is
         greater than a certain size, we create a swappable shmem file and dump
         the contents in there and just live with the fact we then have an
         inode and a dentry overhead.  If the ticket is smaller than that, we
         slap it in a kmalloc()'d buffer"

* 'for-linus2' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security: (121 commits)
  KEYS: Fix keyring content gc scanner
  KEYS: Fix error handling in big_key instantiation
  KEYS: Fix UID check in keyctl_get_persistent()
  KEYS: The RSA public key algorithm needs to select MPILIB
  ima: define '_ima' as a builtin 'trusted' keyring
  ima: extend the measurement list to include the file signature
  kernel/system_certificate.S: use real contents instead of macro GLOBAL()
  KEYS: fix error return code in big_key_instantiate()
  KEYS: Fix keyring quota misaccounting on key replacement and unlink
  KEYS: Fix a race between negating a key and reading the error set
  KEYS: Make BIG_KEYS boolean
  apparmor: remove the "task" arg from may_change_ptraced_domain()
  apparmor: remove parent task info from audit logging
  apparmor: remove tsk field from the apparmor_audit_struct
  apparmor: fix capability to not use the current task, during reporting
  Smack: Ptrace access check mode
  ima: provide hash algo info in the xattr
  ima: enable support for larger default filedata hash algorithms
  ima: define kernel parameter 'ima_template=' to change configured default
  ima: add Kconfig default measurement list template
  ...
2013-11-21 19:46:00 -08:00
..
basic kbuild: fixdep: support concatenated dep files 2013-04-05 12:22:58 -06:00
coccinelle scripts/coccinelle/api: remove devm_request_and_ioremap.cocci 2013-10-23 16:55:15 +02:00
dtc dtc: ensure #line directives don't consume data from the next line 2013-06-13 22:12:15 +01:00
genksyms genksyms: pass symbol-prefix instead of arch 2013-03-20 11:27:27 +10:30
kconfig xconfig: Fix the filename for GUI settings 2013-10-08 23:52:16 +02:00
ksymoops Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
mod Merge branch 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild 2013-11-15 14:06:38 -08:00
package perf tools: Fix version when building out of tree 2013-11-07 10:40:47 -03:00
rt-tester Fix common misspellings 2011-03-31 11:26:23 -03:00
selinux Create Documentation/security/, 2011-05-19 15:59:38 -07:00
tracing tracing, perf: Convert the power tracer into an event tracer 2009-09-19 11:42:12 +02:00
.gitignore X.509: Add simple ASN.1 grammar compiler 2012-10-08 13:50:19 +10:30
Kbuild.include kbuild: fix ld-option function 2013-04-08 11:47:41 +02:00
Lindent scripts/Lindent: support gnu indent v2.2.10 2008-04-29 08:06:04 -07:00
Makefile X.509: Add simple ASN.1 grammar compiler 2012-10-08 13:50:19 +10:30
Makefile.asm-generic uapi: Allow automatic generation of uapi/asm/ header files 2012-10-17 12:25:44 +01:00
Makefile.build genksyms: pass symbol-prefix instead of arch 2013-03-20 11:27:27 +10:30
Makefile.clean kbuild: Really don't clean bounds.h and asm-offsets.h 2010-03-11 11:15:22 +01:00
Makefile.fwinst kbuild: Fix accidental revert in commit fe04ddf 2012-10-15 13:01:05 -07:00
Makefile.headersinst kbuild: fix make headers_install when path is too long 2013-05-17 22:10:35 +02:00
Makefile.help Add a target to use the Coccinelle checker 2010-06-12 00:00:29 +02:00
Makefile.host kbuild: fix some minor typoes 2008-04-25 20:18:48 +02:00
Makefile.lib Merge branch 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild 2013-07-10 16:05:40 -07:00
Makefile.modbuiltin kbuild: Create output directory in Makefile.modbuiltin 2010-06-10 12:23:08 +02:00
Makefile.modinst modules: don't break modules_install on external modules with no key. 2012-11-06 11:52:24 +10:30
Makefile.modpost modpost: Optionally ignore secondary errors seen if a single module build fails 2013-09-23 15:45:03 +09:30
Makefile.modsign MODSIGN: Add modules_sign make target 2012-12-14 13:05:28 +10:30
asn1_compiler.c X.509: remove possible code fragility: enumeration values not handled 2013-09-25 17:17:01 +01:00
bin2c.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
bloat-o-meter scripts/bloat-o-meter: use .startswith rather than fragile slicing 2013-11-07 10:47:13 +01:00
bootgraph.pl bootgraph.pl: relax timing information requirements 2011-06-13 00:04:57 +02:00
checkincludes.pl checkincludes: fix perlcritic warnings 2010-03-07 21:19:57 +01:00
checkkconfigsymbols.sh scripts/checkkconfigsymbols.sh: replace echo -e with printf 2013-08-28 17:00:47 +02:00
checkpatch.pl checkpatch: add check for sscanf without return use 2013-11-13 12:09:25 +09:00
checkstack.pl scripts/checkstack.pl: Add metag support 2013-03-02 20:09:55 +00:00
checksyscalls.sh checksyscalls: fix "here document" handling 2012-09-25 08:59:21 -07:00
checkversion.pl kbuild: don't warn about include/linux/version.h not including itself 2011-04-29 15:38:55 +02:00
cleanfile scripts: Make cleanfile/cleanpatch warn about long lines 2007-07-16 21:15:50 +02:00
cleanpatch scripts: Make cleanfile/cleanpatch warn about long lines 2007-07-16 21:15:50 +02:00
coccicheck Coccinelle: Update information about the minimal version required 2013-07-03 22:58:20 +02:00
config scripts/config: fix variable substitution command 2013-09-13 13:06:59 +02:00
conmakehash.c Fix all -Wmissing-prototypes warnings in x86 defconfig 2009-09-23 07:39:28 -07:00
decodecode scripts/decodecode: make faulting insn ptr more robust 2013-04-29 15:54:27 -07:00
depmod.sh depmod: pass -P $CONFIG_SYMBOL_PREFIX 2013-02-22 11:52:31 +01:00
diffconfig diffconfig: Update script to support python versions 2.5 through 3.3 2013-09-01 21:24:51 +02:00
docproc.c kernel-doc: improve "no structured comments found" error 2013-11-13 12:09:32 +09:00
export_report.pl export_report: use warn() to issue WARNING, so they go to stderr 2011-05-24 16:07:07 +02:00
extract-ikconfig scripts/extract-ikconfig: add xz compression support 2011-02-10 15:23:03 +01:00
extract-vmlinux scripts: add extract-vmlinux 2011-08-31 16:12:17 +02:00
gcc-goto.sh ARM: 7333/2: jump label: detect %c support for ARM 2012-03-24 09:38:56 +00:00
gcc-version.sh kbuild: Fix gcc -x syntax 2012-10-03 09:03:24 +02:00
gcc-x86_32-has-stack-protector.sh kbuild: Fix gcc -x syntax 2012-10-03 09:03:24 +02:00
gcc-x86_64-has-stack-protector.sh kbuild: Fix gcc -x syntax 2012-10-03 09:03:24 +02:00
gen_initramfs_list.sh initramfs: read CONFIG_RD_ variables for initramfs compression 2013-11-13 12:09:26 +09:00
get_maintainer.pl get_maintainer: use filename-only regex match for Tegra 2013-04-29 18:28:14 -07:00
gfp-translate chmod +x scripts/gfp-translate 2012-06-27 12:44:29 -07:00
headerdep.pl headerdep: perlcritic warning 2010-03-23 12:26:38 +01:00
headers.sh kbuild, headers.sh: Don't make archheaders explicitly 2011-11-22 14:47:50 -08:00
headers_check.pl headers_check: recursively search for linux/types.h inclusion 2012-03-26 14:54:27 +02:00
headers_install.sh kbuild: fix make headers_install when path is too long 2013-05-17 22:10:35 +02:00
kallsyms.c Merge branch 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild 2013-11-15 14:06:38 -08:00
kernel-doc Merge branch 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild 2013-11-15 14:09:15 -08:00
link-vmlinux.sh scripts/kallsyms: filter symbols not in kernel address space 2013-11-02 09:13:02 +10:30
makelst kbuild: introduce ccflags-y, asflags-y and ldflags-y 2007-10-15 22:25:06 +02:00
markup_oops.pl Merge branch 'for-35' of git://repo.or.cz/linux-kbuild 2010-06-01 08:55:52 -07:00
mkcompile_h Fix handling of backlash character in LINUX_COMPILE_BY name 2011-04-29 15:55:45 +02:00
mkmakefile kbuild: silence generated makefile message 2011-07-20 17:08:08 +02:00
mksysmap trivial: typo in comment in mksysmap 2012-07-20 10:36:05 +02:00
mkuboot.sh mkuboot.sh: Fail if mkimage is missing 2011-01-07 14:31:01 +01:00
mkversion Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
module-common.lds module: Sort exported symbols 2011-05-19 16:55:27 +09:30
namespace.pl Revert "namespace: add source file location exceptions" 2010-10-28 00:59:56 +02:00
patch-kernel scripts/patch-kernel: digest kernel.org hosted .xz patches 2012-03-30 15:23:36 +02:00
pnmtologo.c scripts/pnmtologo: fix for plain PBM 2012-11-20 11:58:03 +01:00
profile2linkerlist.pl profile2linkerlist: fix perl warnings 2010-03-07 21:39:33 +01:00
recordmcount.c metag: ftrace support 2013-03-02 20:09:55 +00:00
recordmcount.h ftrace: Make recordmcount.c handle __fentry__ 2012-08-23 11:24:43 -04:00
recordmcount.pl recordmcount.pl: Add support for __fentry__ 2013-11-05 16:07:50 -05:00
setlocalversion scripts/setlocalversion on write-protected source tree 2013-06-24 00:08:01 +02:00
show_delta show_delta: Update script to support python versions 2.5 through 3.3 2013-10-23 17:13:42 +02:00
sign-file MODSIGN: Add -s <signature> option to sign-file 2013-01-25 16:55:36 +10:30
sortextable.c scripts/sortextable: support objects with more than 64K sections. 2013-11-13 12:09:00 +09:00
sortextable.h scripts/sortextable: support objects with more than 64K sections. 2013-11-13 12:09:00 +09:00
tags.sh scripts/tags.sh: remove obsolete __devinit[const|data] 2013-11-08 10:57:20 +01:00
unifdef.c unifdef: update to upstream version 2.5 2011-01-22 15:50:59 +01:00
ver_linux Remove bashisms from scripts 2009-06-09 22:37:54 +02:00
xz_wrap.sh xz: Enable BCJ filters on SPARC and 32-bit x86 2012-04-18 13:13:18 -07:00