You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
libmount: restricted-mode check via AT_SECURE breaks setuid mount helpers #4636
Since v2.42, setuid mount helpers are treated as "restricted" even when they hold full root credentials. libmount then requires an /etc/fstab entry, and the mount fails. This is a regression from v2.41.3
Reproducer, with squashfs-mount (setuid root), as a non-root user:
On 2.41.3 this prints Hello there. On 2.42.x it fails with mnt: can't find in /etc/fstab, which is misleading, as no fstab entry was ever needed for this mount.
is_privileged_execution() is getauxval(AT_SECURE) != 0. The two checks are not equivalent, as ruid == euid reflects current credentials, so a helper that raises its real uid to 0 before calling libmount is correctly seen as unrestricted. AT_SECURE is latched by the kernel at exec and never cleared, so the same helper now stays restricted forever. mnt_context_apply_fstab() then sets MNT_OMODE_USER, the fstab lookup misses, and the failure is flattened to MNT_ERR_NOFSTAB.
Introduced by b36add0 and 78914c8, both released in v2.42
It's a good point that for a shared library, AT_SECURE is a bad choice.
The best would be to have mnt_contect_set_restricted(cxt, is_privileged_execution() ); in tools like /bin/mount rather than in the library, which has to be more portable.
Activity
karelzak commentedon Sep 17, 2026
It's a good point that for a shared library, AT_SECURE is a bad choice.
The best would be to have
mnt_contect_set_restricted(cxt, is_privileged_execution() );in tools like/bin/mountrather than in the library, which has to be more portable.libmount: test restricted mode after setuid