Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 357699
b: refs/heads/master
c: a2c2c3a
h: refs/heads/master
i:
  357697: 0ab1bab
  357695: 6ac90d6
v: v3
  • Loading branch information
Mimi Zohar authored and James Morris committed Feb 25, 2013
1 parent 2fe6205 commit c1cdfdd
Show file tree
Hide file tree
Showing 48 changed files with 222 additions and 490 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c69d0a15d240a854f6d620ac7d5238a41883a920
refs/heads/master: a2c2c3a71c25627e4840795b3c269918d0e71b28
4 changes: 2 additions & 2 deletions trunk/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -720,11 +720,11 @@ endif # INSTALL_MOD_STRIP
export mod_strip_cmd


ifdef CONFIG_MODULE_SIG_ALL
ifeq ($(CONFIG_MODULE_SIG),y)
MODSECKEY = ./signing_key.priv
MODPUBKEY = ./signing_key.x509
export MODPUBKEY
mod_sign_cmd = perl $(srctree)/scripts/sign-file $(CONFIG_MODULE_SIG_HASH) $(MODSECKEY) $(MODPUBKEY)
mod_sign_cmd = perl $(srctree)/scripts/sign-file $(MODSECKEY) $(MODPUBKEY)
else
mod_sign_cmd = true
endif
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/alpha/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ die_if_kernel(char * str, struct pt_regs *regs, long err, unsigned long *r9_15)
#endif
printk("%s(%d): %s %ld\n", current->comm, task_pid_nr(current), str, err);
dik_show_regs(regs, r9_15);
add_taint(TAINT_DIE, LOCKDEP_NOW_UNRELIABLE);
add_taint(TAINT_DIE);
dik_show_trace((unsigned long *)(regs+1));
dik_show_code((unsigned int *)regs->pc);

Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/arm/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ static void oops_end(unsigned long flags, struct pt_regs *regs, int signr)

bust_spinlocks(0);
die_owner = -1;
add_taint(TAINT_DIE, LOCKDEP_NOW_UNRELIABLE);
add_taint(TAINT_DIE);
die_nest_count--;
if (!die_nest_count)
/* Nest count reaches zero, release the lock. */
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/arm64/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ void die(const char *str, struct pt_regs *regs, int err)
crash_kexec(regs);

bust_spinlocks(0);
add_taint(TAINT_DIE, LOCKDEP_NOW_UNRELIABLE);
add_taint(TAINT_DIE);
raw_spin_unlock_irq(&die_lock);
oops_exit();

Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/avr32/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ void die(const char *str, struct pt_regs *regs, long err)
show_regs_log_lvl(regs, KERN_EMERG);
show_stack_log_lvl(current, regs->sp, regs, KERN_EMERG);
bust_spinlocks(0);
add_taint(TAINT_DIE, LOCKDEP_NOW_UNRELIABLE);
add_taint(TAINT_DIE);
spin_unlock_irq(&die_lock);

if (in_interrupt())
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/hexagon/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ int die(const char *str, struct pt_regs *regs, long err)
do_show_stack(current, &regs->r30, pt_elr(regs));

bust_spinlocks(0);
add_taint(TAINT_DIE, LOCKDEP_NOW_UNRELIABLE);
add_taint(TAINT_DIE);

spin_unlock_irq(&die.lock);

Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/ia64/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ die (const char *str, struct pt_regs *regs, long err)

bust_spinlocks(0);
die.lock_owner = -1;
add_taint(TAINT_DIE, LOCKDEP_NOW_UNRELIABLE);
add_taint(TAINT_DIE);
spin_unlock_irq(&die.lock);

if (!regs)
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/m68k/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -1176,7 +1176,7 @@ void die_if_kernel (char *str, struct pt_regs *fp, int nr)
console_verbose();
printk("%s: %08x\n",str,nr);
show_registers(fp);
add_taint(TAINT_DIE, LOCKDEP_NOW_UNRELIABLE);
add_taint(TAINT_DIE);
do_exit(SIGSEGV);
}

Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/mips/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ void __noreturn die(const char *str, struct pt_regs *regs)

