From: "Günther Noack" <gnoack@google.com>
To: Ken Grimes <ken@kengrimes.com>
Cc: "linux-security-module@vger.kernel.org"
<linux-security-module@vger.kernel.org>,
"Mickaël Salaün" <mic@digikod.net>,
landlock@lists.linux.dev
Subject: Re: [BUG] Landlock denies LANDLOCK_ACCESS_FS_EXECUTE despite a correctly-anchored PathBeneath rule (contradicts selftest layout1.execute)
Date: Wed, 15 Jul 2026 10:39:29 +0200 [thread overview]
Message-ID: <aldGXyfBQz8GsAMn@google.com> (raw)
In-Reply-To: <P8RYlSi7C7oum2lk1F3PumYSvaUyd0Sn_VwUYAcWwjbQxSt_Rau30Aa1oLIEnLZ2iafcsFmEG5C4LTeBWCyd9vCx94FYeTX_OJdHoERcWSI=@kengrimes.com>
Hello Ken!
(Also adding landlock@lists.linux.dev to CC)
On Tue, Jul 14, 2026 at 09:07:56PM +0000, Ken Grimes wrote:
> Hey all, this is my first bug report for linux. The issue was discovered
> alongside llm-assisted coding on a downstream project. The
> investigation/testing of the bug was a mostly manual process so I could
> be sure this was something real. Please let me know if I can provide any
> further details or assistance. Hope this is helpful, thank you for all of your
> hard work!
Welcome and thanks for reporting your first issue!
I believe the issue you are observing is that the /bin/true program you are
starting is a dynamically linked executable. As such, executing it requires
both the LANDLOCK_ACCESS_FS_EXECUTE right on the binary itself and on
the system's dynamic loader binary, which usually lives in /lib/ld-linux.so.*
(but there are symlinks and 32/64-bit differences at play as well, which
influence the actual final location).
You can try this out with the following experiments:
(1) Compile a "true" program statically and try using that:
$ echo 'int main() { return 0; }' > true.c
$ CFLAGS=-static make true
This can be started with the test you have,
unlike the dynamically linked version.
(2) Alternatively, add execute permissions for the dynamic loader:
Add an additional "path beneath" rule that allow-lists the execution
access right on /lib/ld-linux.so.2, /lib64/ld-linux-x86-64.so.2 or
wherever else your dynamic loader is. (You can discover the actual
location using "ldd /bin/true".)
With either one of these two changes, your standalone reproducer program
starts working again. Or at least it does on my machine. If it still doesn't
work on your end that way, please let us know. :)
I admit that we should probably point this out in the Landlock documentation
for the LANDLOCK_ACCESS_FS_EXECUTE right, as dynamic linking is common and it
is a potential issue that many people might run into.
For background on the dynamic loading mechanism, see the man page ld.so(8) [1]
and the LWN article "How programs get run: ELF binaries" [2] (specifically the
section "Dynamically linked programs").
—Günther
[1] https://man7.org/linux/man-pages/man8/ld.so.8.html
[2] https://lwn.net/Articles/631631/
prev parent reply other threads:[~2026-07-15 8:39 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-14 21:07 [BUG] Landlock denies LANDLOCK_ACCESS_FS_EXECUTE despite a correctly-anchored PathBeneath rule (contradicts selftest layout1.execute) Ken Grimes
2026-07-15 8:39 ` Günther Noack [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aldGXyfBQz8GsAMn@google.com \
--to=gnoack@google.com \
--cc=ken@kengrimes.com \
--cc=landlock@lists.linux.dev \
--cc=linux-security-module@vger.kernel.org \
--cc=mic@digikod.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.