Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 2cdde54b authored by Olga Kornievskaia's avatar Olga Kornievskaia Committed by Greg Kroah-Hartman
Browse files

NFSv4.2: condition READDIR's mask for security label based on LSM state



[ Upstream commit 05ad917561fca39a03338cb21fe9622f998b0f9c ]

Currently, the client will always ask for security_labels if the server
returns that it supports that feature regardless of any LSM modules
(such as Selinux) enforcing security policy. This adds performance
penalty to the READDIR operation.

Client adjusts superblock's support of the security_label based on
the server's support but also current client's configuration of the
LSM modules. Thus, prior to using the default bitmask in READDIR,
this patch checks the server's capabilities and then instructs
READDIR to remove FATTR4_WORD2_SECURITY_LABEL from the bitmask.

v5: fixing silly mistakes of the rushed v4
v4: simplifying logic
v3: changing label's initialization per Ondrej's comment
v2: dropping selinux hook and using the sb cap.

Suggested-by: default avatarOndrej Mosnacek <omosnace@redhat.com>
Suggested-by: default avatarScott Mayhew <smayhew@redhat.com>
Signed-off-by: default avatarOlga Kornievskaia <kolga@netapp.com>
Fixes: 2b0143b5 ("VFS: normal filesystems (and lustre): d_inode() annotations")
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent dd2c756e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment