diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-10-10 20:11:50 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-10-10 20:11:50 -0400 |
commit | 97d2116708ca0fd6ad8b00811ee4349b7e19e96f (patch) | |
tree | 81f73fc1a6daee60737b591cf1be73cc4f79de37 /security/smack | |
parent | 30066ce675d3af350bc5a53858991c0b518dda00 (diff) | |
parent | fd50ecaddf8372a1d96e0daeaac0f93cf04e4d42 (diff) |
Merge branch 'work.xattr' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull vfs xattr updates from Al Viro:
"xattr stuff from Andreas
This completes the switch to xattr_handler ->get()/->set() from
->getxattr/->setxattr/->removexattr"
* 'work.xattr' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
vfs: Remove {get,set,remove}xattr inode operations
xattr: Stop calling {get,set,remove}xattr inode operations
vfs: Check for the IOP_XATTR flag in listxattr
xattr: Add __vfs_{get,set,remove}xattr helpers
libfs: Use IOP_XATTR flag for empty directory handling
vfs: Use IOP_XATTR flag for bad-inode handling
vfs: Add IOP_XATTR inode operations flag
vfs: Move xattr_resolve_name to the front of fs/xattr.c
ecryptfs: Switch to generic xattr handlers
sockfs: Get rid of getxattr iop
sockfs: getxattr: Fail with -EOPNOTSUPP for invalid attribute names
kernfs: Switch to generic xattr handlers
hfs: Switch to generic xattr handlers
jffs2: Remove jffs2_{get,set,remove}xattr macros
xattr: Remove unnecessary NULL attribute name check
Diffstat (limited to 'security/smack')
-rw-r--r-- | security/smack/smack_lsm.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c index caec2256ab22..1cb060293505 100644 --- a/security/smack/smack_lsm.c +++ b/security/smack/smack_lsm.c | |||
@@ -265,14 +265,14 @@ static struct smack_known *smk_fetch(const char *name, struct inode *ip, | |||
265 | char *buffer; | 265 | char *buffer; |
266 | struct smack_known *skp = NULL; | 266 | struct smack_known *skp = NULL; |
267 | 267 | ||
268 | if (ip->i_op->getxattr == NULL) | 268 | if (!(ip->i_opflags & IOP_XATTR)) |
269 | return ERR_PTR(-EOPNOTSUPP); | 269 | return ERR_PTR(-EOPNOTSUPP); |
270 | 270 | ||
271 | buffer = kzalloc(SMK_LONGLABEL, GFP_KERNEL); | 271 | buffer = kzalloc(SMK_LONGLABEL, GFP_KERNEL); |
272 | if (buffer == NULL) | 272 | if (buffer == NULL) |
273 | return ERR_PTR(-ENOMEM); | 273 | return ERR_PTR(-ENOMEM); |
274 | 274 | ||
275 | rc = ip->i_op->getxattr(dp, ip, name, buffer, SMK_LONGLABEL); | 275 | rc = __vfs_getxattr(dp, ip, name, buffer, SMK_LONGLABEL); |
276 | if (rc < 0) | 276 | if (rc < 0) |
277 | skp = ERR_PTR(rc); | 277 | skp = ERR_PTR(rc); |
278 | else if (rc == 0) | 278 | else if (rc == 0) |
@@ -3520,8 +3520,8 @@ static void smack_d_instantiate(struct dentry *opt_dentry, struct inode *inode) | |||
3520 | * It would be curious if the label of the task | 3520 | * It would be curious if the label of the task |
3521 | * does not match that assigned. | 3521 | * does not match that assigned. |
3522 | */ | 3522 | */ |
3523 | if (inode->i_op->getxattr == NULL) | 3523 | if (!(inode->i_opflags & IOP_XATTR)) |
3524 | break; | 3524 | break; |
3525 | /* | 3525 | /* |
3526 | * Get the dentry for xattr. | 3526 | * Get the dentry for xattr. |
3527 | */ | 3527 | */ |
@@ -3545,12 +3545,12 @@ static void smack_d_instantiate(struct dentry *opt_dentry, struct inode *inode) | |||
3545 | */ | 3545 | */ |
3546 | if (isp->smk_flags & SMK_INODE_CHANGED) { | 3546 | if (isp->smk_flags & SMK_INODE_CHANGED) { |
3547 | isp->smk_flags &= ~SMK_INODE_CHANGED; | 3547 | isp->smk_flags &= ~SMK_INODE_CHANGED; |
3548 | rc = inode->i_op->setxattr(dp, inode, | 3548 | rc = __vfs_setxattr(dp, inode, |
3549 | XATTR_NAME_SMACKTRANSMUTE, | 3549 | XATTR_NAME_SMACKTRANSMUTE, |
3550 | TRANS_TRUE, TRANS_TRUE_SIZE, | 3550 | TRANS_TRUE, TRANS_TRUE_SIZE, |
3551 | 0); | 3551 | 0); |
3552 | } else { | 3552 | } else { |
3553 | rc = inode->i_op->getxattr(dp, inode, | 3553 | rc = __vfs_getxattr(dp, inode, |
3554 | XATTR_NAME_SMACKTRANSMUTE, trattr, | 3554 | XATTR_NAME_SMACKTRANSMUTE, trattr, |
3555 | TRANS_TRUE_SIZE); | 3555 | TRANS_TRUE_SIZE); |
3556 | if (rc >= 0 && strncmp(trattr, TRANS_TRUE, | 3556 | if (rc >= 0 && strncmp(trattr, TRANS_TRUE, |