diff options
author | James Morris <james.morris@microsoft.com> | 2018-06-05 16:18:58 -0400 |
---|---|---|
committer | James Morris <james.morris@microsoft.com> | 2018-06-05 16:18:58 -0400 |
commit | 2531a0cd2dd9dc2b0da9fabb950e2db308ce78b8 (patch) | |
tree | 38657d8465750b7b091bb4cd2edb30a95a3b333e | |
parent | 890e2abe1028c39e5399101a2c277219cd637aaa (diff) | |
parent | 0f8983cf97d3327531b7843c831517cac3a1b9ed (diff) |
Merge branch 'smack-for-4.18' of https://github.com/cschaufler/next-smack into next-smack
"one simple patch that fixes a memory leak in kernfs and labeled NFS"
-rw-r--r-- | security/smack/smack_lsm.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c index dcb976f98df2..7ad226018f51 100644 --- a/security/smack/smack_lsm.c +++ b/security/smack/smack_lsm.c | |||
@@ -1545,9 +1545,9 @@ static int smack_inode_listsecurity(struct inode *inode, char *buffer, | |||
1545 | */ | 1545 | */ |
1546 | static void smack_inode_getsecid(struct inode *inode, u32 *secid) | 1546 | static void smack_inode_getsecid(struct inode *inode, u32 *secid) |
1547 | { | 1547 | { |
1548 | struct inode_smack *isp = inode->i_security; | 1548 | struct smack_known *skp = smk_of_inode(inode); |
1549 | 1549 | ||
1550 | *secid = isp->smk_inode->smk_secid; | 1550 | *secid = skp->smk_secid; |
1551 | } | 1551 | } |
1552 | 1552 | ||
1553 | /* | 1553 | /* |
@@ -4559,12 +4559,10 @@ static int smack_inode_setsecctx(struct dentry *dentry, void *ctx, u32 ctxlen) | |||
4559 | 4559 | ||
4560 | static int smack_inode_getsecctx(struct inode *inode, void **ctx, u32 *ctxlen) | 4560 | static int smack_inode_getsecctx(struct inode *inode, void **ctx, u32 *ctxlen) |
4561 | { | 4561 | { |
4562 | int len = 0; | 4562 | struct smack_known *skp = smk_of_inode(inode); |
4563 | len = smack_inode_getsecurity(inode, XATTR_SMACK_SUFFIX, ctx, true); | ||
4564 | 4563 | ||
4565 | if (len < 0) | 4564 | *ctx = skp->smk_known; |
4566 | return len; | 4565 | *ctxlen = strlen(skp->smk_known); |
4567 | *ctxlen = len; | ||
4568 | return 0; | 4566 | return 0; |
4569 | } | 4567 | } |
4570 | 4568 | ||