]> git.ipfire.org Git - thirdparty/systemd.git/commit
binfmt-util: handle ELOOP/EACCES from automount in read-only bind mounts
authorSamuel Dainard <sdainard@amazon.com>
Tue, 28 Apr 2026 15:57:26 +0000 (15:57 +0000)
committerLuca Boccassi <luca.boccassi@gmail.com>
Wed, 29 Apr 2026 20:39:24 +0000 (21:39 +0100)
commit3f2189ca2544cce99c2aa7a35881007830dc221a
treedcb9fa5a115d540a5da2f6b3a62a9414c4243327
parent33ac56f46230f2c425c16eb6297b979f1bb91228
binfmt-util: handle ELOOP/EACCES from automount in read-only bind mounts

When /proc is bind-mounted read-only (common in mock/Koji buildroots,
containers, and other sandboxed environments), opening
/proc/sys/fs/binfmt_misc returns ELOOP if it is an automount point
that cannot be triggered in the read-only context.

Currently binfmt_mounted_and_writable() only handles ENOENT, so ELOOP
propagates as an error. This causes test-binfmt-util to fail with
SIGABRT and disable_binfmt() to log a spurious warning at shutdown.

Treat ELOOP and EACCES the same as ENOENT: binfmt_misc is not usably
available, return false.

Note: PR #37006 (merged April 2025) addressed ELOOP in the xstatfsat()
path, but the open() call in binfmt_mounted_and_writable() remained
unhandled.

Fixes #38070
src/shared/binfmt-util.c