summaryrefslogtreecommitdiffstats
path: root/arch/m68k
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2019-07-09 00:48:15 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2019-07-09 00:48:15 -0400
commit5ad18b2e60b75c7297a998dea702451d33a052ed (patch)
treec47fb503b4cfc8d3e99ad425aadede9832e96dc4 /arch/m68k
parent92c1d6522135050cb377a18cc6e30d08dfb87efb (diff)
parent318759b4737c3b3789e2fd64d539f437d52386f5 (diff)
Merge branch 'siginfo-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace
Pull force_sig() argument change from Eric Biederman: "A source of error over the years has been that force_sig has taken a task parameter when it is only safe to use force_sig with the current task. The force_sig function is built for delivering synchronous signals such as SIGSEGV where the userspace application caused a synchronous fault (such as a page fault) and the kernel responded with a signal. Because the name force_sig does not make this clear, and because the force_sig takes a task parameter the function force_sig has been abused for sending other kinds of signals over the years. Slowly those have been fixed when the oopses have been tracked down. This set of changes fixes the remaining abusers of force_sig and carefully rips out the task parameter from force_sig and friends making this kind of error almost impossible in the future" * 'siginfo-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace: (27 commits) signal/x86: Move tsk inside of CONFIG_MEMORY_FAILURE in do_sigbus signal: Remove the signal number and task parameters from force_sig_info signal: Factor force_sig_info_to_task out of force_sig_info signal: Generate the siginfo in force_sig signal: Move the computation of force into send_signal and correct it. signal: Properly set TRACE_SIGNAL_LOSE_INFO in __send_signal signal: Remove the task parameter from force_sig_fault signal: Use force_sig_fault_to_task for the two calls that don't deliver to current signal: Explicitly call force_sig_fault on current signal/unicore32: Remove tsk parameter from __do_user_fault signal/arm: Remove tsk parameter from __do_user_fault signal/arm: Remove tsk parameter from ptrace_break signal/nds32: Remove tsk parameter from send_sigtrap signal/riscv: Remove tsk parameter from do_trap signal/sh: Remove tsk parameter from force_sig_info_fault signal/um: Remove task parameter from send_sigtrap signal/x86: Remove task parameter from send_sigtrap signal: Remove task parameter from force_sig_mceerr signal: Remove task parameter from force_sig signal: Remove task parameter from force_sigsegv ...
Diffstat (limited to 'arch/m68k')
-rw-r--r--arch/m68k/kernel/signal.c4
-rw-r--r--arch/m68k/kernel/traps.c20
-rw-r--r--arch/m68k/mm/fault.c4
3 files changed, 14 insertions, 14 deletions
diff --git a/arch/m68k/kernel/signal.c b/arch/m68k/kernel/signal.c
index 87e7f3639839..05610e6924c1 100644
--- a/arch/m68k/kernel/signal.c
+++ b/arch/m68k/kernel/signal.c
@@ -803,7 +803,7 @@ asmlinkage int do_sigreturn(struct pt_regs *regs, struct switch_stack *sw)
803 return regs->d0; 803 return regs->d0;
804 804
805badframe: 805badframe:
806 force_sig(SIGSEGV, current); 806 force_sig(SIGSEGV);
807 return 0; 807 return 0;
808} 808}
809 809
@@ -825,7 +825,7 @@ asmlinkage int do_rt_sigreturn(struct pt_regs *regs, struct switch_stack *sw)
825 return regs->d0; 825 return regs->d0;
826 826
827badframe: 827badframe:
828 force_sig(SIGSEGV, current); 828 force_sig(SIGSEGV);
829 return 0; 829 return 0;
830} 830}
831 831
diff --git a/arch/m68k/kernel/traps.c b/arch/m68k/kernel/traps.c
index b2fd000b9285..344f93d36a9a 100644
--- a/arch/m68k/kernel/traps.c
+++ b/arch/m68k/kernel/traps.c
@@ -431,7 +431,7 @@ static inline void bus_error030 (struct frame *fp)
431 pr_err("BAD KERNEL BUSERR\n"); 431 pr_err("BAD KERNEL BUSERR\n");
432 432
433 die_if_kernel("Oops", &fp->ptregs,0); 433 die_if_kernel("Oops", &fp->ptregs,0);
434 force_sig(SIGKILL, current); 434 force_sig(SIGKILL);
435 return; 435 return;
436 } 436 }
437 } else { 437 } else {
@@ -463,7 +463,7 @@ static inline void bus_error030 (struct frame *fp)
463 !(ssw & RW) ? "write" : "read", addr, 463 !(ssw & RW) ? "write" : "read", addr,
464 fp->ptregs.pc); 464 fp->ptregs.pc);
465 die_if_kernel ("Oops", &fp->ptregs, buserr_type); 465 die_if_kernel ("Oops", &fp->ptregs, buserr_type);
466 force_sig (SIGBUS, current); 466 force_sig (SIGBUS);
467 return; 467 return;
468 } 468 }
469 469
@@ -493,7 +493,7 @@ static inline void bus_error030 (struct frame *fp)
493 do_page_fault (&fp->ptregs, addr, 0); 493 do_page_fault (&fp->ptregs, addr, 0);
494 } else { 494 } else {
495 pr_debug("protection fault on insn access (segv).\n"); 495 pr_debug("protection fault on insn access (segv).\n");
496 force_sig (SIGSEGV, current); 496 force_sig (SIGSEGV);
497 } 497 }
498} 498}
499#else 499#else
@@ -571,7 +571,7 @@ static inline void bus_error030 (struct frame *fp)
571 !(ssw & RW) ? "write" : "read", addr, 571 !(ssw & RW) ? "write" : "read", addr,
572 fp->ptregs.pc); 572 fp->ptregs.pc);
573 die_if_kernel("Oops",&fp->ptregs,mmusr); 573 die_if_kernel("Oops",&fp->ptregs,mmusr);
574 force_sig(SIGSEGV, current); 574 force_sig(SIGSEGV);
575 return; 575 return;
576 } else { 576 } else {
577#if 0 577#if 0
@@ -598,7 +598,7 @@ static inline void bus_error030 (struct frame *fp)
598#endif 598#endif
599 pr_debug("Unknown SIGSEGV - 1\n"); 599 pr_debug("Unknown SIGSEGV - 1\n");
600 die_if_kernel("Oops",&fp->ptregs,mmusr); 600 die_if_kernel("Oops",&fp->ptregs,mmusr);
601 force_sig(SIGSEGV, current); 601 force_sig(SIGSEGV);
602 return; 602 return;
603 } 603 }
604 604
@@ -621,7 +621,7 @@ static inline void bus_error030 (struct frame *fp)
621 buserr: 621 buserr:
622 pr_err("BAD KERNEL BUSERR\n"); 622 pr_err("BAD KERNEL BUSERR\n");
623 die_if_kernel("Oops",&fp->ptregs,0); 623 die_if_kernel("Oops",&fp->ptregs,0);
624 force_sig(SIGKILL, current); 624 force_sig(SIGKILL);
625 return; 625 return;
626 } 626 }
627 627
@@ -660,7 +660,7 @@ static inline void bus_error030 (struct frame *fp)
660 addr, fp->ptregs.pc); 660 addr, fp->ptregs.pc);
661 pr_debug("Unknown SIGSEGV - 2\n"); 661 pr_debug("Unknown SIGSEGV - 2\n");
662 die_if_kernel("Oops",&fp->ptregs,mmusr); 662 die_if_kernel("Oops",&fp->ptregs,mmusr);
663 force_sig(SIGSEGV, current); 663 force_sig(SIGSEGV);
664 return; 664 return;
665 } 665 }
666 666
@@ -804,7 +804,7 @@ asmlinkage void buserr_c(struct frame *fp)
804 default: 804 default:
805 die_if_kernel("bad frame format",&fp->ptregs,0); 805 die_if_kernel("bad frame format",&fp->ptregs,0);
806 pr_debug("Unknown SIGSEGV - 4\n"); 806 pr_debug("Unknown SIGSEGV - 4\n");
807 force_sig(SIGSEGV, current); 807 force_sig(SIGSEGV);
808 } 808 }
809} 809}
810 810
@@ -1127,7 +1127,7 @@ asmlinkage void trap_c(struct frame *fp)
1127 addr = (void __user*) fp->un.fmtb.daddr; 1127 addr = (void __user*) fp->un.fmtb.daddr;
1128 break; 1128 break;
1129 } 1129 }
1130 force_sig_fault(sig, si_code, addr, current); 1130 force_sig_fault(sig, si_code, addr);
1131} 1131}
1132 1132
1133void die_if_kernel (char *str, struct pt_regs *fp, int nr) 1133void die_if_kernel (char *str, struct pt_regs *fp, int nr)
@@ -1159,6 +1159,6 @@ asmlinkage void fpsp040_die(void)
1159#ifdef CONFIG_M68KFPU_EMU 1159#ifdef CONFIG_M68KFPU_EMU
1160asmlinkage void fpemu_signal(int signal, int code, void *addr) 1160asmlinkage void fpemu_signal(int signal, int code, void *addr)
1161{ 1161{
1162 force_sig_fault(signal, code, addr, current); 1162 force_sig_fault(signal, code, addr);
1163} 1163}
1164#endif 1164#endif
diff --git a/arch/m68k/mm/fault.c b/arch/m68k/mm/fault.c
index 9b6163c05a75..e9b1d7585b43 100644
--- a/arch/m68k/mm/fault.c
+++ b/arch/m68k/mm/fault.c
@@ -30,13 +30,13 @@ int send_fault_sig(struct pt_regs *regs)
30 pr_debug("send_fault_sig: %p,%d,%d\n", addr, signo, si_code); 30 pr_debug("send_fault_sig: %p,%d,%d\n", addr, signo, si_code);
31 31
32 if (user_mode(regs)) { 32 if (user_mode(regs)) {
33 force_sig_fault(signo, si_code, addr, current); 33 force_sig_fault(signo, si_code, addr);
34 } else { 34 } else {
35 if (fixup_exception(regs)) 35 if (fixup_exception(regs))
36 return -1; 36 return -1;
37 37
38 //if (signo == SIGBUS) 38 //if (signo == SIGBUS)
39 // force_sig_fault(si_signo, si_code, addr, current); 39 // force_sig_fault(si_signo, si_code, addr);
40 40
41 /* 41 /*
42 * Oops. The kernel tried to access some bad page. We'll have to 42 * Oops. The kernel tried to access some bad page. We'll have to