Skip to content

kthread, exit: clean up kernel thread exit paths

Christian Brauner audit bpf io-uring kvm linux-doc linux-fsdevel linux-mm linux-modules linux-nfs linux-security-module linux-trace-kernel lkml netdev netfs rcu virtualization 2 versions – In review

Get series with b4
b4 am [email protected] change-id 20260306-work-kernel-exit-2e8fd9e2c2a1

Versions newest first

  1. v2 Latest2 patches 5 repliesIn review
  2. v11 patch 8 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2kthread: remove kthread_exit()include/linux/kthread.h include/linux/module.h include/linux/sunrpc/svc.h +4 more+8 -103 replies
2/2tree-wide: rename do_exit() to task_exit()Documentation/accounting/taskstats-struct.rst Documentation/locking/robust-futexes.rst Documentation/trace/kprobes.rst +33 more+58 -582 replies

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchFrederic Weisbecker
1/2R-b
2/2A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/2] kthread, exit: clean up kernel thread exit paths

In 28aaa9c39945 ("kthread: consolidate kthread exit paths to prevent use-after-free") we folded kthread_exit() into do_exit() to fix a UAF bug but left kthread_exit() around as an alias. Remove it.

While at it, rename do_exit() to task_exit() to communicate that is not just a private api.

---
Christian Brauner (2):
kthread: remove kthread_exit()
tree-wide: rename do_exit() to task_exit()

 Documentation/accounting/taskstats-struct.rst                |  2 +-
 Documentation/locking/robust-futexes.rst                     |  8 ++++----
 Documentation/trace/kprobes.rst                              |  2 +-
 fs/cachefiles/namei.c                                        |  2 +-
 include/linux/kernel.h                                       |  2 +-
 include/linux/kthread.h                                      |  1 -
 include/linux/module.h                                       |  2 +-
 include/linux/sunrpc/svc.h                                   |  2 +-
 io_uring/io-wq.c                                             |  2 +-
 io_uring/sqpoll.c                                            |  2 +-
 kernel/acct.c                                                |  2 +-
 kernel/auditsc.c                                             |  4 ++--
 kernel/bpf/verifier.c                                        |  2 +-
 kernel/exit.c                                                | 10 +++++-----
 kernel/futex/futex.h                                         |  2 +-
 kernel/futex/pi.c                                            |  2 +-
 kernel/futex/syscalls.c                                      |  2 +-
 kernel/kthread.c                                             |  8 ++++----
 kernel/locking/rwsem.c                                       |  2 +-
 kernel/module/main.c                                         |  2 +-
 kernel/pid_namespace.c                                       |  2 +-
 kernel/rcu/tasks.h                                           | 12 ++++++------
 kernel/reboot.c                                              |  6 +++---
 kernel/seccomp.c                                             |  8 ++++----
 kernel/signal.c                                              |  4 ++--
 kernel/time/posix-timers.c                                   |  2 +-
 kernel/umh.c                                                 |  2 +-
 kernel/vhost_task.c                                          |  2 +-
 lib/kunit/try-catch.c                                        |  2 +-
 mm/hugetlb.c                                                 |  2 +-
 security/tomoyo/gc.c                                         |  2 +-
 tools/objtool/noreturns.h                                    |  3 +--
 tools/testing/selftests/bpf/prog_tests/tracing_failure.c     |  2 +-
 tools/testing/selftests/bpf/progs/tracing_failure.c          |  2 +-
 .../selftests/ftrace/test.d/dynevent/fprobe_syntax_errors.tc |  2 +-
 .../selftests/ftrace/test.d/kprobe/kprobe_multiprobe.tc      |  2 +-
 .../selftests/ftrace/test.d/kprobe/kprobe_syntax_errors.tc   |  2 +-
 37 files changed, 58 insertions(+), 60 deletions(-)

---
base-commit: 1f318b96cc84d7c2ab792fcc0bfd42a7ca890681
change-id: 20260306-work-kernel-exit-2e8fd9e2c2a1