linux-security-module.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH 0/6] fs, lsm: mediate O_PATH fd creation in file_open hook
@ 2025-03-12 21:21 Ryan Lee
  2025-03-12 21:21 ` [RFC PATCH 1/6] fs: invoke LSM file_open hook in do_dentry_open for O_PATH fds as well Ryan Lee
                   ` (5 more replies)
  0 siblings, 6 replies; 11+ messages in thread
From: Ryan Lee @ 2025-03-12 21:21 UTC (permalink / raw)
  To: linux-fsdevel, linux-kernel, apparmor, linux-security-module,
	selinux
  Cc: Ryan Lee, Alexander Viro, Christian Brauner, Jan Kara,
	John Johansen, Paul Moore, James Morris, Serge E. Hallyn,
	Mickaël Salaün, Günther Noack, Stephen Smalley,
	Ondrej Mosnacek, Casey Schaufler, Kentaro Takeda, Tetsuo Handa

Calls to the openat(2) family of syscalls are mediated by the file_open LSM
hook, but the opening of O_PATH file descriptors completely bypasses LSM
mediation, preventing LSMs from initializing LSM file security context
blobs for such file descriptors for use in other mediation hooks.

This patchset enables mediation of O_PATH file descriptors through the
file_open hook and updates the LSMs using that hook to unconditionally
allow creation of O_PATH fds, in order to preserve the existing behavior.
However, the LSM patches are primarily meant as a starting point for
discussions on how each one wants to handle O_PATH fd creation.

Ryan Lee (6):
  fs: invoke LSM file_open hook in do_dentry_open for O_PATH fds as well
  apparmor: explicitly skip mediation of O_PATH file descriptors
  landlock: explicitly skip mediation of O_PATH file descriptors
  selinux: explicitly skip mediation of O_PATH file descriptors
  smack: explicitly skip mediation of O_PATH file descriptors
  tomoyo: explicitly skip mediation of O_PATH file descriptors

 fs/open.c                  |  7 ++++++-
 security/apparmor/lsm.c    | 10 ++++++++++
 security/landlock/fs.c     |  8 ++++++++
 security/selinux/hooks.c   |  5 +++++
 security/smack/smack_lsm.c |  4 ++++
 security/tomoyo/file.c     |  4 ++++
 6 files changed, 37 insertions(+), 1 deletion(-)

-- 
2.43.0


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2025-03-14  1:29 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-12 21:21 [RFC PATCH 0/6] fs, lsm: mediate O_PATH fd creation in file_open hook Ryan Lee
2025-03-12 21:21 ` [RFC PATCH 1/6] fs: invoke LSM file_open hook in do_dentry_open for O_PATH fds as well Ryan Lee
2025-03-12 21:37   ` Al Viro
2025-03-13  8:50     ` Christian Brauner
2025-03-14  1:28       ` Paul Moore
2025-03-12 21:21 ` [RFC PATCH 2/6] apparmor: explicitly skip mediation of O_PATH file descriptors Ryan Lee
2025-03-12 21:21 ` [RFC PATCH 3/6] landlock: " Ryan Lee
2025-03-12 21:21 ` [RFC PATCH 4/6] selinux: " Ryan Lee
2025-03-12 21:21 ` [RFC PATCH 5/6] smack: " Ryan Lee
2025-03-12 23:12   ` Casey Schaufler
2025-03-12 21:21 ` [RFC PATCH 6/6] tomoyo: " Ryan Lee

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).