x86 fixes for 4.11
Subsystems (4)
Linus,
please pull the latest x86-urgent-for-linus git tree from:
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86-urgent-for-linus
A set of small fixes for x86:
- Fix locking in RDT to prevent memory leaks and freeing in use memory
- Prevent setting invalid values for vdso32_enabled which cause inconsistencies for user space resulting in application crashes.
- Plug a race in the vdso32 code between fork and sysctl which causes inconsistencies for user space resulting in application crashes.
- Make MPX signal delivery work in compat mode
- Make the dmesg output of traps and faults readable again
Thanks,
tglx
------------------>
Jiri Olsa (1):
x86/intel_rdt: Fix locking in rdtgroup_schemata_write()
Joerg Roedel (1):
x86/signals: Fix lower/upper bound reporting in compat siginfo
Markus Trippelsdorf (1):
x86/debug: Fix the printk() debug output of signal_fault(), do_trap() and do_general_protection()
Mathias Krause (1):
x86/vdso: Ensure vdso32_enabled gets set to valid values only
Thomas Gleixner (1):
x86/vdso: Plug race between mapping and ELF header setup
arch/x86/entry/vdso/vdso32-setup.c | 11 +++++++++-- arch/x86/include/asm/elf.h | 2 +- arch/x86/kernel/cpu/intel_rdt_schemata.c | 2 +- arch/x86/kernel/signal.c | 2 +- arch/x86/kernel/signal_compat.c | 4 ++-- arch/x86/kernel/traps.c | 4 ++-- 6 files changed, 16 insertions(+), 9 deletions(-)
arch/x86/entry/vdso/vdso32-setup.c +9 -2
@@ -30,8 +30,10 @@ static int __init vdso32_setup(char *s) { vdso32_enabled =simple_strtoul (s,NULL ,0 ); -if (vdso32_enabled >1 ) +if (vdso32_enabled >1 ) {pr_warn ("vdso32 values other than 0 and 1 are no longer allowed; vdso disabled\n" ); + vdso32_enabled =0 ; + }return 1 ; }
@@ -62,13 +64,18 @@ subsys_initcall(sysenter_setup);/* Register vsyscall32 into the ABI table */ #include <linux/sysctl.h> +static const int zero; +static const int one =1 ; +static struct ctl_table abi_table2[] = { { .procname ="vsyscall32" , .data = &vdso32_enabled, .maxlen =sizeof (int ), .mode =0644 , - .proc_handler = proc_dointvec + .proc_handler = proc_dointvec_minmax, + .extra1 = (int *)&zero, + .extra2 = (int *)&one, }, {} };
arch/x86/include/asm/elf.h +1 -1
@@ -287,7 +287,7 @@ struct task_struct;#define ARCH_DLINFO_IA32 \ do { \ - if (vdso32_enabled) { \ + if (VDSO_CURRENT_BASE) { \ NEW_AUX_ENT(AT_SYSINFO, VDSO_ENTRY); \ NEW_AUX_ENT(AT_SYSINFO_EHDR, VDSO_CURRENT_BASE); \ } \
arch/x86/kernel/cpu/intel_rdt_schemata.c +1 -1
@@ -200,11 +200,11 @@ ssize_t rdtgroup_schemata_write(struct kernfs_open_file *of, } out: -rdtgroup_kn_unlock (of->kn);for_each_enabled_rdt_resource (r) {kfree (r->tmp_cbms); r->tmp_cbms =NULL ; } +rdtgroup_kn_unlock (of->kn);return ret ?: nbytes; }
arch/x86/kernel/signal.c +1 -1
@@ -846,7 +846,7 @@ void signal_fault(struct pt_regs *regs, void __user *frame, char *where)task_pid_nr (current) >1 ?KERN_INFO :KERN_EMERG , me->comm, me->pid, where, frame, regs->ip, regs->sp, regs->orig_ax); -print_vma_addr (" in " , regs->ip); +print_vma_addr (KERN_CONT " in " , regs->ip);pr_cont ("\n" ); }
arch/x86/kernel/signal_compat.c +2 -2
@@ -151,8 +151,8 @@ int __copy_siginfo_to_user32(compat_siginfo_t __user *to, const siginfo_t *from,if (from->si_signo ==SIGSEGV ) {if (from->si_code ==SEGV_BNDERR ) { -compat_uptr_t lower = (unsigned long )&to->si_lower; -compat_uptr_t upper = (unsigned long )&to->si_upper; +compat_uptr_t lower = (unsigned long )from->si_lower; +compat_uptr_t upper = (unsigned long )from->si_upper;put_user_ex (lower, &to->si_lower);put_user_ex (upper, &to->si_upper); }
arch/x86/kernel/traps.c +2 -2
@@ -255,7 +255,7 @@ do_trap(int trapnr, int signr, char *str, struct pt_regs *regs,pr_info ("%s[%d] trap %s ip:%lx sp:%lx error:%lx" , tsk->comm, tsk->pid, str, regs->ip, regs->sp, error_code); -print_vma_addr (" in " , regs->ip); +print_vma_addr (KERN_CONT " in " , regs->ip);pr_cont ("\n" ); }
@@ -519,7 +519,7 @@ do_general_protection(struct pt_regs *regs, long error_code)pr_info ("%s[%d] general protection ip:%lx sp:%lx error:%lx" , tsk->comm,task_pid_nr (tsk), regs->ip, regs->sp, error_code); -print_vma_addr (" in " , regs->ip); +print_vma_addr (KERN_CONT " in " , regs->ip);pr_cont ("\n" ); }