aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile2
-rw-r--r--arch/Kconfig6
-rw-r--r--arch/blackfin/Kconfig5
-rw-r--r--arch/h8300/Kconfig5
-rw-r--r--arch/metag/Kconfig5
-rw-r--r--crypto/asymmetric_keys/x509_cert_parser.c55
-rw-r--r--drivers/mtd/chips/gen_probe.c8
-rw-r--r--include/asm-generic/unistd.h1
-rw-r--r--include/asm-generic/vmlinux.lds.h8
-rw-r--r--include/linux/export.h20
-rw-r--r--include/linux/kernel.h7
-rw-r--r--include/linux/linkage.h20
-rw-r--r--include/linux/module.h4
-rw-r--r--kernel/Makefile2
-rw-r--r--kernel/kallsyms.c26
-rw-r--r--kernel/modsign_certificate.S13
-rw-r--r--kernel/module.c18
-rw-r--r--scripts/Makefile.build3
-rw-r--r--scripts/Makefile.lib7
-rw-r--r--scripts/Makefile.modpost8
-rw-r--r--scripts/genksyms/genksyms.c18
-rw-r--r--scripts/link-vmlinux.sh5
-rw-r--r--scripts/mod/modpost.c94
23 files changed, 201 insertions, 139 deletions
diff --git a/Makefile b/Makefile
index 4572f106e30b..878d7aa3d2dd 100644
--- a/Makefile
+++ b/Makefile
@@ -1399,7 +1399,7 @@ quiet_cmd_rmfiles = $(if $(wildcard $(rm-files)),CLEAN $(wildcard $(rm-files))
1399# Run depmod only if we have System.map and depmod is executable 1399# Run depmod only if we have System.map and depmod is executable
1400quiet_cmd_depmod = DEPMOD $(KERNELRELEASE) 1400quiet_cmd_depmod = DEPMOD $(KERNELRELEASE)
1401 cmd_depmod = $(CONFIG_SHELL) $(srctree)/scripts/depmod.sh $(DEPMOD) \ 1401 cmd_depmod = $(CONFIG_SHELL) $(srctree)/scripts/depmod.sh $(DEPMOD) \
1402 $(KERNELRELEASE) "$(patsubst "%",%,$(CONFIG_SYMBOL_PREFIX))" 1402 $(KERNELRELEASE) "$(patsubst y,_,$(CONFIG_HAVE_UNDERSCORE_SYMBOL_PREFIX))"
1403 1403
1404# Create temporary dir for module support files 1404# Create temporary dir for module support files
1405# clean it up only when building all modules 1405# clean it up only when building all modules
diff --git a/arch/Kconfig b/arch/Kconfig
index 99f0e17df429..dd0e8eb8042f 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -381,6 +381,12 @@ config MODULES_USE_ELF_REL
381 Modules only use ELF REL relocations. Modules with ELF RELA 381 Modules only use ELF REL relocations. Modules with ELF RELA
382 relocations will give an error. 382 relocations will give an error.
383 383
384config HAVE_UNDERSCORE_SYMBOL_PREFIX
385 bool
386 help
387 Some architectures generate an _ in front of C symbols; things like
388 module loading and assembly files need to know about this.
389
384# 390#
385# ABI hall of shame 391# ABI hall of shame
386# 392#
diff --git a/arch/blackfin/Kconfig b/arch/blackfin/Kconfig
index c3f2e0bc644a..453ebe46b065 100644
--- a/arch/blackfin/Kconfig
+++ b/arch/blackfin/Kconfig
@@ -1,7 +1,3 @@
1config SYMBOL_PREFIX
2 string
3 default "_"
4
5config MMU 1config MMU
6 def_bool n 2 def_bool n
7 3
@@ -33,6 +29,7 @@ config BLACKFIN
33 select ARCH_HAVE_CUSTOM_GPIO_H 29 select ARCH_HAVE_CUSTOM_GPIO_H
34 select ARCH_WANT_OPTIONAL_GPIOLIB 30 select ARCH_WANT_OPTIONAL_GPIOLIB
35 select HAVE_UID16 31 select HAVE_UID16
32 select HAVE_UNDERSCORE_SYMBOL_PREFIX
36 select VIRT_TO_BUS 33 select VIRT_TO_BUS
37 select ARCH_WANT_IPC_PARSE_VERSION 34 select ARCH_WANT_IPC_PARSE_VERSION
38 select HAVE_GENERIC_HARDIRQS 35 select HAVE_GENERIC_HARDIRQS
diff --git a/arch/h8300/Kconfig b/arch/h8300/Kconfig
index 79250de1b12a..303e4f9a79d1 100644
--- a/arch/h8300/Kconfig
+++ b/arch/h8300/Kconfig
@@ -12,10 +12,7 @@ config H8300
12 select MODULES_USE_ELF_RELA 12 select MODULES_USE_ELF_RELA
13 select OLD_SIGSUSPEND3 13 select OLD_SIGSUSPEND3
14 select OLD_SIGACTION 14 select OLD_SIGACTION
15 15 select HAVE_UNDERSCORE_SYMBOL_PREFIX
16config SYMBOL_PREFIX
17 string
18 default "_"
19 16
20config MMU 17config MMU
21 bool 18 bool
diff --git a/arch/metag/Kconfig b/arch/metag/Kconfig
index b06b41861aac..6f16c1469327 100644
--- a/arch/metag/Kconfig
+++ b/arch/metag/Kconfig
@@ -1,7 +1,3 @@
1config SYMBOL_PREFIX
2 string
3 default "_"
4
5config METAG 1config METAG
6 def_bool y 2 def_bool y
7 select EMBEDDED 3 select EMBEDDED
@@ -28,6 +24,7 @@ config METAG
28 select HAVE_OPROFILE 24 select HAVE_OPROFILE
29 select HAVE_PERF_EVENTS 25 select HAVE_PERF_EVENTS
30 select HAVE_SYSCALL_TRACEPOINTS 26 select HAVE_SYSCALL_TRACEPOINTS
27 select HAVE_UNDERSCORE_SYMBOL_PREFIX
31 select IRQ_DOMAIN 28 select IRQ_DOMAIN
32 select MODULES_USE_ELF_RELA 29 select MODULES_USE_ELF_RELA
33 select OF 30 select OF
diff --git a/crypto/asymmetric_keys/x509_cert_parser.c b/crypto/asymmetric_keys/x509_cert_parser.c
index 7fabc4c01993..facbf26bc6bb 100644
--- a/crypto/asymmetric_keys/x509_cert_parser.c
+++ b/crypto/asymmetric_keys/x509_cert_parser.c
@@ -373,6 +373,9 @@ int rsa_extract_mpi(void *context, size_t hdrlen,
373 return 0; 373 return 0;
374} 374}
375 375
376/* The keyIdentifier in AuthorityKeyIdentifier SEQUENCE is tag(CONT,PRIM,0) */
377#define SEQ_TAG_KEYID (ASN1_CONT << 6)
378
376/* 379/*
377 * Process certificate extensions that are used to qualify the certificate. 380 * Process certificate extensions that are used to qualify the certificate.
378 */ 381 */
@@ -407,21 +410,57 @@ int x509_process_extension(void *context, size_t hdrlen,
407 } 410 }
408 411
409 if (ctx->last_oid == OID_authorityKeyIdentifier) { 412 if (ctx->last_oid == OID_authorityKeyIdentifier) {
413 size_t key_len;
414
410 /* Get hold of the CA key fingerprint */ 415 /* Get hold of the CA key fingerprint */
411 if (vlen < 5) 416 if (vlen < 5)
412 return -EBADMSG; 417 return -EBADMSG;
413 if (v[0] != (ASN1_SEQ | (ASN1_CONS << 5)) || 418
414 v[1] != vlen - 2 || 419 /* Authority Key Identifier must be a Constructed SEQUENCE */
415 v[2] != (ASN1_CONT << 6) || 420 if (v[0] != (ASN1_SEQ | (ASN1_CONS << 5)))
416 v[3] != vlen - 4)
417 return -EBADMSG; 421 return -EBADMSG;
418 v += 4;
419 vlen -= 4;
420 422
421 f = kmalloc(vlen * 2 + 1, GFP_KERNEL); 423 /* Authority Key Identifier is not indefinite length */
424 if (unlikely(vlen == ASN1_INDEFINITE_LENGTH))
425 return -EBADMSG;
426
427 if (vlen < ASN1_INDEFINITE_LENGTH) {
428 /* Short Form length */
429 if (v[1] != vlen - 2 ||
430 v[2] != SEQ_TAG_KEYID ||
431 v[3] > vlen - 4)
432 return -EBADMSG;
433
434 key_len = v[3];
435 v += 4;
436 } else {
437 /* Long Form length */
438 size_t seq_len = 0;
439 size_t sub = v[1] - ASN1_INDEFINITE_LENGTH;
440
441 if (sub > 2)
442 return -EBADMSG;
443
444 /* calculate the length from subsequent octets */
445 v += 2;
446 for (i = 0; i < sub; i++) {
447 seq_len <<= 8;
448 seq_len |= v[i];
449 }
450
451 if (seq_len != vlen - 2 - sub ||
452 v[sub] != SEQ_TAG_KEYID ||
453 v[sub + 1] > vlen - 4 - sub)
454 return -EBADMSG;
455
456 key_len = v[sub + 1];
457 v += (sub + 2);
458 }
459
460 f = kmalloc(key_len * 2 + 1, GFP_KERNEL);
422 if (!f) 461