Re: [PATCH] yama: hold the PR_SET_PTRACER tracer by its struct pid

From
sashiko-bot@kernel.org
Date
2026-11-19 03:07:27
Reply to
JunYoung Lee, 2026-11-19
Hi Kees,

An unprivileged user can make Yama read a freed task_struct with the
default ptrace_scope=1. relation->tracer is stored without a reference,
and yama_task_free() marks the relation invalid only just before the
task is freed, so a concurrent ptracer_exception_found() can still
dereference it in task_is_descendant(). The KASAN report, the details
and the fix are in the patch below.

This is the problem Oleg Nesterov described on LKML on 2018-10-29
("yama: unsafe usage of ptrace_relation->tracer"). It was never fixed.

Affected (reproduced under KASAN as uid 65534):
- mainline 4405c18c95d2 (v7.4-rc3-230)
- stable 6.12.118
[ ... ]

Link: https://lore.kernel.org/all/0000000000004904df0578b7d3da@google.com/T/ (local)
Fixes: 93b69d437eff ("Yama: add RCU to drop read locking")
Cc: <redacted>
Signed-off-by: JunYoung Lee <redacted>
Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261119025918.86247-1-ljyoung04@gmail.com?part=1
Thread (3 messages) 3 messages, 3 authors, last reply 1d ago
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help