linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] modsign: fix missing symbol prefix
@ 2012-11-23 12:08 James Hogan
  2012-11-23 12:08 ` [PATCH 1/2] linux/kernel.h: define SYMBOL_PREFIX James Hogan
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: James Hogan @ 2012-11-23 12:08 UTC (permalink / raw)
  To: David Howells, Rusty Russell, Andrew Morton, Joe Perches,
	Paul Gortmaker, Jean Delvare, Ralf Baechle
  Cc: linux-kernel, James Hogan

These patches fix linker errors on blackfin and metag when module
signing is enabled. This is due to the use of symbol prefixes on these
architectures, and the asm in modsign_pubkey.c not prefixing one.

The first patch defines SYMBOL_PREFIX in linux/kernel based on
CONFIG_SYMBOL_PREFIX to avoid duplicated ifdef'ery all over the place.
The second patch uses SYMBOL_PREFIX to fix modsign_pubkey.c.

I'm not entirely sure linux/kernel.h is the best place for it, but there
are two other similar defines in there to avoid #ifdefs.

James Hogan (2):
  linux/kernel.h: define SYMBOL_PREFIX
  modsign: add symbol prefix to certificate list

 include/linux/kernel.h  |    7 +++++++
 kernel/modsign_pubkey.c |    4 ++--
 2 files changed, 9 insertions(+), 2 deletions(-)

-- 
1.7.7.6



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/2] linux/kernel.h: define SYMBOL_PREFIX
  2012-11-23 12:08 [PATCH 0/2] modsign: fix missing symbol prefix James Hogan
@ 2012-11-23 12:08 ` James Hogan
  2012-11-23 12:08 ` [PATCH 2/2] modsign: add symbol prefix to certificate list James Hogan
  2012-12-03  2:38 ` [PATCH 0/2] modsign: fix missing symbol prefix Rusty Russell
  2 siblings, 0 replies; 4+ messages in thread
From: James Hogan @ 2012-11-23 12:08 UTC (permalink / raw)
  To: David Howells, Rusty Russell, Andrew Morton, Joe Perches,
	Paul Gortmaker, Jean Delvare, Ralf Baechle
  Cc: linux-kernel, James Hogan, Mike Frysinger

Define SYMBOL_PREFIX to be the same as CONFIG_SYMBOL_PREFIX if set by
the architecture, or "" otherwise. This avoids the need for ugly #ifdefs
whenever symbols are referenced in asm blocks.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Joe Perches <joe@perches.com>
Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: Jean Delvare <khali@linux-fr.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Mike Frysinger <vapier@gentoo.org>
---
 include/linux/kernel.h |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index a123b13..7d8dfc7 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -701,6 +701,13 @@ static inline void ftrace_dump(enum ftrace_dump_mode oops_dump_mode) { }
 #define COMPACTION_BUILD 0
 #endif
 
+/* This helps us to avoid #ifdef CONFIG_SYMBOL_PREFIX */
+#ifdef CONFIG_SYMBOL_PREFIX
+#define SYMBOL_PREFIX CONFIG_SYMBOL_PREFIX
+#else
+#define SYMBOL_PREFIX ""
+#endif
+
 /* Rebuild everything on CONFIG_FTRACE_MCOUNT_RECORD */
 #ifdef CONFIG_FTRACE_MCOUNT_RECORD
 # define REBUILD_DUE_TO_FTRACE_MCOUNT_RECORD
-- 
1.7.7.6



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] modsign: add symbol prefix to certificate list
  2012-11-23 12:08 [PATCH 0/2] modsign: fix missing symbol prefix James Hogan
  2012-11-23 12:08 ` [PATCH 1/2] linux/kernel.h: define SYMBOL_PREFIX James Hogan
@ 2012-11-23 12:08 ` James Hogan
  2012-12-03  2:38 ` [PATCH 0/2] modsign: fix missing symbol prefix Rusty Russell
  2 siblings, 0 replies; 4+ messages in thread
From: James Hogan @ 2012-11-23 12:08 UTC (permalink / raw)
  To: David Howells, Rusty Russell, Andrew Morton, Joe Perches,
	Paul Gortmaker, Jean Delvare, Ralf Baechle
  Cc: linux-kernel, James Hogan, Mike Frysinger

Add the arch symbol prefix (if applicable) to the asm definition of
modsign_certificate_list and modsign_certificate_list_end. This uses the
recently defined SYMBOL_PREFIX which is derived from
CONFIG_SYMBOL_PREFIX.

This fixes the build of module signing on the blackfin and metag
architectures.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: David Howells <dhowells@redhat.com>
Cc: Mike Frysinger <vapier@gentoo.org>
---
 kernel/modsign_pubkey.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/modsign_pubkey.c b/kernel/modsign_pubkey.c
index 4646eb2..767e559 100644
--- a/kernel/modsign_pubkey.c
+++ b/kernel/modsign_pubkey.c
@@ -21,10 +21,10 @@ struct key *modsign_keyring;
 extern __initdata const u8 modsign_certificate_list[];
 extern __initdata const u8 modsign_certificate_list_end[];
 asm(".section .init.data,\"aw\"\n"
-    "modsign_certificate_list:\n"
+    SYMBOL_PREFIX "modsign_certificate_list:\n"
     ".incbin \"signing_key.x509\"\n"
     ".incbin \"extra_certificates\"\n"
-    "modsign_certificate_list_end:"
+    SYMBOL_PREFIX "modsign_certificate_list_end:"
     );
 
 /*
-- 
1.7.7.6



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 0/2] modsign: fix missing symbol prefix
  2012-11-23 12:08 [PATCH 0/2] modsign: fix missing symbol prefix James Hogan
  2012-11-23 12:08 ` [PATCH 1/2] linux/kernel.h: define SYMBOL_PREFIX James Hogan
  2012-11-23 12:08 ` [PATCH 2/2] modsign: add symbol prefix to certificate list James Hogan
@ 2012-12-03  2:38 ` Rusty Russell
  2 siblings, 0 replies; 4+ messages in thread
From: Rusty Russell @ 2012-12-03  2:38 UTC (permalink / raw)
  To: James Hogan, David Howells, Andrew Morton, Joe Perches,
	Paul Gortmaker, Jean Delvare, Ralf Baechle
  Cc: linux-kernel, James Hogan

James Hogan <james.hogan@imgtec.com> writes:
> These patches fix linker errors on blackfin and metag when module
> signing is enabled. This is due to the use of symbol prefixes on these
> architectures, and the asm in modsign_pubkey.c not prefixing one.

Sorry, I was away last week.

I've applied these to my fixes branch, and will push to Linus now.

Thanks,
Rusty.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-12-03  2:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-23 12:08 [PATCH 0/2] modsign: fix missing symbol prefix James Hogan
2012-11-23 12:08 ` [PATCH 1/2] linux/kernel.h: define SYMBOL_PREFIX James Hogan
2012-11-23 12:08 ` [PATCH 2/2] modsign: add symbol prefix to certificate list James Hogan
2012-12-03  2:38 ` [PATCH 0/2] modsign: fix missing symbol prefix Rusty Russell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).