Skip to content

Commit fb24560

Browse files
committed
Merge tag 'lsm-pr-20240830' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/lsm
Pull lsm fix from Paul Moore: "One small patch to correct a NFS permissions problem with SELinux and Smack" * tag 'lsm-pr-20240830' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/lsm: selinux,smack: don't bypass permissions check in inode_setsecctx hook
2 parents fb1a804 + 76a0e79 commit fb24560

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

security/selinux/hooks.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6660,8 +6660,8 @@ static int selinux_inode_notifysecctx(struct inode *inode, void *ctx, u32 ctxlen
66606660
*/
66616661
static int selinux_inode_setsecctx(struct dentry *dentry, void *ctx, u32 ctxlen)
66626662
{
6663-
return __vfs_setxattr_noperm(&nop_mnt_idmap, dentry, XATTR_NAME_SELINUX,
6664-
ctx, ctxlen, 0);
6663+
return __vfs_setxattr_locked(&nop_mnt_idmap, dentry, XATTR_NAME_SELINUX,
6664+
ctx, ctxlen, 0, NULL);
66656665
}
66666666

66676667
static int selinux_inode_getsecctx(struct inode *inode, void **ctx, u32 *ctxlen)

security/smack/smack_lsm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4880,8 +4880,8 @@ static int smack_inode_notifysecctx(struct inode *inode, void *ctx, u32 ctxlen)
48804880

48814881
static int smack_inode_setsecctx(struct dentry *dentry, void *ctx, u32 ctxlen)
48824882
{
4883-
return __vfs_setxattr_noperm(&nop_mnt_idmap, dentry, XATTR_NAME_SMACK,
4884-
ctx, ctxlen, 0);
4883+
return __vfs_setxattr_locked(&nop_mnt_idmap, dentry, XATTR_NAME_SMACK,
4884+
ctx, ctxlen, 0, NULL);
48854885
}
48864886

48874887
static int smack_inode_getsecctx(struct inode *inode, void **ctx, u32 *ctxlen)

0 commit comments

Comments
 (0)