Merge branch 'modules-next' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty...
authorLinus Torvalds <torvalds@linux-foundation.org>
Sun, 14 Oct 2012 20:39:34 +0000 (13:39 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sun, 14 Oct 2012 20:39:34 +0000 (13:39 -0700)
Pull module signing support from Rusty Russell:
 "module signing is the highlight, but it's an all-over David Howells frenzy..."

Hmm "Magrathea: Glacier signing key". Somebody has been reading too much HHGTTG.

* 'modules-next' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux: (37 commits)
  X.509: Fix indefinite length element skip error handling
  X.509: Convert some printk calls to pr_devel
  asymmetric keys: fix printk format warning
  MODSIGN: Fix 32-bit overflow in X.509 certificate validity date checking
  MODSIGN: Make mrproper should remove generated files.
  MODSIGN: Use utf8 strings in signer's name in autogenerated X.509 certs
  MODSIGN: Use the same digest for the autogen key sig as for the module sig
  MODSIGN: Sign modules during the build process
  MODSIGN: Provide a script for generating a key ID from an X.509 cert
  MODSIGN: Implement module signature checking
  MODSIGN: Provide module signing public keys to the kernel
  MODSIGN: Automatically generate module signing keys if missing
  MODSIGN: Provide Kconfig options
  MODSIGN: Provide gitignore and make clean rules for extra files
  MODSIGN: Add FIPS policy
  module: signature checking hook
  X.509: Add a crypto key parser for binary (DER) X.509 certificates
  MPILIB: Provide a function to read raw data into an MPI
  X.509: Add an ASN.1 decoder
  X.509: Add simple ASN.1 grammar compiler
  ...

43 files changed:
1  2 
Documentation/kernel-parameters.txt
Makefile
arch/Kconfig
arch/alpha/Kconfig
arch/arm/Kconfig
arch/blackfin/Kconfig
arch/c6x/Kconfig
arch/cris/Kconfig
arch/cris/include/asm/Kbuild
arch/h8300/Kconfig
arch/h8300/include/asm/Kbuild
arch/ia64/Kconfig
arch/m32r/Kconfig
arch/m32r/include/asm/Kbuild
arch/m68k/Kconfig
arch/microblaze/Kconfig
arch/mips/Kconfig
arch/mips/kernel/Makefile
arch/mn10300/Kconfig
arch/parisc/Kconfig
arch/powerpc/Kconfig
arch/s390/Kconfig
arch/score/Kconfig
arch/sh/Kconfig
arch/sparc/Kconfig
arch/sparc/include/asm/Kbuild
arch/tile/Kconfig
arch/unicore32/Kconfig
arch/x86/Kconfig
arch/x86/um/Kconfig
crypto/Kconfig
crypto/Makefile
fs/cifs/cifsacl.c
init/Kconfig
kernel/Makefile
lib/Makefile
net/dns_resolver/dns_key.c
net/rxrpc/ar-key.c
scripts/Makefile.modpost
security/keys/key.c
security/keys/keyctl.c
security/keys/keyring.c
security/keys/trusted.c

Simple merge
diff --cc Makefile
+++ b/Makefile
@@@ -996,8 -993,12 +996,11 @@@ CLEAN_DIRS  += $(MODVERDIR
  # Directories & files removed with 'make mrproper'
  MRPROPER_DIRS  += include/config usr/include include/generated          \
                    arch/*/include/generated
 -MRPROPER_FILES += .config .config.old .version .old_version             \
 -                  include/linux/version.h                               \
 +MRPROPER_FILES += .config .config.old .version .old_version $(version_h) \
-                 Module.symvers tags TAGS cscope* GPATH GTAGS GRTAGS GSYMS
+                 Module.symvers tags TAGS cscope* GPATH GTAGS GRTAGS GSYMS \
+                 signing_key.priv signing_key.x509 x509.genkey         \
+                 extra_certificates signing_key.x509.keyid             \
+                 signing_key.x509.signer
  
  # clean - Delete most, but leave enough to build external modules
  #
diff --cc arch/Kconfig
@@@ -300,26 -281,23 +300,45 @@@ config SECCOMP_FILTE
  
          See Documentation/prctl/seccomp_filter.txt for details.
  
 +config HAVE_RCU_USER_QS
 +      bool
 +      help
 +        Provide kernel entry/exit hooks necessary for userspace
 +        RCU extended quiescent state. Syscalls need to be wrapped inside
 +        rcu_user_exit()-rcu_user_enter() through the slow path using
 +        TIF_NOHZ flag. Exceptions handlers must be wrapped as well. Irqs
 +        are already protected inside rcu_irq_enter/rcu_irq_exit() but
 +        preemption or signal handling on irq exit still need to be protected.
 +
 +config HAVE_VIRT_CPU_ACCOUNTING
 +      bool
 +
 +config HAVE_IRQ_TIME_ACCOUNTING
 +      bool
 +      help
 +        Archs need to ensure they use a high enough resolution clock to
 +        support irq time accounting and then call enable_sched_clock_irqtime().
 +
 +config HAVE_ARCH_TRANSPARENT_HUGEPAGE
 +      bool
 +
+ config HAVE_MOD_ARCH_SPECIFIC
+       bool
+       help
+         The arch uses struct mod_arch_specific to store data.  Many arches
+         just need a simple module loader without arch specific data - those
+         should not enable this.
+ config MODULES_USE_ELF_RELA
+       bool
+       help
+         Modules only use ELF RELA relocations.  Modules with ELF REL
+         relocations will give an error.
+ config MODULES_USE_ELF_REL
+       bool
+       help
+         Modules only use ELF REL relocations.  Modules with ELF RELA
+         relocations will give an error.
  source "kernel/gcov/Kconfig"
@@@ -20,8 -20,8 +20,10 @@@ config ALPH
        select GENERIC_CMOS_UPDATE
        select GENERIC_STRNCPY_FROM_USER
        select GENERIC_STRNLEN_USER
 +      select GENERIC_KERNEL_THREAD
 +      select GENERIC_KERNEL_EXECVE
+       select HAVE_MOD_ARCH_SPECIFIC
+       select MODULES_USE_ELF_RELA
        help
          The Alpha is a 64-bit general-purpose processor designed and
          marketed by the Digital Equipment Corporation of blessed memory,
@@@ -22,37 -16,41 +22,39 @@@ config AR
        select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL
        select HAVE_ARCH_KGDB
        select HAVE_ARCH_TRACEHOOK
 -      select HAVE_KPROBES if !XIP_KERNEL
 -      select HAVE_KRETPROBES if (HAVE_KPROBES)
 -      select HAVE_FUNCTION_TRACER if (!XIP_KERNEL)
 -      select HAVE_FTRACE_MCOUNT_RECORD if (!XIP_KERNEL)
 +      select HAVE_BPF_JIT
 +      select HAVE_C_RECORDMCOUNT
 +      select HAVE_DEBUG_KMEMLEAK
 +      select HAVE_DMA_API_DEBUG
 +      select HAVE_DMA_ATTRS
 +      select HAVE_DMA_CONTIGUOUS if MMU
        select HAVE_DYNAMIC_FTRACE if (!XIP_KERNEL)
 +      select HAVE_FTRACE_MCOUNT_RECORD if (!XIP_KERNEL)
        select HAVE_FUNCTION_GRAPH_TRACER if (!THUMB2_KERNEL)
 -      select ARCH_BINFMT_ELF_RANDOMIZE_PIE
 +      select HAVE_FUNCTION_TRACER if (!XIP_KERNEL)
        select HAVE_GENERIC_DMA_COHERENT
 +      select HAVE_GENERIC_HARDIRQS
 +      select HAVE_HW_BREAKPOINT if (PERF_EVENTS && (CPU_V6 || CPU_V6K || CPU_V7))
 +      select HAVE_IDE if PCI || ISA || PCMCIA
 +      select HAVE_IRQ_WORK
        select HAVE_KERNEL_GZIP
 -      select HAVE_KERNEL_LZO
        select HAVE_KERNEL_LZMA
 +      select HAVE_KERNEL_LZO
        select HAVE_KERNEL_XZ
 -      select HAVE_IRQ_WORK
 +      select HAVE_KPROBES if !XIP_KERNEL
 +      select HAVE_KRETPROBES if (HAVE_KPROBES)
 +      select HAVE_MEMBLOCK
 +      select HAVE_OPROFILE if (HAVE_PERF_EVENTS)
        select HAVE_PERF_EVENTS
 -      select PERF_USE_VMALLOC
        select HAVE_REGS_AND_STACK_ACCESS_API
 -      select HAVE_HW_BREAKPOINT if (PERF_EVENTS && (CPU_V6 || CPU_V6K || CPU_V7))
 -      select HAVE_C_RECORDMCOUNT
 -      select HAVE_GENERIC_HARDIRQS
 -      select HARDIRQS_SW_RESEND
 -      select GENERIC_IRQ_PROBE
 -      select GENERIC_IRQ_SHOW
 -      select ARCH_WANT_IPC_PARSE_VERSION
 -      select HARDIRQS_SW_RESEND
 -      select CPU_PM if (SUSPEND || CPU_IDLE)
 -      select GENERIC_PCI_IOMAP
 -      select HAVE_BPF_JIT
 -      select GENERIC_SMP_IDLE_THREAD
 +      select HAVE_SYSCALL_TRACEPOINTS
 +      select HAVE_UID16
        select KTIME_SCALAR
 -      select GENERIC_CLOCKEVENTS_BROADCAST if SMP
 -      select GENERIC_STRNCPY_FROM_USER
 -      select GENERIC_STRNLEN_USER
 -      select DCACHE_WORD_ACCESS if (CPU_V6 || CPU_V6K || CPU_V7) && !CPU_BIG_ENDIAN
 +      select PERF_USE_VMALLOC
 +      select RTC_LIB
 +      select SYS_SUPPORTS_APM_EMULATION
+       select HAVE_MOD_ARCH_SPECIFIC if ARM_UNWIND
+       select MODULES_USE_ELF_REL
        help
          The ARM series is a line of low-power-consumption RISC chip designs
          licensed by ARM Ltd and targeted at embedded applications and
Simple merge
@@@ -17,7 -17,7 +17,8 @@@ config C6
        select OF
        select OF_EARLY_FLATTREE
        select GENERIC_CLOCKEVENTS
 +      select GENERIC_KERNEL_THREAD
+       select MODULES_USE_ELF_RELA
  
  config MMU
        def_bool n
Simple merge
@@@ -8,5 -8,4 +8,6 @@@ header-y += etraxgpio.
  header-y += rs485.h
  header-y += sync_serial.h
  
 +generic-y += clkdev.h
 +generic-y += exec.h
+ generic-y += module.h
Simple merge
@@@ -1,4 -1,3 +1,5 @@@
  include include/asm-generic/Kbuild.asm
  
 -generic-y     += module.h
 +generic-y += clkdev.h
 +generic-y += exec.h
++generic-y += module.h
@@@ -39,7 -38,9 +39,9 @@@ config IA6
        select ARCH_TASK_STRUCT_ALLOCATOR
        select ARCH_THREAD_INFO_ALLOCATOR
        select ARCH_CLOCKSOURCE_DATA
 -      select GENERIC_TIME_VSYSCALL
 +      select GENERIC_TIME_VSYSCALL_OLD
+       select HAVE_MOD_ARCH_SPECIFIC
+       select MODULES_USE_ELF_RELA
        default y
        help
          The Itanium Processor Family is Intel's 64-bit successor to
Simple merge
@@@ -1,4 -1,3 +1,5 @@@
  include include/asm-generic/Kbuild.asm
  
 -generic-y     += module.h
 +generic-y += clkdev.h
 +generic-y += exec.h
++generic-y += module.h
@@@ -15,7 -13,9 +15,10 @@@ config M68
        select FPU if MMU
        select ARCH_WANT_IPC_PARSE_VERSION
        select ARCH_USES_GETTIMEOFFSET if MMU && !COLDFIRE
 +      select GENERIC_KERNEL_THREAD
+       select HAVE_MOD_ARCH_SPECIFIC
+       select MODULES_USE_ELF_REL
+       select MODULES_USE_ELF_RELA
  
  config RWSEM_GENERIC_SPINLOCK
        bool
Simple merge
Simple merge
Simple merge
@@@ -8,7 -8,7 +8,8 @@@ config MN1030
        select HAVE_ARCH_KGDB
        select HAVE_NMI_WATCHDOG if MN10300_WD_TIMER
        select GENERIC_CLOCKEVENTS
 +      select GENERIC_KERNEL_THREAD
+       select MODULES_USE_ELF_RELA
  
  config AM33_2
        def_bool n
Simple merge
@@@ -141,7 -139,8 +141,9 @@@ config PP
        select GENERIC_CLOCKEVENTS
        select GENERIC_STRNCPY_FROM_USER
        select GENERIC_STRNLEN_USER
 +      select GENERIC_KERNEL_THREAD
+       select HAVE_MOD_ARCH_SPECIFIC
+       select MODULES_USE_ELF_RELA
  
  config EARLY_PRINTK
        bool
@@@ -135,7 -125,8 +135,9 @@@ config S39
        select GENERIC_CLOCKEVENTS
        select KTIME_SCALAR if 32BIT
        select HAVE_ARCH_SECCOMP_FILTER
 +      select GENERIC_KERNEL_THREAD
+       select HAVE_MOD_ARCH_SPECIFIC
+       select MODULES_USE_ELF_RELA
  
  config SCHED_OMIT_FRAME_POINTER
        def_bool y
Simple merge
diff --cc arch/sh/Kconfig
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -106,14 -97,11 +106,16 @@@ config X8
        select KTIME_SCALAR if X86_32
        select GENERIC_STRNCPY_FROM_USER
        select GENERIC_STRNLEN_USER
 +      select HAVE_RCU_USER_QS if X86_64
 +      select HAVE_IRQ_TIME_ACCOUNTING
 +      select GENERIC_KERNEL_THREAD
 +      select GENERIC_KERNEL_EXECVE
+       select MODULES_USE_ELF_REL if X86_32
+       select MODULES_USE_ELF_RELA if X86_64
  
  config INSTRUCTION_DECODER
 -      def_bool (KPROBES || PERF_EVENTS || UPROBES)
 +      def_bool y
 +      depends on KPROBES || PERF_EVENTS || UPROBES
  
  config OUTPUT_FORMAT
        string
@@@ -23,7 -21,7 +23,8 @@@ config 64BI
  config X86_32
        def_bool !64BIT
        select HAVE_AOUT
 +      select ARCH_WANT_IPC_PARSE_VERSION
+       select MODULES_USE_ELF_REL
  
  config X86_64
        def_bool 64BIT
diff --cc crypto/Kconfig
Simple merge
diff --cc crypto/Makefile
Simple merge
Simple merge
diff --cc init/Kconfig
@@@ -1601,10 -1672,12 +1661,18 @@@ config PADAT
        depends on SMP
        bool
  
 +# Can be selected by architectures with broken toolchains
 +# that get confused by correct const<->read_only section
 +# mappings
 +config BROKEN_RODATA
 +      bool
 +
+ config ASN1
+       tristate
+       help
+         Build a simple ASN.1 grammar compiler that produces a bytecode output
+         that can be interpreted by the ASN.1 stream decoder and used to
+         inform it as to what tags are to be expected in a stream and what
+         functions to call on what tags.
  source "kernel/Kconfig.locks"
diff --cc kernel/Makefile
Simple merge
diff --cc lib/Makefile
@@@ -140,11 -140,8 +140,13 @@@ $(foreach file, $(libfdt_files), 
        $(eval CFLAGS_$(file) = -I$(src)/../scripts/dtc/libfdt))
  lib-$(CONFIG_LIBFDT) += $(libfdt_files)
  
 +obj-$(CONFIG_RBTREE_TEST) += rbtree_test.o
 +obj-$(CONFIG_INTERVAL_TREE_TEST) += interval_tree_test.o
 +
 +interval_tree_test-objs := interval_tree_test_main.o interval_tree.o
 +
+ obj-$(CONFIG_ASN1) += asn1_decoder.o
  hostprogs-y   := gen_crc32table
  clean-files   := crc32table.h
  
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -903,9 -936,8 +904,9 @@@ static int trusted_instantiate(struct k
        char *datablob;
        int ret = 0;
        int key_cmd;
 +      size_t key_len;
  
-       if (datalen <= 0 || datalen > 32767 || !data)
+       if (datalen <= 0 || datalen > 32767 || !prep->data)
                return -EINVAL;
  
        datablob = kmalloc(datalen + 1, GFP_KERNEL);