Skip to content

Commit

Permalink
signal: Replace force_sigsegv(SIGSEGV) with force_fatal_sig(SIGSEGV)
Browse files Browse the repository at this point in the history
Now that force_fatal_sig exists it is unnecessary and a bit confusing
to use force_sigsegv in cases where the simpler force_fatal_sig is
wanted.  So change every instance we can to make the code clearer.

Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Link: https://lkml.kernel.org/r/877de7jrev.fsf@disp2133
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
  • Loading branch information
Eric W. Biederman committed Oct 29, 2021
1 parent 0fdc0c4 commit e21294a
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion arch/arc/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ int elf_check_arch(const struct elf32_hdr *x)
eflags = x->e_flags;
if ((eflags & EF_ARC_OSABI_MSK) != EF_ARC_OSABI_CURRENT) {
pr_err("ABI mismatch - you need newer toolchain\n");
force_sigsegv(SIGSEGV);
force_fatal_sig(SIGSEGV);
return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion arch/m68k/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -1150,7 +1150,7 @@ asmlinkage void set_esp0(unsigned long ssp)
*/
asmlinkage void fpsp040_die(void)
{
force_sigsegv(SIGSEGV);
force_fatal_sig(SIGSEGV);
}

#ifdef CONFIG_M68KFPU_EMU
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/kernel/signal_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -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_sigsegv(SIGSEGV);
force_fatal_sig(SIGSEGV);
return -EFAULT;
}

Expand Down
4 changes: 2 additions & 2 deletions arch/powerpc/kernel/signal_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,7 @@ SYSCALL_DEFINE3(swapcontext, struct ucontext __user *, old_ctx,
*/

if (__get_user_sigset(&set, &new_ctx->uc_sigmask)) {
force_sigsegv(SIGSEGV);
force_fatal_sig(SIGSEGV);
return -EFAULT;
}
set_current_blocked(&set);
Expand All @@ -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_sigsegv(SIGSEGV);
force_fatal_sig(SIGSEGV);
return -EFAULT;
}
user_read_access_end();
Expand Down
2 changes: 1 addition & 1 deletion arch/s390/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ static void default_trap_handler(struct pt_regs *regs)
{
if (user_mode(regs)) {
report_user_fault(regs, SIGSEGV, 0);
force_sigsegv(SIGSEGV);
force_fatal_sig(SIGSEGV);
} else
die(regs, "Unknown program exception");
}
Expand Down
2 changes: 1 addition & 1 deletion arch/um/kernel/trap.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ static void bad_segv(struct faultinfo fi, unsigned long ip)

void fatal_sigsegv(void)
{
force_sigsegv(SIGSEGV);
force_fatal_sig(SIGSEGV);
do_signal(&current->thread.regs);
/*
* This is to tell gcc that we're not returning - do_signal
Expand Down
2 changes: 1 addition & 1 deletion arch/x86/kernel/vm86_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ void save_v86_state(struct kernel_vm86_regs *regs, int retval)
user_access_end();
Efault:
pr_alert("could not access userspace vm86 info\n");
force_sigsegv(SIGSEGV);
force_fatal_sig(SIGSEGV);
goto exit_vm86;
}

Expand Down
2 changes: 1 addition & 1 deletion fs/exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -1852,7 +1852,7 @@ static int bprm_execve(struct linux_binprm *bprm,
* SIGSEGV.
*/
if (bprm->point_of_no_return && !fatal_signal_pending(current))
force_sigsegv(SIGSEGV);
force_fatal_sig(SIGSEGV);

out_unmark:
current->fs->in_exec = 0;
Expand Down

0 comments on commit e21294a

Please sign in to comment.