Linux Security Modules development
 help / color / mirror / Atom feed
* [PATCH 0/2] lsm: expose mount idmaps to inode hooks
@ 2026-08-24 13:28 Daan De Meyer via B4 Relay
  2026-08-24 13:28 ` [PATCH 1/2] " Daan De Meyer via B4 Relay
  2026-08-24 13:28 ` [PATCH 2/2] selftests/bpf: verify mount idmaps reach " Daan De Meyer via B4 Relay
  0 siblings, 2 replies; 3+ messages in thread
From: Daan De Meyer via B4 Relay @ 2026-08-24 13:28 UTC (permalink / raw)
  To: brauner, jack, paul, viro; +Cc: linux-security-module, linux-fsdevel

OverlayFS performs upper-layer operations through inode-based security
hooks. Those hooks receive the upper inode and dentry, but not the mount
idmap used by the VFS operation.

The security layer cannot distinguish an identity-mapped upper from an
idmapped one or make the same ownership decision as the VFS. The VFS
layer already passes the idmap down into all relevant inode operations
so this just brings the security hooks to parity.

So pass the mount idmap through the create, link, symlink, mkdir, mknod,
and permission hooks. Update the in-tree security implementations and
non-VFS callers accordingly.

systemd has been shipping systemd-nsresourced for quite a while now. It
relies on inode and path hooks to perform ownership checks using a bpf lsm.
To make this actually secure we need to be able to calculate the on-disk
ownership from the idmap.

---
Daan De Meyer (2):
      lsm: expose mount idmaps to inode hooks
      selftests/bpf: verify mount idmaps reach inode hooks

 fs/cachefiles/security.c                          |   4 +-
 fs/namei.c                                        |  18 +-
 include/linux/lsm_hook_defs.h                     |  23 +--
 include/linux/security.h                          |  58 +++---
 security/security.c                               |  40 ++--
 security/selinux/hooks.c                          |  19 +-
 security/smack/smack_lsm.c                        |   9 +-
 tools/testing/selftests/bpf/prog_tests/test_lsm.c | 231 ++++++++++++++++++++++
 tools/testing/selftests/bpf/progs/lsm.c           |  79 ++++++++
 9 files changed, 410 insertions(+), 71 deletions(-)
---
base-commit: 0a0d1d55dad570724bf8c7ea83409639cfb4be9b
change-id: 20260824-lsm-mount-idmaps-9d9b994fe1a1

Best regards,
--  
Daan De Meyer <daan@amutable.com>



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

end of thread, other threads:[~2026-08-24 13:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-24 13:28 [PATCH 0/2] lsm: expose mount idmaps to inode hooks Daan De Meyer via B4 Relay
2026-08-24 13:28 ` [PATCH 1/2] " Daan De Meyer via B4 Relay
2026-08-24 13:28 ` [PATCH 2/2] selftests/bpf: verify mount idmaps reach " Daan De Meyer via B4 Relay

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox