]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
signal: Replace force_sigsegv(SIGSEGV) with force_fatal_sig(SIGSEGV)
authorEric W. Biederman <ebiederm@xmission.com>
Mon, 25 Oct 2021 15:50:57 +0000 (10:50 -0500)
committerAndrea Righi <andrea.righi@canonical.com>
Tue, 7 Dec 2021 06:34:25 +0000 (07:34 +0100)
BugLink: https://bugs.launchpad.net/bugs/1952579
commit e21294a7aaae32c5d7154b187113a04db5852e37 upstream.

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>
Cc: Thomas Backlund <tmb@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
arch/arc/kernel/process.c
arch/m68k/kernel/traps.c
arch/powerpc/kernel/signal_32.c
arch/powerpc/kernel/signal_64.c
arch/s390/kernel/traps.c
arch/um/kernel/trap.c
arch/x86/kernel/vm86_32.c
fs/exec.c

index 3793876f42d9b25bc198dfa899b584e15d6061b3..8e90052f6f0569722e961a49ecb843bde37fab86 100644 (file)
@@ -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;
        }
 
index 9718ce94cc845ab36c393b6dda9a349247bc6da3..99058a6da956da2f4c10ace2fc45cc6e7ff19cef 100644 (file)
@@ -1145,7 +1145,7 @@ asmlinkage void set_esp0(unsigned long ssp)
  */
 asmlinkage void fpsp040_die(void)
 {
-       force_sigsegv(SIGSEGV);
+       force_fatal_sig(SIGSEGV);
 }
 
 #ifdef CONFIG_M68KFPU_EMU
index 666f3da412327f93c4b8b737f2015807140c4400..933ab95805a6c43729b1699d5bc9646d94382051 100644 (file)
@@ -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;
        }
 
index d8de622c9e4a2b0eca736cea6ea5d238281a1b67..8ead9b3f47c61f040c6e56aa580d8b265c18d9e2 100644 (file)
@@ -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);
@@ -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();
index 51729ea2cf8e75d1b0ccf95f0445692c05f186c4..01a7c68dcfb6ee22142c599c15de05513763cf8f 100644 (file)
@@ -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");
 }
index 3198c47673879141865a76d99b226dd3a9aab3a9..c32efb09db2142cd3a53a481a18c4276f33b196b 100644 (file)
@@ -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
index 7e0c89937881a1205e3a9daac76dd26dda6f347b..955349516fdd1e5b103d7e7eb6ecf75b763081e8 100644 (file)
@@ -162,7 +162,7 @@ Efault_end:
        user_access_end();
 Efault:
        pr_alert("could not access userspace vm86 info\n");
-       force_sigsegv(SIGSEGV);
+       force_fatal_sig(SIGSEGV);
        goto exit_vm86;
 }
 
index a098c133d8d74039e46256ac365883148911b9ae..ac7b51b51f38af38422cd24abad2ddff02bb0bed 100644 (file)
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -1852,7 +1852,7 @@ out:
         * 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;