Re: [PATCH 1/2] landlock: Fix landlock_restrict_self() failure on long executable paths

From
sashiko-bot@kernel.org
Date
2026-11-11 04:59:21
Reply to
Daejun Park via B4 Relay, 2026-11-11
From: Daejun Park <redacted>

get_current_exe() treats a d_path() error on the current executable as
a bug. But an absolute path is not bounded by PATH_MAX, and d_path()
returns -ENAMETOOLONG when the path does not fit in the
LANDLOCK_PATH_MAX_SIZE buffer.

An unprivileged task with such an executable triggers the
WARN_ON_ONCE(), and its landlock_restrict_self() call fails with
-ENAMETOOLONG.

The path is not used for enforcement. Record "<too_long>" instead, as
audit_log_d_path() does, and create the domain.

Reported-by: Dwi Siswanto <redacted>
Closes: https://lore.kernel.org/r/20261102022018.73143-1-me@dw1.io (local)
Suggested-by: Dwi Siswanto <redacted>
Fixes: 1d636984e088 ("landlock: Add AUDIT_LANDLOCK_DOMAIN and log domain status")
Cc: <redacted>
Signed-off-by: Daejun Park <redacted>
Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261111-landlock-long-exe-v1-0-588cfd174a10@samsung.com?part=1
Thread (5 messages) 5 messages, 2 authors, last reply 5d 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