mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] cgroup: fix cgroup.kill for exited thread group leader
@ 2026-10-18 22:04 Kir Kolyshkin
  2026-10-18 22:04 ` [PATCH 1/2] " Kir Kolyshkin
  2026-10-18 22:04 ` [PATCH 2/2] selftests/cgroup: test cgroup.kill with an " Kir Kolyshkin
  0 siblings, 2 replies; 4+ messages in thread
From: Kir Kolyshkin @ 2026-10-18 22:04 UTC (permalink / raw)
  To: Tejun Heo, Johannes Weiner, Michal Koutný,
	Serge Hallyn, Shakeel Butt, Roman Gushchin, Christian Brauner,
	Shuah Khan
  Cc: Eric W. Biederman, Oleg Nesterov, cgroups, linux-kernel,
	linux-kselftest, Kir Kolyshkin

cgroup.kill fails to kill a process whose thread group leader has
exited while other threads are still running, leaving the cgroup
populated. This can be used by a process in a container to survive
the container being killed, including the case of a container with a
private PID namespace, where such a process is the container's init.

Patch 1 fixes __cgroup_kill() to walk all threads and to send a
thread-group-directed SIGKILL. Patch 2 adds selftests for both
scenarios described in patch 1; they fail without the fix.

Tested on v7.3-rc7 (x86_64 VM): test_kill passes (30 runs), other
cgroup selftests show no changes compared to the unpatched kernel.

The issue was found in crun, see patch 1 for details.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
---
Kir Kolyshkin (2):
      cgroup: fix cgroup.kill for exited thread group leader
      selftests/cgroup: test cgroup.kill with an exited thread group leader

 kernel/cgroup/cgroup.c                     |   4 +-
 tools/testing/selftests/cgroup/test_kill.c | 158 +++++++++++++++++++++++++++++
 2 files changed, 160 insertions(+), 2 deletions(-)
---
base-commit: f909e534f5e34feb2ea2701d54df63e21aa506fc
change-id: 20261018-cgroup-kill-exited-leader-a15159e8c230

Best regards,
-- 
Kir Kolyshkin <kolyshkin@gmail.com>


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-10-19 12:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-18 22:04 [PATCH 0/2] cgroup: fix cgroup.kill for exited thread group leader Kir Kolyshkin
2026-10-18 22:04 ` [PATCH 1/2] " Kir Kolyshkin
2026-10-19 12:57   ` Oleg Nesterov
2026-10-18 22:04 ` [PATCH 2/2] selftests/cgroup: test cgroup.kill with an " Kir Kolyshkin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®