Skip to content

RFC fs, lsm: mediate O_PATH fd creation in file_open hook

Ryan Lee linux-fsdevel linux-security-module lkml selinux 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest6 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6fs: invoke LSM file_open hook in do_dentry_open for O_PATH fds as wellfs/open.c+6 -13 replies
2/6apparmor: explicitly skip mediation of O_PATH file descriptorssecurity/apparmor/lsm.c+10 -00 replies
3/6landlock: explicitly skip mediation of O_PATH file descriptorssecurity/landlock/fs.c+8 -00 replies
4/6selinux: explicitly skip mediation of O_PATH file descriptorssecurity/selinux/hooks.c+5 -00 replies
5/6smack: explicitly skip mediation of O_PATH file descriptorssecurity/smack/smack_lsm.c+4 -01 reply
6/6tomoyo: explicitly skip mediation of O_PATH file descriptorssecurity/tomoyo/file.c+4 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC PATCH 0/6] fs, lsm: mediate O_PATH fd creation in file_open hook

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(-)
Signature · 1 line
2.43.0