From: Bryam Vargas <hexlabsecurity@proton.me>
To: Song Liu <song@kernel.org>
Cc: "Christian Brauner" <brauner@kernel.org>,
"Al Viro" <viro@zeniv.linux.org.uk>,
"Stephen Smalley" <stephen.smalley.work@gmail.com>,
"Ondrej Mosnacek" <omosnace@redhat.com>,
"Mickaël Salaün" <mic@digikod.net>,
"John Johansen" <john.johansen@canonical.com>,
"Paul Moore" <paul@paul-moore.com>,
"James Morris" <jmorris@namei.org>,
"Serge Hallyn" <serge@hallyn.com>,
linux-security-module@vger.kernel.org,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v5 7/8] vfs: Replace security_sb_mount/security_move_mount with granular hooks
Date: Thu, 18 Jun 2026 19:33:41 +0000 [thread overview]
Message-ID: <20260618193336.214276-1-hexlabsecurity@proton.me> (raw)
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
next reply other threads:[~2026-06-18 19:33 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-18 19:33 Bryam Vargas [this message]
-- strict thread matches above, loose matches on Subject: below --
2026-05-28 18:25 [PATCH v5 0/8] lsm: Replace security_sb_mount with granular mount hooks Song Liu
2026-05-28 18:26 ` [PATCH v5 7/8] vfs: Replace security_sb_mount/security_move_mount with granular hooks Song Liu
2026-06-03 15:42 ` Song Liu
2026-06-17 13:53 ` Christian Brauner
2026-06-18 10:56 ` Song Liu
2026-06-18 14:02 ` Christian Brauner
2026-06-19 6:14 ` Song Liu
2026-06-19 10:17 ` Christian Brauner
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=20260618193336.214276-1-hexlabsecurity@proton.me \
--to=hexlabsecurity@proton.me \
--cc=brauner@kernel.org \
--cc=jmorris@namei.org \
--cc=john.johansen@canonical.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=mic@digikod.net \
--cc=omosnace@redhat.com \
--cc=paul@paul-moore.com \
--cc=serge@hallyn.com \
--cc=song@kernel.org \
--cc=stephen.smalley.work@gmail.com \
--cc=viro@zeniv.linux.org.uk \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox