exit: Mark do_group_exit() __noreturn
authorPeter Zijlstra <peterz@infradead.org>
Tue, 8 Mar 2022 15:30:48 +0000 (16:30 +0100)
committerPeter Zijlstra <peterz@infradead.org>
Tue, 15 Mar 2022 09:32:43 +0000 (10:32 +0100)
vmlinux.o: warning: objtool: get_signal()+0x108: unreachable instruction

0000 000000000007f930 <get_signal>:
...
0103    7fa33:  e8 00 00 00 00          call   7fa38 <get_signal+0x108> 7fa34: R_X86_64_PLT32   do_group_exit-0x4
0108    7fa38:  41 8b 45 74             mov    0x74(%r13),%eax

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Josh Poimboeuf <jpoimboe@redhat.com>
Link: https://lore.kernel.org/r/20220308154319.351270711@infradead.org
include/linux/sched/task.h
kernel/exit.c
tools/objtool/check.c

index e84e54d1b490f189479e3191ddb2249e9ec36bc3..719c9a6cac8d8f943db81ac4aa4e9abf197ec2d7 100644 (file)
@@ -79,7 +79,7 @@ static inline void exit_thread(struct task_struct *tsk)
 {
 }
 #endif
-extern void do_group_exit(int);
+extern __noreturn void do_group_exit(int);
 
 extern void exit_files(struct task_struct *);
 extern void exit_itimers(struct signal_struct *);
index b00a25bb4ab939fb54e29785f9365c01c1447080..b71f9df9074e2857a18713e54d08337a0f71c97e 100644 (file)
@@ -906,7 +906,7 @@ SYSCALL_DEFINE1(exit, int, error_code)
  * Take down every thread in the group.  This is called by fatal signals
  * as well as by sys_exit_group (below).
  */
-void
+void __noreturn
 do_group_exit(int exit_code)
 {
        struct signal_struct *sig = current->signal;
index c3ddcecdab57a65e5a58e2edeb08285fbdfabcc7..9896562350a8c45a74a0b43295732c26f91cf2b1 100644 (file)
@@ -181,6 +181,7 @@ static bool __dead_end_function(struct objtool_file *file, struct symbol *func,
                "kunit_try_catch_throw",
                "xen_start_kernel",
                "cpu_bringup_and_idle",
+               "do_group_exit",
                "stop_this_cpu",
        };