extable cleanup
Quoted 14 lines · Rusty Russell
Quoted 7 lines
Fairly straightforward consolidation of extable handling. Sparc64 is trickiest, with its extable range stuff (ideally, the ranges would be in a separate
__extable_rangesection, then the extable walking code could be made common, too).Only tested on x86: ppc and sparc64 written untested, others broken.
Did you test on a true i386, which needs exception handling very early on to handle the test for broken WP? In other words, are all the exception table data structures properly initialized?
It's the other way around: a real 80386 doesn't need the early exception handling, all other cpus need it.
The WP test works by writing to a write-protected page while at ring 0. A real 80386 ignores the write-protected bit, later x86 cpus honor it and cause a page fault.
Rusty, against which kernel is the patch you have posted? I've tried both 2.5.54 and the latest bk shapshot from www.kernel.org, I get an patch error in kernel/extable.c.
--
Manfred
In message <[email protected]> you write:
Quoted 3 lines
Rusty, against which kernel is the patch you have posted? I've tried both 2.5.54 and the latest bk shapshot from www.kernel.org, I get an patch error in
kernel/extable.c.
Either should work, but you need to apply the module license patch first (below).
Rusty.
--
Anyone who quotes me in their sig is an idiot. -- Rusty Russell.
Name: MODULE_LICENSE support for modules
Author: Rusty Russell
Status: Tested in 2.5.54
D: This implements EXPORT_SYMBOL_GPL and MODULE_LICENSE properly (so
D: restrictions are enforced). Also fixes "proprietory" spelling.
include/linux/kernel.h +1 -1
@@ -105,7 +105,7 @@ extern int oops_in_progress; /* If set,extern int tainted;extern const char *print_tainted (void ); -#define TAINT_PROPRIETORY_MODULE (1<<0) +#define TAINT_PROPRIETARY_MODULE (1<<0)#define TAINT_FORCED_MODULE (1<<1)#define TAINT_UNSAFE_SMP (1<<2)#define TAINT_FORCED_RMMOD (1<<3)
include/linux/module.h +46 -3
95 lines not on this page · raw message
kernel/extable.c +9 -0
@@ -24,6 +24,8 @@ extern const struct exception_table_entrextern const struct exception_table_entry __stop___ex_table[];extern const struct kernel_symbol __start___ksymtab[];extern const struct kernel_symbol __stop___ksymtab[]; +extern const struct kernel_symbol __start___gpl_ksymtab[]; +extern const struct kernel_symbol __stop___gpl_ksymtab[];/* Protects extables and symbol tables */ spinlock_t modlist_lock =SPIN_LOCK_UNLOCKED ;
@@ -34,13 +36,20 @@ LIST_HEAD(symbols);static struct exception_table kernel_extable;static struct kernel_symbol_group kernel_symbols; +static struct kernel_symbol_group kernel_gpl_symbols;void __init extable_init (void ) {/* Add kernel symbols to symbol table */ kernel_symbols.num_syms = (__stop___ksymtab - __start___ksymtab); kernel_symbols.syms = __start___ksymtab; + kernel_symbols.gplonly =0 ;list_add (&kernel_symbols.list, &symbols); + kernel_gpl_symbols.num_syms = (__stop___gpl_ksymtab + - __start___gpl_ksymtab); + kernel_gpl_symbols.syms = __start___gpl_ksymtab; + kernel_gpl_symbols.gplonly =1 ; +list_add (&kernel_gpl_symbols.list, &symbols);/* Add kernel exception table to exception tables */ kernel_extable.num_entries = (__stop___ex_table -__start___ex_table);
kernel/module.c +59 -13
149 lines not on this page · raw message
kernel/panic.c +2 -2
@@ -103,7 +103,7 @@ NORET_TYPE void panic(const char * fmt,/** * print_tainted - return a string to represent the kernel taint state. * -* 'P' - Proprietory module has been loaded. +* 'P' - Proprietary module has been loaded. * 'F' - Module has been forcibly loaded. * 'S' - SMP with CPUs not designed for SMP. *
@@ -115,7 +115,7 @@ const char *print_tainted()static char buf[20 ];if (tainted) {snprintf (buf,sizeof (buf),"Tainted: %c%c%c" , - tainted &TAINT_PROPRIETORY_MODULE ?'P' :'G' , + tainted &TAINT_PROPRIETARY_MODULE ?'P' :'G' , tainted &TAINT_FORCED_MODULE ?'F' :' ' , tainted &TAINT_UNSAFE_SMP ?'S' :' ' ); }