Re: [PATCH v3] landlock: Do not hold exec_update_lock across the TSYNC wait
From: 이성현
Date: Fri Dec 04 2026 - 06:57:25 EST
Hi Mickaël,
I applied v3 on top of mainline 20eef29b7c84 and ran my original
reproducer again (x86_64, KASAN, 2 CPUs under QEMU/KVM). The uid 1000
process calls landlock_restrict_self(TSYNC) while a sibling is stuck on
the parent side of vfork(), and root reads its /proc files during the
wait.
Unpatched, /proc/<pid>/stat, io and syscall block in
down_read_killable() until the vfork child exits. With v3 all of them
return right away while TSYNC is still waiting, landlock_restrict_self()
returns 0 once the vfork child exits, and there are no KASAN or WARN
splats:
[poc] while TSYNC waits:
[poc] read /proc/149/stat: returned (exit 0)
[poc] read /proc/149/io: returned (exit 0)
[poc] read /proc/149/syscall: returned (exit 0)
[poc] read /proc/149/status: returned (exit 0)
[poc] read /proc/149/cmdline: returned (exit 0)
[poc] landlock_restrict_self returned 0 (ok)
The new landlock_tsync KUnit suite passes too (3/3: marker_free,
marker_held, cred_sync_irqsave), along with the other Landlock KUnit
suites.
Tested-by: Lee Seong Hyeon <ihopenre@xxxxxxxxx>
Thanks,
Lee Seong Hyeon