printk("%s[#%d]:\n", str, ++die_counter);
show_registers(regs);
add_taint(TAINT_DIE, LOCKDEP_NOW_UNRELIABLE);
add_taint(TAINT_DIE);
raw_spin_unlock_irq(&die_lock);

oops_exit();
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/parisc/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ void die_if_kernel(char *str, struct pt_regs *regs, long err)

show_regs(regs);
dump_stack();
add_taint(TAINT_DIE, LOCKDEP_NOW_UNRELIABLE);
add_taint(TAINT_DIE);

if (in_interrupt())
panic("Fatal exception in interrupt");
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/powerpc/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ static void __kprobes oops_end(unsigned long flags, struct pt_regs *regs,
{
bust_spinlocks(0);
die_owner = -1;
add_taint(TAINT_DIE, LOCKDEP_NOW_UNRELIABLE);
add_taint(TAINT_DIE);
die_nest_count--;
oops_exit();
printk("\n");
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/s390/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ void die(struct pt_regs *regs, const char *str)
print_modules();
show_regs(regs);
bust_spinlocks(0);
add_taint(TAINT_DIE, LOCKDEP_NOW_UNRELIABLE);
add_taint(TAINT_DIE);
spin_unlock_irq(&die_lock);
if (in_interrupt())
panic("Fatal exception in interrupt");
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/sh/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ void die(const char *str, struct pt_regs *regs, long err)
notify_die(DIE_OOPS, str, regs, err, 255, SIGSEGV);

bust_spinlocks(0);
add_taint(TAINT_DIE, LOCKDEP_NOW_UNRELIABLE);
add_taint(TAINT_DIE);
spin_unlock_irq(&die_lock);
oops_exit();

Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/sparc/kernel/setup_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ static void __init process_switch(char c)
break;
}
cheetah_pcache_forced_on = 1;
add_taint(TAINT_MACHINE_CHECK, LOCKDEP_NOW_UNRELIABLE);
add_taint(TAINT_MACHINE_CHECK);
cheetah_enable_pcache();
break;

Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/sparc/kernel/traps_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ void die_if_kernel(char *str, struct pt_regs *regs)

printk("%s(%d): %s [#%d]\n", current->comm, task_pid_nr(current), str, ++die_counter);
show_regs(regs);
add_taint(TAINT_DIE, LOCKDEP_NOW_UNRELIABLE);
add_taint(TAINT_DIE);

__SAVE; __SAVE; __SAVE; __SAVE;
__SAVE; __SAVE; __SAVE; __SAVE;
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/sparc/kernel/traps_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -2383,7 +2383,7 @@ void die_if_kernel(char *str, struct pt_regs *regs)
notify_die(DIE_OOPS, str, regs, 0, 255, SIGSEGV);
__asm__ __volatile__("flushw");
show_regs(regs);
add_taint(TAINT_DIE, LOCKDEP_NOW_UNRELIABLE);
add_taint(TAINT_DIE);
if (regs->tstate & TSTATE_PRIV) {
struct thread_info *tp = current_thread_info();
struct reg_window *rw = (struct reg_window *)
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/unicore32/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ void die(const char *str, struct pt_regs *regs, int err)
ret = __die(str, err, thread, regs);

bust_spinlocks(0);
add_taint(TAINT_DIE, LOCKDEP_NOW_UNRELIABLE);
add_taint(TAINT_DIE);
spin_unlock_irq(&die_lock);
oops_exit();

Expand Down
3 changes: 2 additions & 1 deletion trunk/arch/x86/kernel/cpu/amd.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,8 @@ static void __cpuinit amd_k7_smp_check(struct cpuinfo_x86 *c)
*/
WARN_ONCE(1, "WARNING: This combination of AMD"
" processors is not suitable for SMP.\n");
add_taint(TAINT_UNSAFE_SMP, LOCKDEP_NOW_UNRELIABLE);
if (!test_taint(TAINT_UNSAFE_SMP))
add_taint(TAINT_UNSAFE_SMP);

valid_k7:
;
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/x86/kernel/cpu/mcheck/mce.c
Original file line number Diff line number Diff line change
Expand Up @@ -1082,7 +1082,7 @@ void do_machine_check(struct pt_regs *regs, long error_code)
/*
* Set taint even when machine check was not enabled.
*/
add_taint(TAINT_MACHINE_CHECK, LOCKDEP_NOW_UNRELIABLE);
add_taint(TAINT_MACHINE_CHECK);

severity = mce_severity(&m, cfg->tolerant, NULL);

Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/x86/kernel/cpu/mcheck/p5.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ static void pentium_machine_check(struct pt_regs *regs, long error_code)
smp_processor_id());
}

