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