aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/linux/security.h43
-rw-r--r--include/linux/syscalls.h30
-rw-r--r--include/linux/xattr.h6
3 files changed, 42 insertions, 37 deletions
diff --git a/include/linux/security.h b/include/linux/security.h
index d0a28fd1747a..3ebcdd00b17d 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -53,8 +53,9 @@ extern void cap_capset_set(struct task_struct *target, kernel_cap_t *effective,
53extern int cap_bprm_set_security(struct linux_binprm *bprm); 53extern int cap_bprm_set_security(struct linux_binprm *bprm);
54extern void cap_bprm_apply_creds(struct linux_binprm *bprm, int unsafe); 54extern void cap_bprm_apply_creds(struct linux_binprm *bprm, int unsafe);
55extern int cap_bprm_secureexec(struct linux_binprm *bprm); 55extern int cap_bprm_secureexec(struct linux_binprm *bprm);
56extern int cap_inode_setxattr(struct dentry *dentry, char *name, void *value, size_t size, int flags); 56extern int cap_inode_setxattr(struct dentry *dentry, const char *name,
57extern int cap_inode_removexattr(struct dentry *dentry, char *name); 57 const void *value, size_t size, int flags);
58extern int cap_inode_removexattr(struct dentry *dentry, const char *name);
58extern int cap_inode_need_killpriv(struct dentry *dentry); 59extern int cap_inode_need_killpriv(struct dentry *dentry);
59extern int cap_inode_killpriv(struct dentry *dentry); 60extern int cap_inode_killpriv(struct dentry *dentry);
60extern int cap_task_post_setuid(uid_t old_ruid, uid_t old_euid, uid_t old_suid, int flags); 61extern int cap_task_post_setuid(uid_t old_ruid, uid_t old_euid, uid_t old_suid, int flags);
@@ -1362,13 +1363,13 @@ struct security_operations {
1362 int (*inode_setattr) (struct dentry *dentry, struct iattr *attr); 1363 int (*inode_setattr) (struct dentry *dentry, struct iattr *attr);
1363 int (*inode_getattr) (struct vfsmount *mnt, struct dentry *dentry); 1364 int (*inode_getattr) (struct vfsmount *mnt, struct dentry *dentry);
1364 void (*inode_delete) (struct inode *inode); 1365 void (*inode_delete) (struct inode *inode);
1365 int (*inode_setxattr) (struct dentry *dentry, char *name, void *value, 1366 int (*inode_setxattr) (struct dentry *dentry, const char *name,
1366 size_t size, int flags); 1367 const void *value, size_t size, int flags);
1367 void (*inode_post_setxattr) (struct dentry *dentry, char *name, void *value, 1368 void (*inode_post_setxattr) (struct dentry *dentry, const char *name,
1368 size_t size, int flags); 1369 const void *value, size_t size, int flags);
1369 int (*inode_getxattr) (struct dentry *dentry, char *name); 1370 int (*inode_getxattr) (struct dentry *dentry, const char *name);
1370 int (*inode_listxattr) (struct dentry *dentry); 1371 int (*inode_listxattr) (struct dentry *dentry);
1371 int (*inode_removexattr) (struct dentry *dentry, char *name); 1372 int (*inode_removexattr) (struct dentry *dentry, const char *name);
1372 int (*inode_need_killpriv) (struct dentry *dentry); 1373 int (*inode_need_killpriv) (struct dentry *dentry);
1373 int (*inode_killpriv) (struct dentry *dentry); 1374 int (*inode_killpriv) (struct dentry *dentry);
1374 int (*inode_getsecurity) (const struct inode *inode, const char *name, void **buffer, bool alloc); 1375 int (*inode_getsecurity) (const struct inode *inode, const char *name, void **buffer, bool alloc);
@@ -1633,13 +1634,13 @@ int security_inode_permission(struct inode *inode, int mask, struct nameidata *n
1633int security_inode_setattr(struct dentry *dentry, struct iattr *attr); 1634int security_inode_setattr(struct dentry *dentry, struct iattr *attr);
1634int security_inode_getattr(struct vfsmount *mnt, struct dentry *dentry); 1635int security_inode_getattr(struct vfsmount *mnt, struct dentry *dentry);
1635void security_inode_delete(struct inode *inode); 1636void security_inode_delete(struct inode *inode);
1636int security_inode_setxattr(struct dentry *dentry, char *name, 1637int security_inode_setxattr(struct dentry *dentry, const char *name,
1637 void *value, size_t size, int flags); 1638 const void *value, size_t size, int flags);
1638void security_inode_post_setxattr(struct dentry *dentry, char *name, 1639void security_inode_post_setxattr(struct dentry *dentry, const char *name,
1639 void *value, size_t size, int flags); 1640 const void *value, size_t size, int flags);
1640int security_inode_getxattr(struct dentry *dentry, char *name); 1641int security_inode_getxattr(struct dentry *dentry, const char *name);
1641int security_inode_listxattr(struct dentry *dentry); 1642int security_inode_listxattr(struct dentry *dentry);
1642int security_inode_removexattr(struct dentry *dentry, char *name); 1643int security_inode_removexattr(struct dentry *dentry, const char *name);
1643int security_inode_need_killpriv(struct dentry *dentry); 1644int security_inode_need_killpriv(struct dentry *dentry);
1644int security_inode_killpriv(struct dentry *dentry); 1645int security_inode_killpriv(struct dentry *dentry);
1645int security_inode_getsecurity(const struct inode *inode, const char *name, void **buffer, bool alloc); 1646int security_inode_getsecurity(const struct inode *inode, const char *name, void **buffer, bool alloc);
@@ -2041,17 +2042,18 @@ static inline int security_inode_getattr(struct vfsmount *mnt,
2041static inline void security_inode_delete(struct inode *inode) 2042static inline void security_inode_delete(struct inode *inode)
2042{ } 2043{ }
2043 2044
2044static inline int security_inode_setxattr(struct dentry *dentry, char *name, 2045static inline int security_inode_setxattr(struct dentry *dentry,
2045 void *value, size_t size, int flags) 2046 const char *name, const void *value, size_t size, int flags)
2046{ 2047{
2047 return cap_inode_setxattr(dentry, name, value, size, flags); 2048 return cap_inode_setxattr(dentry, name, value, size, flags);
2048} 2049}
2049 2050
2050static inline void security_inode_post_setxattr(struct dentry *dentry, char *name, 2051static inline void security_inode_post_setxattr(struct dentry *dentry,
2051 void *value, size_t size, int flags) 2052 const char *name, const void *value, size_t size, int flags)
2052{ } 2053{ }
2053 2054
2054static inline int security_inode_getxattr(struct dentry *dentry, char *name) 2055static inline int security_inode_getxattr(struct dentry *dentry,
2056 const char *name)
2055{ 2057{
2056 return 0; 2058 return 0;
2057} 2059}
@@ -2061,7 +2063,8 @@ static inline int security_inode_listxattr(struct dentry *dentry)
2061 return 0; 2063 return 0;
2062} 2064}
2063 2065
2064static inline int security_inode_removexattr(struct dentry *dentry, char *name) 2066static inline int security_inode_removexattr(struct dentry *dentry,
2067 const char *name)
2065{ 2068{
2066 return cap_inode_removexattr(dentry, name); 2069 return cap_inode_removexattr(dentry, name);
2067} 2070}
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index 8df6d1382ac8..0522f368f9d7 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -240,26 +240,28 @@ asmlinkage long sys_truncate64(const char __user *path, loff_t length);
240asmlinkage long sys_ftruncate64(unsigned int fd, loff_t length); 240asmlinkage long sys_ftruncate64(unsigned int fd, loff_t length);
241#endif 241#endif
242 242
243asmlinkage long sys_setxattr(char __user *path, char __user *name, 243asmlinkage long sys_setxattr(const char __user *path, const char __user *name,
244 void __user *value, size_t size, int flags); 244 const void __user *value, size_t size, int flags);
245asmlinkage long sys_lsetxattr(char __user *path, char __user *name, 245asmlinkage long sys_lsetxattr(const char __user *path, const char __user *name,
246 void __user *value, size_t size, int flags); 246 const void __user *value, size_t size, int flags);
247asmlinkage long sys_fsetxattr(int fd, char __user *name, void __user *value, 247asmlinkage long sys_fsetxattr(int fd, const char __user *name,
248 size_t size, int flags); 248 const void __user *value, size_t size, int flags);
249asmlinkage ssize_t sys_getxattr(char __user *path, char __user *name, 249asmlinkage ssize_t sys_getxattr(const char __user *path, const char __user *name,
250 void __user *value, size_t size); 250 void __user *value, size_t size);
251asmlinkage ssize_t sys_lgetxattr(char __user *path, char __user *name, 251asmlinkage ssize_t sys_lgetxattr(const char __user *path, const char __user *name,
252 void __user *value, size_t size); 252 void __user *value, size_t size);
253asmlinkage ssize_t sys_fgetxattr(int fd, char __user *name, 253asmlinkage ssize_t sys_fgetxattr(int fd, const char __user *name,
254 void __user *value, size_t size); 254 void __user *value, size_t size);
255asmlinkage ssize_t sys_listxattr(char __user *path, char __user *list, 255asmlinkage ssize_t sys_listxattr(const char __user *path, char __user *list,
256 size_t size); 256 size_t size);
257asmlinkage ssize_t sys_llistxattr(char __user *path, char __user *list, 257asmlinkage ssize_t sys_llistxattr(const char __user *path, char __user *list,
258 size_t size); 258 size_t size);
259asmlinkage ssize_t sys_flistxattr(int fd, char __user *list, size_t size); 259asmlinkage ssize_t sys_flistxattr(int fd, char __user *list, size_t size);
260asmlinkage long sys_removexattr(char __user *path, char __user *name); 260asmlinkage long sys_removexattr(const char __user *path,
261asmlinkage long sys_lremovexattr(char __user *path, char __user *name); 261 const char __user *name);
262asmlinkage long sys_fremovexattr(int fd, char __user *name); 262asmlinkage long sys_lremovexattr(const char __user *path,
263 const char __user *name);
264asmlinkage long sys_fremovexattr(int fd, const char __user *name);
263 265
264asmlinkage unsigned long sys_brk(unsigned long brk); 266asmlinkage unsigned long sys_brk(unsigned long brk);
265asmlinkage long sys_mprotect(unsigned long start, size_t len, 267asmlinkage long sys_mprotect(unsigned long start, size_t len,
diff --git a/include/linux/xattr.h b/include/linux/xattr.h
index df6b95d2218e..d131e352cfe1 100644
--- a/include/linux/xattr.h
+++ b/include/linux/xattr.h
@@ -47,10 +47,10 @@ struct xattr_handler {
47}; 47};
48 48
49ssize_t xattr_getsecurity(struct inode *, const char *, void *, size_t); 49ssize_t xattr_getsecurity(struct inode *, const char *, void *, size_t);
50ssize_t vfs_getxattr(struct dentry *, char *, void *, size_t); 50ssize_t vfs_getxattr(struct dentry *, const char *, void *, size_t);
51ssize_t vfs_listxattr(struct dentry *d, char *list, size_t size); 51ssize_t vfs_listxattr(struct dentry *d, char *list, size_t size);
52int vfs_setxattr(struct dentry *, char *, void *, size_t, int); 52int vfs_setxattr(struct dentry *, const char *, const void *, size_t, int);
53int vfs_removexattr(struct dentry *, char *); 53int vfs_removexattr(struct dentry *, const char *);
54 54
55ssize_t generic_getxattr(struct dentry *dentry, const char *name, void *buffer, size_t size); 55ssize_t generic_getxattr(struct dentry *dentry, const char *name, void *buffer, size_t size);
56ssize_t generic_listxattr(struct dentry *dentry, char *buffer, size_t buffer_size); 56ssize_t generic_listxattr(struct dentry *dentry, char *buffer, size_t buffer_size);