add_taint(TAINT_MACHINE_CHECK, LOCKDEP_NOW_UNRELIABLE);
add_taint(TAINT_MACHINE_CHECK);
}

/* Set up machine check reporting for processors with Intel style MCE: */
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/x86/kernel/cpu/mcheck/winchip.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
static void winchip_machine_check(struct pt_regs *regs, long error_code)
{
printk(KERN_EMERG "CPU0: Machine Check Exception.\n");
add_taint(TAINT_MACHINE_CHECK, LOCKDEP_NOW_UNRELIABLE);
add_taint(TAINT_MACHINE_CHECK);
}

/* Set up machine check reporting on the Winchip C6 series */
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/x86/kernel/cpu/mtrr/generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ static void generic_get_mtrr(unsigned int reg, unsigned long *base,

if (tmp != mask_lo) {
printk(KERN_WARNING "mtrr: your BIOS has configured an incorrect mask, fixing it.\n");
add_taint(TAINT_FIRMWARE_WORKAROUND, LOCKDEP_STILL_OK);
add_taint(TAINT_FIRMWARE_WORKAROUND);
mask_lo = tmp;
}
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/x86/kernel/dumpstack.c
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ void __kprobes oops_end(unsigned long flags, struct pt_regs *regs, int signr)

bust_spinlocks(0);
die_owner = -1;
add_taint(TAINT_DIE, LOCKDEP_NOW_UNRELIABLE);
add_taint(TAINT_DIE);
die_nest_count--;
if (!die_nest_count)
/* Nest count reaches zero, release the lock. */
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/xtensa/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ void die(const char * str, struct pt_regs * regs, long err)
if (!user_mode(regs))
show_stack(NULL, (unsigned long*)regs->areg[1]);

add_taint(TAINT_DIE, LOCKDEP_NOW_UNRELIABLE);
add_taint(TAINT_DIE);
spin_unlock_irq(&die_lock);

if (in_interrupt())
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/acpi/custom_method.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ static ssize_t cm_write(struct file *file, const char __user * user_buf,
buf = NULL;
if (ACPI_FAILURE(status))
return -EINVAL;
add_taint(TAINT_OVERRIDDEN_ACPI_TABLE, LOCKDEP_NOW_UNRELIABLE);
add_taint(TAINT_OVERRIDDEN_ACPI_TABLE);
}

return count;
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/acpi/osl.c
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ static void acpi_table_taint(struct acpi_table_header *table)
pr_warn(PREFIX
"Override [%4.4s-%8.8s], this is unsafe: tainting kernel\n",
table->signature, table->oem_table_id);
add_taint(TAINT_OVERRIDDEN_ACPI_TABLE, LOCKDEP_NOW_UNRELIABLE);
add_taint(TAINT_OVERRIDDEN_ACPI_TABLE);
}


Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/base/regmap/regmap-debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ static ssize_t regmap_map_write_file(struct file *file,
return -EINVAL;

/* Userspace has been fiddling around behind the kernel's back */
add_taint(TAINT_USER, LOCKDEP_NOW_UNRELIABLE);
add_taint(TAINT_USER);

regmap_write(map, reg, value);
return buf_size;
Expand Down
6 changes: 1 addition & 5 deletions trunk/include/linux/kernel.h
Original file line number Diff line number Diff line change
Expand Up @@ -398,11 +398,7 @@ extern int panic_on_unrecovered_nmi;
extern int panic_on_io_nmi;
extern int sysctl_panic_on_stackoverflow;
extern const char *print_tainted(void);
enum lockdep_ok {
LOCKDEP_STILL_OK,
LOCKDEP_NOW_UNRELIABLE
};
extern void add_taint(unsigned flag, enum lockdep_ok);
extern void add_taint(unsigned flag);
extern int test_taint(unsigned flag);
extern unsigned long get_taint(void);
extern int root_mountflags;
Expand Down
4 changes: 2 additions & 2 deletions trunk/include/linux/module.h
Original file line number Diff line number Diff line change
Expand Up @@ -396,13 +396,13 @@ bool is_module_address(unsigned long addr);
bool is_module_percpu_address(unsigned long addr);
bool is_module_text_address(unsigned long addr);

static inline int within_module_core(unsigned long addr, const struct module *mod)
static inline int within_module_core(unsigned long addr, struct module *mod)
{
return (unsigned long)mod->module_core <= addr &&
addr < (unsigned long)mod->module_core + mod->core_size;
}

static inline int within_module_init(unsigned long addr, const struct module *mod)
static inline int within_module_init(unsigned long addr, struct module *mod)
{
return (unsigned long)mod->module_init <= addr &&
addr < (unsigned long)mod->module_init + mod->init_size;
Expand Down
20 changes: 0 additions & 20 deletions trunk/init/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1670,17 +1670,6 @@ config MODULE_SIG_FORCE
Reject unsigned modules or signed modules for which we don't have a
key. Without this, such modules will simply taint the kernel.

config MODULE_SIG_ALL
bool "Automatically sign all modules"
default y
depends on MODULE_SIG
help
Sign all modules during make modules_install. Without this option,
modules must be signed manually, using the scripts/sign-file tool.

comment "Do not forget to sign required modules with scripts/sign-file"
depends on MODULE_SIG_FORCE && !MODULE_SIG_ALL

choice
prompt "Which hash algorithm should modules be signed with?"
depends on MODULE_SIG
Expand Down Expand Up @@ -1713,15 +1702,6 @@ config MODULE_SIG_SHA512

endchoice

config MODULE_SIG_HASH
string
depends on MODULE_SIG
default "sha1" if MODULE_SIG_SHA1
default "sha224" if MODULE_SIG_SHA224
default "sha256" if MODULE_SIG_SHA256
default "sha384" if MODULE_SIG_SHA384
default "sha512" if MODULE_SIG_SHA512

endif # MODULES

config INIT_ALL_POSSIBLE
Expand Down
22 changes: 19 additions & 3 deletions trunk/kernel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,23 @@ kernel/modsign_certificate.o: signing_key.x509 extra_certificates
# fail and that the kernel may be used afterwards.
#
###############################################################################
ifndef CONFIG_MODULE_SIG_HASH
sign_key_with_hash :=
ifeq ($(CONFIG_MODULE_SIG_SHA1),y)
sign_key_with_hash := -sha1
endif
ifeq ($(CONFIG_MODULE_SIG_SHA224),y)
sign_key_with_hash := -sha224
endif
ifeq ($(CONFIG_MODULE_SIG_SHA256),y)
sign_key_with_hash := -sha256
endif
ifeq ($(CONFIG_MODULE_SIG_SHA384),y)
sign_key_with_hash := -sha384
endif
ifeq ($(CONFIG_MODULE_SIG_SHA512),y)
sign_key_with_hash := -sha512
endif
ifeq ($(sign_key_with_hash),)
$(error Could not determine digest type to use from kernel config)
endif

Expand All @@ -166,8 +182,8 @@ signing_key.priv signing_key.x509: x509.genkey
@echo "### needs to be run as root, and uses a hardware random"
@echo "### number generator if one is available."
@echo "###"
openssl req -new -nodes -utf8 -$(CONFIG_MODULE_SIG_HASH) -days 36500 \
-batch -x509 -config x509.genkey \
openssl req -new -nodes -utf8 $(sign_key_with_hash) -days 36500 -batch \
-x509 -config x509.genkey \
-outform DER -out signing_key.x509 \
-keyout signing_key.priv
@echo "###"
Expand Down
Loading

0 comments on commit c1cdfdd

Please sign in to comment.