Commit 7af959b5 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branch 'SA_IMMUTABLE-fixes-for-v5.16-rc2' of...

Merge branch 'SA_IMMUTABLE-fixes-for-v5.16-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace

Pull exit-vs-signal handling fixes from Eric Biederman:
 "This is a small set of changes where debuggers were no longer able to
  intercept synchronous SIGTRAP and SIGSEGV, introduced by the exit
  cleanups.

  This is essentially the change you suggested with all of i's dotted
  and the t's crossed so that ptrace can intercept all of the cases it
  has been able to intercept the past, and all of the cases that made it
  to exit without giving ptrace a chance still don't give ptrace a
  chance"

* 'SA_IMMUTABLE-fixes-for-v5.16-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace:
  signal: Replace force_fatal_sig with force_exit_sig when in doubt
  signal: Don't always set SA_IMMUTABLE for forced signals
parents ecd510d2 fcb116bc
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1145,7 +1145,7 @@ asmlinkage void set_esp0(unsigned long ssp)
 */
asmlinkage void fpsp040_die(void)
{
	force_fatal_sig(SIGSEGV);
	force_exit_sig(SIGSEGV);
}

#ifdef CONFIG_M68KFPU_EMU
+1 −1
Original line number Diff line number Diff line
@@ -1063,7 +1063,7 @@ SYSCALL_DEFINE3(swapcontext, struct ucontext __user *, old_ctx,
	 * We kill the task with a SIGSEGV in this situation.
	 */
	if (do_setcontext(new_ctx, regs, 0)) {
		force_fatal_sig(SIGSEGV);
		force_exit_sig(SIGSEGV);
		return -EFAULT;
	}

+2 −2
Original line number Diff line number Diff line
@@ -704,7 +704,7 @@ SYSCALL_DEFINE3(swapcontext, struct ucontext __user *, old_ctx,
	 */

	if (__get_user_sigset(&set, &new_ctx->uc_sigmask)) {
		force_fatal_sig(SIGSEGV);
		force_exit_sig(SIGSEGV);
		return -EFAULT;
	}
	set_current_blocked(&set);
@@ -713,7 +713,7 @@ SYSCALL_DEFINE3(swapcontext, struct ucontext __user *, old_ctx,
		return -EFAULT;
	if (__unsafe_restore_sigcontext(current, NULL, 0, &new_ctx->uc_mcontext)) {
		user_read_access_end();
		force_fatal_sig(SIGSEGV);
		force_exit_sig(SIGSEGV);
		return -EFAULT;
	}
	user_read_access_end();
+1 −1
Original line number Diff line number Diff line
@@ -84,7 +84,7 @@ static void default_trap_handler(struct pt_regs *regs)
{
	if (user_mode(regs)) {
		report_user_fault(regs, SIGSEGV, 0);
		force_fatal_sig(SIGSEGV);
		force_exit_sig(SIGSEGV);
	} else
		die(regs, "Unknown program exception");
}
+2 −2
Original line number Diff line number Diff line
@@ -244,7 +244,7 @@ static int setup_frame(struct ksignal *ksig, struct pt_regs *regs,
		get_sigframe(ksig, regs, sigframe_size);

	if (invalid_frame_pointer(sf, sigframe_size)) {
		force_fatal_sig(SIGILL);
		force_exit_sig(SIGILL);
		return -EINVAL;
	}

@@ -336,7 +336,7 @@ static int setup_rt_frame(struct ksignal *ksig, struct pt_regs *regs,
	sf = (struct rt_signal_frame __user *)
		get_sigframe(ksig, regs, sigframe_size);
	if (invalid_frame_pointer(sf, sigframe_size)) {
		force_fatal_sig(SIGILL);
		force_exit_sig(SIGILL);
		return -EINVAL;
	}

Loading