Skip to content

RFC Avoid blocking in selinux inode callbacks on RCU walk

Will Deacon linux-fsdevel lkml oe-lkp rcu selinux 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest2 patches 8 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2selinux: Don't call avc_compute_av() from RCU path walksecurity/selinux/avc.c+6 -35 replies
2/2selinux: Propagate RCU walk status from 'security_inode_follow_link()'security/selinux/avc.c security/selinux/hooks.c security/selinux/include/avc.h+18 -113 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/2] Avoid blocking in selinux inode callbacks on RCU walk

Hi all,

While debugging a KASAN report in the selinux access vector cache hash table, I noticed that it looks like we may block in the inode_follow_link() and inode_permission() callbacks, even when called from the VFS layer as part of an RCU-protected path walk.

These two patches attempt to fix that, but since I found this by inspection and I'm not familiar with this code, I'm sending as an RFC in case I missed something that means this cannot happen.

Comments very welcome,

Will

Cc Paul Moore <[email protected]>
Cc Ondrej Mosnacek <[email protected]>
Cc Stephen Smalley <[email protected]>
Cc Jeffrey Vander Stoep <[email protected]>

--->8

Will Deacon (2):
selinux: Don't call avc_compute_av() from RCU path walk
selinux: Propagate RCU walk status from 'security_inode_follow_link()'

 security/selinux/avc.c         | 21 +++++++++++++--------
 security/selinux/hooks.c       |  5 +++--
 security/selinux/include/avc.h | 12 ++++++++----
 3 files changed, 24 insertions(+), 14 deletions(-)
Signature · 1 line
2.24.0.432.g9d3f5f5b63-goog