Skip to content

exit cleanups

Eric W. Biederman linux-arch linux-mips linux-s390 linux-sh linuxppc-dev lkml openrisc sparclinux 1 version Merged

Status from this message: has been merged into torvalds/linux.git:

Get series with b4
b4 am 87y26nmwkb.fsf@disp2133

Versions newest first

  1. v1 Latest20 patches 73 repliesMerged

Patches in v1 Merged

#Subject and filesSizeRepliesApplied
1/20exit/doublefault: Remove apparently bogus comment about rewind_stack_do_exitarch/x86/kernel/doublefault_32.c+0 -31 reply
2/20exit: Remove calls of do_exit after noreturn versions of diearch/nds32/kernel/traps.c arch/nds32/mm/fault.c arch/openrisc/kernel/traps.c +8 more+9 -202 replies
3/20reboot: Remove the unreachable panic after do_exit in reboot(2)kernel/reboot.c+0 -11 reply
4/20signal/sparc32: Remove unreachable do_exit in do_sparc_faultarch/sparc/mm/fault_32.c+0 -11 reply
5/20signal/mips: Update (_save|_restore)_fp_context to fail with -EFAULTarch/mips/kernel/r2300_fpu.S arch/mips/kernel/syscall.c+2 -114 replies
6/20signal/sh: Use force_sig(SIGKILL) instead of do_group_exit(SIGKILL)arch/sh/kernel/cpu/fpu.c+6 -43 replies
7/20signal/powerpc: On swapcontext failure force SIGSEGVarch/powerpc/kernel/signal_32.c arch/powerpc/kernel/signal_64.c+10 -51 reply
8/20signal/sparc: In setup_tsb_params convert open coded BUG into BUGarch/sparc/mm/tsb.c+1 -11 reply
9/20signal/vm86_32: Replace open coded BUG_ON with an actual BUG_ONarch/x86/kernel/vm86_32.c+2 -410 replies
10/20signal/vm86_32: Properly send SIGSEGV when the vm86 state cannot be saved.arch/x86/kernel/signal.c arch/x86/kernel/vm86_32.c+6 -210 replies
11/20signal/s390: Use force_sigsegv in default_trap_handlerarch/s390/kernel/traps.c+1 -14 replies
12/20exit/kthread: Have kernel threads return instead of calling do_exitdrivers/firmware/stratix10-svc.c drivers/soc/ti/wkup_m3_ipc.c fs/ocfs2/journal.c +2 more+6 -93 replies
13/20signal: Implement force_fatal_siginclude/linux/sched/signal.h kernel/signal.c+18 -911 replies
14/20exit/syscall_user_dispatch: Send ordinary signals on failurekernel/entry/syscall_user_dispatch.c+8 -46 replies
15/20signal/sparc32: Exit with a fatal signal when try_to_clear_window_buffer failsarch/sparc/kernel/windows.c+4 -22 replies
16/20signal/sparc32: In setup_rt_frame and setup_fram use force_fatal_sigarch/sparc/kernel/signal_32.c+2 -21 reply
17/20signal/x86: In emulate_vsyscall force a signal instead of calling do_exitarch/x86/entry/vsyscall/vsyscall_64.c+2 -11 reply
18/20exit/rtl8723bs: Replace the macro thread_exit with a simple return 0drivers/staging/rtl8723bs/core/rtw_cmd.c drivers/staging/rtl8723bs/core/rtw_xmit.c drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c +1 more+3 -53 replies
19/20exit/rtl8712: Replace the macro thread_exit with a simple return 0drivers/staging/rtl8712/osdep_service.h drivers/staging/rtl8712/rtl8712_cmd.c+1 -22 replies
20/20exit/r8188eu: Replace the macro thread_exit with a simple return 0drivers/staging/r8188eu/core/rtw_cmd.c drivers/staging/r8188eu/core/rtw_mp.c drivers/staging/r8188eu/include/osdep_service.h+2 -42 replies

Reviews trailers per patch

19 of 20 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchGreg Kroah-HartmanGeert UytterhoevenPhilippe Mathieu-DaudéKees CookGabriel Krisman BertaziMaciej W. RozyckiThomas BogendoerferChristian BorntraegerEric W. Biederman
SeriesA-b R-b
1/20R-b
2/20R-b
3/20R-b
4/20R-b
5/20R-b A-b A-b
6/20R-b
7/20R-b
8/20R-b
9/20R-b T-b
10/20R-b
11/20R-b R-b
12/20R-b
13/20R-b
14/20R-b R-b
15/20
16/20R-b
17/20R-b
18/20A-b R-b
19/20A-b R-b
20/20A-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 9 reviewers.

Read the v1 thread

Cover letter [PATCH 00/20] exit cleanups

While looking at some issues related to the exit path in the kernel I found several instances where the code is not using the existing abstractions properly.

This set of changes introduces force_fatal_sig a way of sending a signal and not allowing it to be caught, and corrects the misuse of the existing abstractions that I found.

A lot of the misuse of the existing abstractions are silly things such as doing something after calling a no return function, rolling BUG by hand, doing more work than necessary to terminate a kernel thread, or calling do_exit(SIGKILL) instead of calling force_sig(SIGKILL).

It is my plan after sending all of these changes out for review to place them in a topic branch for sending Linus. Especially for the changes that depend upon the new helper force_fatal_sig this is important.

Eric W. Biederman (20):
exit/doublefault: Remove apparently bogus comment about rewind_stack_do_exit
exit: Remove calls of do_exit after noreturn versions of die
reboot: Remove the unreachable panic after do_exit in reboot(2) signal/sparc32: Remove unreachable do_exit in do_sparc_fault signal/mips: Update (_save|_restore)_fp_context to fail with -EFAULT signal/sh: Use force_sig(SIGKILL) instead of do_group_exit(SIGKILL) signal/powerpc: On swapcontext failure force SIGSEGV signal/sparc: In setup_tsb_params convert open coded BUG into BUG signal/vm86_32: Replace open coded BUG_ON with an actual BUG_ON signal/vm86_32: Properly send SIGSEGV when the vm86 state cannot be saved. signal/s390: Use force_sigsegv in default_trap_handler exit/kthread: Have kernel threads return instead of calling do_exit
signal: Implement force_fatal_sig
exit/syscall_user_dispatch: Send ordinary signals on failure signal/sparc32: Exit with a fatal signal when try_to_clear_window_buffer fails signal/sparc32: In setup_rt_frame and setup_fram use force_fatal_sig signal/x86: In emulate_vsyscall force a signal instead of calling do_exit exit/rtl8723bs: Replace the macro thread_exit with a simple return 0 exit/rtl8712: Replace the macro thread_exit with a simple return 0 exit/r8188eu: Replace the macro thread_exit with a simple return 0

 arch/mips/kernel/r2300_fpu.S                       |  4 ++--
 arch/mips/kernel/syscall.c                         |  9 --------
 arch/nds32/kernel/traps.c                          |  2 +-
 arch/nds32/mm/fault.c                              |  6 +----
 arch/openrisc/kernel/traps.c                       |  2 +-
 arch/openrisc/mm/fault.c                           |  4 +---
 arch/powerpc/kernel/signal_32.c                    |  6 +++--
 arch/powerpc/kernel/signal_64.c                    |  9 +++++---
 arch/s390/include/asm/kdebug.h                     |  2 +-
 arch/s390/kernel/dumpstack.c                       |  2 +-
 arch/s390/kernel/traps.c                           |  2 +-
 arch/s390/mm/fault.c                               |  2 --
 arch/sh/kernel/cpu/fpu.c                           | 10 +++++----
 arch/sh/kernel/traps.c                             |  2 +-
 arch/sh/mm/fault.c                                 |  2 --
 arch/sparc/kernel/signal_32.c                      |  4 ++--
 arch/sparc/kernel/windows.c                        |  6 +++--
 arch/sparc/mm/fault_32.c                           |  1 -
 arch/sparc/mm/tsb.c                                |  2 +-
 arch/x86/entry/vsyscall/vsyscall_64.c              |  3 ++-
 arch/x86/kernel/doublefault_32.c                   |  3 ---
 arch/x86/kernel/signal.c                           |  6 ++++-
 arch/x86/kernel/vm86_32.c                          |  8 +++----
 arch/xtensa/kernel/traps.c                         |  2 +-
 arch/xtensa/mm/fault.c                             |  3 +--
 drivers/firmware/stratix10-svc.c                   |  4 ++--
 drivers/soc/ti/wkup_m3_ipc.c                       |  2 +-
 drivers/staging/r8188eu/core/rtw_cmd.c             |  2 +-
 drivers/staging/r8188eu/core/rtw_mp.c              |  2 +-
 drivers/staging/r8188eu/include/osdep_service.h    |  2 --
 drivers/staging/rtl8712/osdep_service.h            |  1 -
 drivers/staging/rtl8712/rtl8712_cmd.c              |  2 +-
 drivers/staging/rtl8723bs/core/rtw_cmd.c           |  2 +-
 drivers/staging/rtl8723bs/core/rtw_xmit.c          |  2 +-
 drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c     |  2 +-
 .../rtl8723bs/include/osdep_service_linux.h        |  2 --
 fs/ocfs2/journal.c                                 |  5 +----
 include/linux/sched/signal.h                       |  1 +
 kernel/entry/syscall_user_dispatch.c               | 12 ++++++----
 kernel/kthread.c                                   |  2 +-
 kernel/reboot.c                                    |  1 -
 kernel/signal.c                                    | 26 ++++++++++++++--------
 net/batman-adv/tp_meter.c                          |  2 +-
 43 files changed, 83 insertions(+), 91 deletions(-)

Eric