aboutsummaryrefslogtreecommitdiffstats
path: root/security
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2016-04-11 00:48:00 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2016-04-11 00:48:00 -0400
commitce23e640133484eebc20ca7b7668388213e11327 (patch)
tree0b37de221fe6790396c3ae636bc56e5aacbcaf46 /security
parentb296821a7c42fa58baa17513b2b7b30ae66f3336 (diff)
->getxattr(): pass dentry and inode as separate arguments
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'security')
-rw-r--r--security/commoncap.c6
-rw-r--r--security/integrity/evm/evm_main.c2
-rw-r--r--security/selinux/hooks.c9
-rw-r--r--security/smack/smack_lsm.c4
4 files changed, 11 insertions, 10 deletions
diff --git a/security/commoncap.c b/security/commoncap.c
index 48071ed7c445..a042077312a5 100644
--- a/security/commoncap.c
+++ b/security/commoncap.c
@@ -313,7 +313,7 @@ int cap_inode_need_killpriv(struct dentry *dentry)
313 if (!inode->i_op->getxattr) 313 if (!inode->i_op->getxattr)
314 return 0; 314 return 0;
315 315
316 error = inode->i_op->getxattr(dentry, XATTR_NAME_CAPS, NULL, 0); 316 error = inode->i_op->getxattr(dentry, inode, XATTR_NAME_CAPS, NULL, 0);
317 if (error <= 0) 317 if (error <= 0)
318 return 0; 318 return 0;
319 return 1; 319 return 1;
@@ -397,8 +397,8 @@ int get_vfs_caps_from_disk(const struct dentry *dentry, struct cpu_vfs_cap_data
397 if (!inode || !inode->i_op->getxattr) 397 if (!inode || !inode->i_op->getxattr)
398 return -ENODATA; 398 return -ENODATA;
399 399
400 size = inode->i_op->getxattr((struct dentry *)dentry, XATTR_NAME_CAPS, &caps, 400 size = inode->i_op->getxattr((struct dentry *)dentry, inode,
401 XATTR_CAPS_SZ); 401 XATTR_NAME_CAPS, &caps, XATTR_CAPS_SZ);
402 if (size == -ENODATA || size == -EOPNOTSUPP) 402 if (size == -ENODATA || size == -EOPNOTSUPP)
403 /* no data, that's ok */ 403 /* no data, that's ok */
404 return -ENODATA; 404 return -ENODATA;
diff --git a/security/integrity/evm/evm_main.c b/security/integrity/evm/evm_main.c
index 84c6d11fc096..b9e26288d30c 100644
--- a/security/integrity/evm/evm_main.c
+++ b/security/integrity/evm/evm_main.c
@@ -82,7 +82,7 @@ static int evm_find_protected_xattrs(struct dentry *dentry)
82 return -EOPNOTSUPP; 82 return -EOPNOTSUPP;
83 83
84 for (xattr = evm_config_xattrnames; *xattr != NULL; xattr++) { 84 for (xattr = evm_config_xattrnames; *xattr != NULL; xattr++) {
85 error = inode->i_op->getxattr(dentry, *xattr, NULL, 0); 85 error = inode->i_op->getxattr(dentry, inode, *xattr, NULL, 0);
86 if (error < 0) { 86 if (error < 0) {
87 if (error == -ENODATA) 87 if (error == -ENODATA)
88 continue; 88 continue;
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index 889cd59ca5a7..469f5c75bd4b 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -506,7 +506,8 @@ static int sb_finish_set_opts(struct super_block *sb)
506 rc = -EOPNOTSUPP; 506 rc = -EOPNOTSUPP;
507 goto out; 507 goto out;
508 } 508 }
509 rc = root_inode->i_op->getxattr(root, XATTR_NAME_SELINUX, NULL, 0); 509 rc = root_inode->i_op->getxattr(root, root_inode,
510 XATTR_NAME_SELINUX, NULL, 0);
510 if (rc < 0 && rc != -ENODATA) { 511 if (rc < 0 && rc != -ENODATA) {
511 if (rc == -EOPNOTSUPP) 512 if (rc == -EOPNOTSUPP)
512 printk(KERN_WARNING "SELinux: (dev %s, type " 513 printk(KERN_WARNING "SELinux: (dev %s, type "
@@ -1412,13 +1413,13 @@ static int inode_doinit_with_dentry(struct inode *inode, struct dentry *opt_dent
1412 goto out_unlock; 1413 goto out_unlock;
1413 } 1414 }
1414 context[len] = '\0'; 1415 context[len] = '\0';
1415 rc = inode->i_op->getxattr(dentry, XATTR_NAME_SELINUX, 1416 rc = inode->i_op->getxattr(dentry, inode, XATTR_NAME_SELINUX,
1416 context, len); 1417 context, len);
1417 if (rc == -ERANGE) { 1418 if (rc == -ERANGE) {
1418 kfree(context); 1419 kfree(context);
1419 1420
1420 /* Need a larger buffer. Query for the right size. */ 1421 /* Need a larger buffer. Query for the right size. */
1421 rc = inode->i_op->getxattr(dentry, XATTR_NAME_SELINUX, 1422 rc = inode->i_op->getxattr(dentry, inode, XATTR_NAME_SELINUX,
1422 NULL, 0); 1423 NULL, 0);
1423 if (rc < 0) { 1424 if (rc < 0) {
1424 dput(dentry); 1425 dput(dentry);
@@ -1432,7 +1433,7 @@ static int inode_doinit_with_dentry(struct inode *inode, struct dentry *opt_dent
1432 goto out_unlock; 1433 goto out_unlock;
1433 } 1434 }
1434 context[len] = '\0'; 1435 context[len] = '\0';
1435 rc = inode->i_op->getxattr(dentry, 1436 rc = inode->i_op->getxattr(dentry, inode,
1436 XATTR_NAME_SELINUX, 1437 XATTR_NAME_SELINUX,
1437 context, len); 1438 context, len);
1438 } 1439 }
diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c
index 50bcca26c0b7..ff2b8c3cf7a9 100644
--- a/security/smack/smack_lsm.c
+++ b/security/smack/smack_lsm.c
@@ -272,7 +272,7 @@ static struct smack_known *smk_fetch(const char *name, struct inode *ip,
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, name, buffer, SMK_LONGLABEL); 275 rc = ip->i_op->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)
@@ -3519,7 +3519,7 @@ static void smack_d_instantiate(struct dentry *opt_dentry, struct inode *inode)
3519 TRANS_TRUE, TRANS_TRUE_SIZE, 3519 TRANS_TRUE, TRANS_TRUE_SIZE,
3520 0); 3520 0);
3521 } else { 3521 } else {
3522 rc = inode->i_op->getxattr(dp, 3522 rc = inode->i_op->getxattr(dp, inode,
3523 XATTR_NAME_SMACKTRANSMUTE, trattr, 3523 XATTR_NAME_SMACKTRANSMUTE, trattr,
3524 TRANS_TRUE_SIZE); 3524 TRANS_TRUE_SIZE);
3525 if (rc >= 0 && strncmp(trattr, TRANS_TRUE, 3525 if (rc >= 0 && strncmp(trattr, TRANS_TRUE,