[PATCH 0/2] landlock: Fix landlock_restrict_self() on long executable paths

Daejun Park via B4 Relay devnull+daejun7.park.samsung.com at kernel.org
Wed Nov 11 04:54:45 UTC 2026


A task whose executable has an absolute path longer than 4106 bytes
triggers a WARN and cannot sandbox itself. Patch 2 adds selftests that
fail without patch 1.

Tested on v7.4-rc2 with KASAN and lockdep. landlock_restrict_self()
from 4107- and 4350-byte paths fails before the series and works after
it. The domain records then show exe="<too_long>". The other Landlock
selftests pass on both kernels, apart from five skipped hostfs tests.

---
Daejun Park (2):
      landlock: Fix landlock_restrict_self() failure on long executable paths
      selftests/landlock: Test a long executable path

 Documentation/admin-guide/LSM/landlock.rst         |   3 +-
 security/landlock/domain.c                         |  15 +-
 security/landlock/domain.h                         |   3 +-
 tools/testing/selftests/landlock/fs_test.c         | 175 +++++++++++++++++++++
 .../testing/selftests/landlock/wait-pipe-sandbox.c |   3 +-
 5 files changed, 192 insertions(+), 7 deletions(-)
---
base-commit: 7475ea8b58616b33c04afb976cf0fbaad9dd63fb
change-id: 20261110-landlock-long-exe-61cbbfbc3300

Best regards,
-- 
Daejun Park <daejun7.park at samsung.com>





More information about the Linux-security-module-archive mailing list