aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/security.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/security.h')
-rw-r--r--include/linux/security.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/include/linux/security.h b/include/linux/security.h
index dac956ed98f0..607ee209ea3b 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -385,6 +385,9 @@ struct swap_info_struct;
385 * NULL to request the size of the buffer required. @size indicates 385 * NULL to request the size of the buffer required. @size indicates
386 * the size of @buffer in bytes. Note that @name is the remainder 386 * the size of @buffer in bytes. Note that @name is the remainder
387 * of the attribute name after the security. prefix has been removed. 387 * of the attribute name after the security. prefix has been removed.
388 * @err is the return value from the preceding fs getxattr call,
389 * and can be used by the security module to determine whether it
390 * should try and canonicalize the attribute value.
388 * Return number of bytes used/required on success. 391 * Return number of bytes used/required on success.
389 * @inode_setsecurity: 392 * @inode_setsecurity:
390 * Set the security label associated with @name for @inode from the 393 * Set the security label associated with @name for @inode from the
@@ -1091,7 +1094,7 @@ struct security_operations {
1091 int (*inode_getxattr) (struct dentry *dentry, char *name); 1094 int (*inode_getxattr) (struct dentry *dentry, char *name);
1092 int (*inode_listxattr) (struct dentry *dentry); 1095 int (*inode_listxattr) (struct dentry *dentry);
1093 int (*inode_removexattr) (struct dentry *dentry, char *name); 1096 int (*inode_removexattr) (struct dentry *dentry, char *name);
1094 int (*inode_getsecurity)(struct inode *inode, const char *name, void *buffer, size_t size); 1097 int (*inode_getsecurity)(struct inode *inode, const char *name, void *buffer, size_t size, int err);
1095 int (*inode_setsecurity)(struct inode *inode, const char *name, const void *value, size_t size, int flags); 1098 int (*inode_setsecurity)(struct inode *inode, const char *name, const void *value, size_t size, int flags);
1096 int (*inode_listsecurity)(struct inode *inode, char *buffer, size_t buffer_size); 1099 int (*inode_listsecurity)(struct inode *inode, char *buffer, size_t buffer_size);
1097 1100
@@ -1580,11 +1583,11 @@ static inline int security_inode_removexattr (struct dentry *dentry, char *name)
1580 return security_ops->inode_removexattr (dentry, name); 1583 return security_ops->inode_removexattr (dentry, name);
1581} 1584}
1582 1585
1583static inline int security_inode_getsecurity(struct inode *inode, const char *name, void *buffer, size_t size) 1586static inline int security_inode_getsecurity(struct inode *inode, const char *name, void *buffer, size_t size, int err)
1584{ 1587{
1585 if (unlikely (IS_PRIVATE (inode))) 1588 if (unlikely (IS_PRIVATE (inode)))
1586 return 0; 1589 return 0;
1587 return security_ops->inode_getsecurity(inode, name, buffer, size); 1590 return security_ops->inode_getsecurity(inode, name, buffer, size, err);
1588} 1591}
1589 1592
1590static inline int security_inode_setsecurity(struct inode *inode, const char *name, const void *value, size_t size, int flags) 1593static inline int security_inode_setsecurity(struct inode *inode, const char *name, const void *value, size_t size, int flags)
@@ -2222,7 +2225,7 @@ static inline int security_inode_removexattr (struct dentry *dentry, char *name)
2222 return cap_inode_removexattr(dentry, name); 2225 return cap_inode_removexattr(dentry, name);
2223} 2226}
2224 2227
2225static inline int security_inode_getsecurity(struct inode *inode, const char *name, void *buffer, size_t size) 2228static inline int security_inode_getsecurity(struct inode *inode, const char *name, void *buffer, size_t size, int err)
2226{ 2229{
2227 return -EOPNOTSUPP; 2230 return -EOPNOTSUPP;
2228} 2231}