All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/2] taskstats: fix cross-netns exit listener delivery
@ 2026-10-02 10:56 tjdqudcks0424
  2026-10-02 10:56 ` [PATCH v3 1/2] taskstats: route exit listener records through their netns tjdqudcks0424
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: tjdqudcks0424 @ 2026-10-02 10:56 UTC (permalink / raw)
  To: bsingharora, akpm
  Cc: xu.xin, gregkh, shuah, cyyzero16, linux-kernel, linux-kselftest,
	성병찬

From: 성병찬 <tjdqudcks0424@naver.com>

CPU-mask taskstats listeners are currently identified only by a numeric
Generic Netlink port ID and exit records are sent through init_net. Since
port IDs are namespace-local, an unprivileged init_net socket can bind the
same number as a listener in another network namespace and receive that
listener's cross-UID exit record.

Patch 1 associates listener entries with the registering Generic Netlink
socket's namespace and port ID and cleans them up when that socket closes.
Patch 2 adds an acct kselftest which constructs the collision and checks the
normal listener, explicit deregistration, and unrelated-port controls.

The test was built with GCC using -Wall -Wextra and run in disposable QEMU
guests with the same userspace binary. On the unmodified baseline it reports
3 passes and 1 failure: the child-netns listener misses the victim record and
the colliding unprivileged init_net socket receives it. On the fixed kernel,
three independent clean boots each report 4 passes and no failures. No
KASAN, UBSAN, BUG, WARNING, Oops, panic, lockdep, refcount, use-after-free,
out-of-bounds, or kmemleak diagnostic was emitted during the final runs.

The exact Message-ID and lore URL of the previous public posting were not
present in the available local sent-mail or raw-mail artifacts:

Link: https://lore.kernel.org/r/20261002075842.146026-1-tjdqudcks0424@naver.com/

Changes in v3:
- remove wording that called a private draft "v1"
- add an in-tree taskstats CPU-listener network-namespace regression test
- send the fix and selftest as a two-patch series

성병찬 (2):
  taskstats: route exit listener records through their netns
  selftests: acct: test taskstats listener netns routing

 kernel/taskstats.c                            | 135 ++-
 tools/testing/selftests/acct/Makefile         |   1 +
 .../selftests/acct/taskstats_netns_listener.c | 945 ++++++++++++++++++
 3 files changed, 1037 insertions(+), 44 deletions(-)
 create mode 100644 tools/testing/selftests/acct/taskstats_netns_listener.c


base-commit: ce1e0223d8ad4211275c82a17ed6d43ab81e13d9
-- 
2.43.0

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

end of thread, other threads:[~2026-10-03  2:34 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-02 10:56 [PATCH v3 0/2] taskstats: fix cross-netns exit listener delivery tjdqudcks0424
2026-10-02 10:56 ` [PATCH v3 1/2] taskstats: route exit listener records through their netns tjdqudcks0424
2026-10-02 16:40   ` Bradley Morgan
2026-10-02 10:56 ` [PATCH v3 2/2] selftests: acct: test taskstats listener netns routing tjdqudcks0424
2026-10-02 16:43   ` Bradley Morgan
2026-10-03  2:24     ` tjdqudcks0424
2026-10-02 11:06 ` [PATCH v3 0/2] taskstats: fix cross-netns exit listener delivery Greg KH

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.