* Re: [PATCH v5 7/8] vfs: Replace security_sb_mount/security_move_mount with granular hooks
@ 2026-06-18 19:33 Bryam Vargas
0 siblings, 0 replies; only message in thread
From: Bryam Vargas @ 2026-06-18 19:33 UTC (permalink / raw)
To: Song Liu
Cc: Christian Brauner, Al Viro, Stephen Smalley, Ondrej Mosnacek,
Mickaël Salaün, John Johansen, Paul Moore,
James Morris, Serge Hallyn, linux-security-module, linux-fsdevel,
linux-kernel
Song,
> + err = security_mount_change_type(path, ms_flags);
This gates the propagation change on the mount(2) path. The same change on
the newer mount_setattr(2)/open_tree_attr(2) path is left open:
do_mount_setattr() -> mount_setattr_commit() calls change_mnt_propagation()
for the propagation and writes the MNT_NOEXEC/NOSUID/NODEV/READONLY flags --
the same work do_change_type() and do_reconfigure_mnt() do, but with no
hook. security_sb_mount() never reached that path either, so the gap isn't
new. But once this series checks the mount(2) propagation and remount
paths, mount_setattr(2) is the one path left without a check.
It's reachable. A Landlock domain denies mount(2) for the confined task, so
mount(MS_PRIVATE) and a remount clearing noexec both return -EPERM -- but
mount_setattr(propagation=MS_PRIVATE) and
mount_setattr(attr_clr=MOUNT_ATTR_NOEXEC) succeed, and the task then runs a
binary on a mount the policy marked noexec. A SELinux/AppArmor policy that
denies the mount has the same gap. With this series applied,
do_mount_setattr() still carries no security_ call, so the divergence
stands.
Adding the propagation hook and a reconfigure hook in
mount_setattr_commit() would cover mount_setattr too. Happy to send that as
a patch if you want it folded in.
Bryam
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-06-18 19:33 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-18 19:33 [PATCH v5 7/8] vfs: Replace security_sb_mount/security_move_mount with granular hooks Bryam Vargas
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox