Commit 8f0cfa52 authored by David Howells's avatar David Howells Committed by Linus Torvalds

xattr: add missing consts to function arguments

Add missing consts to xattr function arguments.
Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
Cc: Andreas Gruenbacher <agruen@suse.de>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 7ec02ef1
...@@ -67,7 +67,7 @@ xattr_permission(struct inode *inode, const char *name, int mask) ...@@ -67,7 +67,7 @@ xattr_permission(struct inode *inode, const char *name, int mask)
} }
int int
vfs_setxattr(struct dentry *dentry, char *name, void *value, vfs_setxattr(struct dentry *dentry, const char *name, const void *value,
size_t size, int flags) size_t size, int flags)
{ {
struct inode *inode = dentry->d_inode; struct inode *inode = dentry->d_inode;
...@@ -131,7 +131,7 @@ xattr_getsecurity(struct inode *inode, const char *name, void *value, ...@@ -131,7 +131,7 @@ xattr_getsecurity(struct inode *inode, const char *name, void *value,
EXPORT_SYMBOL_GPL(xattr_getsecurity); EXPORT_SYMBOL_GPL(xattr_getsecurity);
ssize_t ssize_t
vfs_getxattr(struct dentry *dentry, char *name, void *value, size_t size) vfs_getxattr(struct dentry *dentry, const char *name, void *value, size_t size)
{ {
struct inode *inode = dentry->d_inode; struct inode *inode = dentry->d_inode;
int error; int error;
...@@ -187,7 +187,7 @@ vfs_listxattr(struct dentry *d, char *list, size_t size) ...@@ -187,7 +187,7 @@ vfs_listxattr(struct dentry *d, char *list, size_t size)
EXPORT_SYMBOL_GPL(vfs_listxattr); EXPORT_SYMBOL_GPL(vfs_listxattr);
int int
vfs_removexattr(struct dentry *dentry, char *name) vfs_removexattr(struct dentry *dentry, const char *name)
{ {
struct inode *inode = dentry->d_inode; struct inode *inode = dentry->d_inode;
int error; int error;
...@@ -218,7 +218,7 @@ EXPORT_SYMBOL_GPL(vfs_removexattr); ...@@ -218,7 +218,7 @@ EXPORT_SYMBOL_GPL(vfs_removexattr);
* Extended attribute SET operations * Extended attribute SET operations
*/ */
static long static long
setxattr(struct dentry *d, char __user *name, void __user *value, setxattr(struct dentry *d, const char __user *name, const void __user *value,
size_t size, int flags) size_t size, int flags)
{ {
int error; int error;
...@@ -252,8 +252,8 @@ setxattr(struct dentry *d, char __user *name, void __user *value, ...@@ -252,8 +252,8 @@ setxattr(struct dentry *d, char __user *name, void __user *value,
} }
asmlinkage long asmlinkage long
sys_setxattr(char __user *path, char __user *name, void __user *value, sys_setxattr(const char __user *path, const char __user *name,
size_t size, int flags) const void __user *value, size_t size, int flags)
{ {
struct nameidata nd; struct nameidata nd;
int error; int error;
...@@ -271,8 +271,8 @@ sys_setxattr(char __user *path, char __user *name, void __user *value, ...@@ -271,8 +271,8 @@ sys_setxattr(char __user *path, char __user *name, void __user *value,
} }
asmlinkage long asmlinkage long
sys_lsetxattr(char __user *path, char __user *name, void __user *value, sys_lsetxattr(const char __user *path, const char __user *name,
size_t size, int flags) const void __user *value, size_t size, int flags)
{ {
struct nameidata nd; struct nameidata nd;
int error; int error;
...@@ -290,7 +290,7 @@ sys_lsetxattr(char __user *path, char __user *name, void __user *value, ...@@ -290,7 +290,7 @@ sys_lsetxattr(char __user *path, char __user *name, void __user *value,
} }
asmlinkage long asmlinkage long
sys_fsetxattr(int fd, char __user *name, void __user *value, sys_fsetxattr(int fd, const char __user *name, const void __user *value,
size_t size, int flags) size_t size, int flags)
{ {
struct file *f; struct file *f;
...@@ -315,7 +315,8 @@ sys_fsetxattr(int fd, char __user *name, void __user *value, ...@@ -315,7 +315,8 @@ sys_fsetxattr(int fd, char __user *name, void __user *value,
* Extended attribute GET operations * Extended attribute GET operations
*/ */
static ssize_t static ssize_t
getxattr(struct dentry *d, char __user *name, void __user *value, size_t size) getxattr(struct dentry *d, const char __user *name, void __user *value,
size_t size)
{ {
ssize_t error; ssize_t error;
void *kvalue = NULL; void *kvalue = NULL;
...@@ -349,8 +350,8 @@ getxattr(struct dentry *d, char __user *name, void __user *value, size_t size) ...@@ -349,8 +350,8 @@ getxattr(struct dentry *d, char __user *name, void __user *value, size_t size)
} }
asmlinkage ssize_t asmlinkage ssize_t
sys_getxattr(char __user *path, char __user *name, void __user *value, sys_getxattr(const char __user *path, const char __user *name,
size_t size) void __user *value, size_t size)
{ {
struct nameidata nd; struct nameidata nd;
ssize_t error; ssize_t error;
...@@ -364,7 +365,7 @@ sys_getxattr(char __user *path, char __user *name, void __user *value, ...@@ -364,7 +365,7 @@ sys_getxattr(char __user *path, char __user *name, void __user *value,
} }
asmlinkage ssize_t asmlinkage ssize_t
sys_lgetxattr(char __user *path, char __user *name, void __user *value, sys_lgetxattr(const char __user *path, const char __user *name, void __user *value,
size_t size) size_t size)
{ {
struct nameidata nd; struct nameidata nd;
...@@ -379,7 +380,7 @@ sys_lgetxattr(char __user *path, char __user *name, void __user *value, ...@@ -379,7 +380,7 @@ sys_lgetxattr(char __user *path, char __user *name, void __user *value,
} }
asmlinkage ssize_t asmlinkage ssize_t
sys_fgetxattr(int fd, char __user *name, void __user *value, size_t size) sys_fgetxattr(int fd, const char __user *name, void __user *value, size_t size)
{ {
struct file *f; struct file *f;
ssize_t error = -EBADF; ssize_t error = -EBADF;
...@@ -424,7 +425,7 @@ listxattr(struct dentry *d, char __user *list, size_t size) ...@@ -424,7 +425,7 @@ listxattr(struct dentry *d, char __user *list, size_t size)
} }
asmlinkage ssize_t asmlinkage ssize_t
sys_listxattr(char __user *path, char __user *list, size_t size) sys_listxattr(const char __user *path, char __user *list, size_t size)
{ {
struct nameidata nd; struct nameidata nd;
ssize_t error; ssize_t error;
...@@ -438,7 +439,7 @@ sys_listxattr(char __user *path, char __user *list, size_t size) ...@@ -438,7 +439,7 @@ sys_listxattr(char __user *path, char __user *list, size_t size)
} }
asmlinkage ssize_t asmlinkage ssize_t
sys_llistxattr(char __user *path, char __user *list, size_t size) sys_llistxattr(const char __user *path, char __user *list, size_t size)
{ {
struct nameidata nd; struct nameidata nd;
ssize_t error; ssize_t error;
...@@ -470,7 +471,7 @@ sys_flistxattr(int fd, char __user *list, size_t size) ...@@ -470,7 +471,7 @@ sys_flistxattr(int fd, char __user *list, size_t size)
* Extended attribute REMOVE operations * Extended attribute REMOVE operations
*/ */
static long static long
removexattr(struct dentry *d, char __user *name) removexattr(struct dentry *d, const char __user *name)
{ {
int error; int error;
char kname[XATTR_NAME_MAX + 1]; char kname[XATTR_NAME_MAX + 1];
...@@ -485,7 +486,7 @@ removexattr(struct dentry *d, char __user *name) ...@@ -485,7 +486,7 @@ removexattr(struct dentry *d, char __user *name)
} }
asmlinkage long asmlinkage long
sys_removexattr(char __user *path, char __user *name) sys_removexattr(const char __user *path, const char __user *name)
{ {
struct nameidata nd; struct nameidata nd;
int error; int error;
...@@ -503,7 +504,7 @@ sys_removexattr(char __user *path, char __user *name) ...@@ -503,7 +504,7 @@ sys_removexattr(char __user *path, char __user *name)
} }
asmlinkage long asmlinkage long
sys_lremovexattr(char __user *path, char __user *name) sys_lremovexattr(const char __user *path, const char __user *name)
{ {
struct nameidata nd; struct nameidata nd;
int error; int error;
...@@ -521,7 +522,7 @@ sys_lremovexattr(char __user *path, char __user *name) ...@@ -521,7 +522,7 @@ sys_lremovexattr(char __user *path, char __user *name)
} }
asmlinkage long asmlinkage long
sys_fremovexattr(int fd, char __user *name) sys_fremovexattr(int fd, const char __user *name)
{ {
struct file *f; struct file *f;
struct dentry *dentry; struct dentry *dentry;
......
...@@ -53,8 +53,9 @@ extern void cap_capset_set(struct task_struct *target, kernel_cap_t *effective, ...@@ -53,8 +53,9 @@ extern void cap_capset_set(struct task_struct *target, kernel_cap_t *effective,
extern int cap_bprm_set_security(struct linux_binprm *bprm); extern int cap_bprm_set_security(struct linux_binprm *bprm);
extern void cap_bprm_apply_creds(struct linux_binprm *bprm, int unsafe); extern void cap_bprm_apply_creds(struct linux_binprm *bprm, int unsafe);
extern int cap_bprm_secureexec(struct linux_binprm *bprm); extern int cap_bprm_secureexec(struct linux_binprm *bprm);
extern int cap_inode_setxattr(struct dentry *dentry, char *name, void *value, size_t size, int flags); extern int cap_inode_setxattr(struct dentry *dentry, const char *name,
extern int cap_inode_removexattr(struct dentry *dentry, char *name); const void *value, size_t size, int flags);
extern int cap_inode_removexattr(struct dentry *dentry, const char *name);
extern int cap_inode_need_killpriv(struct dentry *dentry); extern int cap_inode_need_killpriv(struct dentry *dentry);
extern int cap_inode_killpriv(struct dentry *dentry); extern int cap_inode_killpriv(struct dentry *dentry);
extern int cap_task_post_setuid(uid_t old_ruid, uid_t old_euid, uid_t old_suid, int flags); extern 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,13 +1363,13 @@ struct security_operations {
int (*inode_setattr) (struct dentry *dentry, struct iattr *attr); int (*inode_setattr) (struct dentry *dentry, struct iattr *attr);
int (*inode_getattr) (struct vfsmount *mnt, struct dentry *dentry); int (*inode_getattr) (struct vfsmount *mnt, struct dentry *dentry);
void (*inode_delete) (struct inode *inode); void (*inode_delete) (struct inode *inode);
int (*inode_setxattr) (struct dentry *dentry, char *name, void *value, int (*inode_setxattr) (struct dentry *dentry, const char *name,
size_t size, int flags); const void *value, size_t size, int flags);
void (*inode_post_setxattr) (struct dentry *dentry, char *name, void *value, void (*inode_post_setxattr) (struct dentry *dentry, const char *name,
size_t size, int flags); const void *value, size_t size, int flags);
int (*inode_getxattr) (struct dentry *dentry, char *name); int (*inode_getxattr) (struct dentry *dentry, const char *name);
int (*inode_listxattr) (struct dentry *dentry); int (*inode_listxattr) (struct dentry *dentry);
int (*inode_removexattr) (struct dentry *dentry, char *name); int (*inode_removexattr) (struct dentry *dentry, const char *name);
int (*inode_need_killpriv) (struct dentry *dentry); int (*inode_need_killpriv) (struct dentry *dentry);
int (*inode_killpriv) (struct dentry *dentry); int (*inode_killpriv) (struct dentry *dentry);
int (*inode_getsecurity) (const struct inode *inode, const char *name, void **buffer, bool alloc); 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 ...@@ -1633,13 +1634,13 @@ int security_inode_permission(struct inode *inode, int mask, struct nameidata *n
int security_inode_setattr(struct dentry *dentry, struct iattr *attr); int security_inode_setattr(struct dentry *dentry, struct iattr *attr);
int security_inode_getattr(struct vfsmount *mnt, struct dentry *dentry); int security_inode_getattr(struct vfsmount *mnt, struct dentry *dentry);
void security_inode_delete(struct inode *inode); void security_inode_delete(struct inode *inode);
int security_inode_setxattr(struct dentry *dentry, char *name, int security_inode_setxattr(struct dentry *dentry, const char *name,
void *value, size_t size, int flags); const void *value, size_t size, int flags);
void security_inode_post_setxattr(struct dentry *dentry, char *name, void security_inode_post_setxattr(struct dentry *dentry, const char *name,
void *value, size_t size, int flags); const void *value, size_t size, int flags);
int security_inode_getxattr(struct dentry *dentry, char *name); int security_inode_getxattr(struct dentry *dentry, const char *name);
int security_inode_listxattr(struct dentry *dentry); int security_inode_listxattr(struct dentry *dentry);
int security_inode_removexattr(struct dentry *dentry, char *name); int security_inode_removexattr(struct dentry *dentry, const char *name);
int security_inode_need_killpriv(struct dentry *dentry); int security_inode_need_killpriv(struct dentry *dentry);
int security_inode_killpriv(struct dentry *dentry); int security_inode_killpriv(struct dentry *dentry);
int security_inode_getsecurity(const struct inode *inode, const char *name, void **buffer, bool alloc); int 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, ...@@ -2041,17 +2042,18 @@ static inline int security_inode_getattr(struct vfsmount *mnt,
static inline void security_inode_delete(struct inode *inode) static inline void security_inode_delete(struct inode *inode)
{ } { }
static inline int security_inode_setxattr(struct dentry *dentry, char *name, static inline int security_inode_setxattr(struct dentry *dentry,
void *value, size_t size, int flags) const char *name, const void *value, size_t size, int flags)
{ {
return cap_inode_setxattr(dentry, name, value, size, flags); return cap_inode_setxattr(dentry, name, value, size, flags);
} }
static inline void security_inode_post_setxattr(struct dentry *dentry, char *name, static inline void security_inode_post_setxattr(struct dentry *dentry,
void *value, size_t size, int flags) const char *name, const void *value, size_t size, int flags)
{ } { }
static inline int security_inode_getxattr(struct dentry *dentry, char *name) static inline int security_inode_getxattr(struct dentry *dentry,
const char *name)
{ {
return 0; return 0;
} }
...@@ -2061,7 +2063,8 @@ static inline int security_inode_listxattr(struct dentry *dentry) ...@@ -2061,7 +2063,8 @@ static inline int security_inode_listxattr(struct dentry *dentry)
return 0; return 0;
} }
static inline int security_inode_removexattr(struct dentry *dentry, char *name) static inline int security_inode_removexattr(struct dentry *dentry,
const char *name)
{ {
return cap_inode_removexattr(dentry, name); return cap_inode_removexattr(dentry, name);
} }
......
...@@ -240,26 +240,28 @@ asmlinkage long sys_truncate64(const char __user *path, loff_t length); ...@@ -240,26 +240,28 @@ asmlinkage long sys_truncate64(const char __user *path, loff_t length);
asmlinkage long sys_ftruncate64(unsigned int fd, loff_t length); asmlinkage long sys_ftruncate64(unsigned int fd, loff_t length);
#endif #endif
asmlinkage long sys_setxattr(char __user *path, char __user *name, asmlinkage long sys_setxattr(const char __user *path, const char __user *name,
void __user *value, size_t size, int flags); const void __user *value, size_t size, int flags);
asmlinkage long sys_lsetxattr(char __user *path, char __user *name, asmlinkage long sys_lsetxattr(const char __user *path, const char __user *name,
void __user *value, size_t size, int flags); const void __user *value, size_t size, int flags);
asmlinkage long sys_fsetxattr(int fd, char __user *name, void __user *value, asmlinkage long sys_fsetxattr(int fd, const char __user *name,
size_t size, int flags); const void __user *value, size_t size, int flags);
asmlinkage ssize_t sys_getxattr(char __user *path, char __user *name, asmlinkage ssize_t sys_getxattr(const char __user *path, const char __user *name,
void __user *value, size_t size); void __user *value, size_t size);
asmlinkage ssize_t sys_lgetxattr(char __user *path, char __user *name, asmlinkage ssize_t sys_lgetxattr(const char __user *path, const char __user *name,
void __user *value, size_t size); void __user *value, size_t size);
asmlinkage ssize_t sys_fgetxattr(int fd, char __user *name, asmlinkage ssize_t sys_fgetxattr(int fd, const char __user *name,
void __user *value, size_t size); void __user *value, size_t size);
asmlinkage ssize_t sys_listxattr(char __user *path, char __user *list, asmlinkage ssize_t sys_listxattr(const char __user *path, char __user *list,
size_t size); size_t size);
asmlinkage ssize_t sys_llistxattr(char __user *path, char __user *list, asmlinkage ssize_t sys_llistxattr(const char __user *path, char __user *list,
size_t size); size_t size);
asmlinkage ssize_t sys_flistxattr(int fd, char __user *list, size_t size); asmlinkage ssize_t sys_flistxattr(int fd, char __user *list, size_t size);
asmlinkage long sys_removexattr(char __user *path, char __user *name); asmlinkage long sys_removexattr(const char __user *path,
asmlinkage long sys_lremovexattr(char __user *path, char __user *name); const char __user *name);
asmlinkage long sys_fremovexattr(int fd, char __user *name); asmlinkage long sys_lremovexattr(const char __user *path,
const char __user *name);
asmlinkage long sys_fremovexattr(int fd, const char __user *name);
asmlinkage unsigned long sys_brk(unsigned long brk); asmlinkage unsigned long sys_brk(unsigned long brk);
asmlinkage long sys_mprotect(unsigned long start, size_t len, asmlinkage long sys_mprotect(unsigned long start, size_t len,
......
...@@ -47,10 +47,10 @@ struct xattr_handler { ...@@ -47,10 +47,10 @@ struct xattr_handler {
}; };
ssize_t xattr_getsecurity(struct inode *, const char *, void *, size_t); ssize_t xattr_getsecurity(struct inode *, const char *, void *, size_t);
ssize_t vfs_getxattr(struct dentry *, char *, void *, size_t); ssize_t vfs_getxattr(struct dentry *, const char *, void *, size_t);
ssize_t vfs_listxattr(struct dentry *d, char *list, size_t size); ssize_t vfs_listxattr(struct dentry *d, char *list, size_t size);
int vfs_setxattr(struct dentry *, char *, void *, size_t, int); int vfs_setxattr(struct dentry *, const char *, const void *, size_t, int);
int vfs_removexattr(struct dentry *, char *); int vfs_removexattr(struct dentry *, const char *);
ssize_t generic_getxattr(struct dentry *dentry, const char *name, void *buffer, size_t size); ssize_t generic_getxattr(struct dentry *dentry, const char *name, void *buffer, size_t size);
ssize_t generic_listxattr(struct dentry *dentry, char *buffer, size_t buffer_size); ssize_t generic_listxattr(struct dentry *dentry, char *buffer, size_t buffer_size);
......
...@@ -383,8 +383,8 @@ int cap_bprm_secureexec (struct linux_binprm *bprm) ...@@ -383,8 +383,8 @@ int cap_bprm_secureexec (struct linux_binprm *bprm)
current->egid != current->gid); current->egid != current->gid);
} }
int cap_inode_setxattr(struct dentry *dentry, char *name, void *value, int cap_inode_setxattr(struct dentry *dentry, const char *name,
size_t size, int flags) const void *value, size_t size, int flags)
{ {
if (!strcmp(name, XATTR_NAME_CAPS)) { if (!strcmp(name, XATTR_NAME_CAPS)) {
if (!capable(CAP_SETFCAP)) if (!capable(CAP_SETFCAP))
...@@ -397,7 +397,7 @@ int cap_inode_setxattr(struct dentry *dentry, char *name, void *value, ...@@ -397,7 +397,7 @@ int cap_inode_setxattr(struct dentry *dentry, char *name, void *value,
return 0; return 0;
} }
int cap_inode_removexattr(struct dentry *dentry, char *name) int cap_inode_removexattr(struct dentry *dentry, const char *name)
{ {
if (!strcmp(name, XATTR_NAME_CAPS)) { if (!strcmp(name, XATTR_NAME_CAPS)) {
if (!capable(CAP_SETFCAP)) if (!capable(CAP_SETFCAP))
......
...@@ -365,8 +365,8 @@ static void dummy_inode_delete (struct inode *ino) ...@@ -365,8 +365,8 @@ static void dummy_inode_delete (struct inode *ino)
return; return;
} }
static int dummy_inode_setxattr (struct dentry *dentry, char *name, void *value, static int dummy_inode_setxattr (struct dentry *dentry, const char *name,
size_t size, int flags) const void *value, size_t size, int flags)
{ {
if (!strncmp(name, XATTR_SECURITY_PREFIX, if (!strncmp(name, XATTR_SECURITY_PREFIX,
sizeof(XATTR_SECURITY_PREFIX) - 1) && sizeof(XATTR_SECURITY_PREFIX) - 1) &&
...@@ -375,12 +375,13 @@ static int dummy_inode_setxattr (struct dentry *dentry, char *name, void *value, ...@@ -375,12 +375,13 @@ static int dummy_inode_setxattr (struct dentry *dentry, char *name, void *value,
return 0; return 0;
} }
static void dummy_inode_post_setxattr (struct dentry *dentry, char *name, void *value, static void dummy_inode_post_setxattr (struct dentry *dentry, const char *name,
size_t size, int flags) const void *value, size_t size,
int flags)
{ {
} }
static int dummy_inode_getxattr (struct dentry *dentry, char *name) static int dummy_inode_getxattr (struct dentry *dentry, const char *name)
{ {
return 0; return 0;
} }
...@@ -390,7 +391,7 @@ static int dummy_inode_listxattr (struct dentry *dentry) ...@@ -390,7 +391,7 @@ static int dummy_inode_listxattr (struct dentry *dentry)
return 0; return 0;
} }
static int dummy_inode_removexattr (struct dentry *dentry, char *name) static int dummy_inode_removexattr (struct dentry *dentry, const char *name)
{ {
if (!strncmp(name, XATTR_SECURITY_PREFIX, if (!strncmp(name, XATTR_SECURITY_PREFIX,
sizeof(XATTR_SECURITY_PREFIX) - 1) && sizeof(XATTR_SECURITY_PREFIX) - 1) &&
......
...@@ -491,23 +491,23 @@ void security_inode_delete(struct inode *inode) ...@@ -491,23 +491,23 @@ void security_inode_delete(struct inode *inode)
security_ops->inode_delete(inode); security_ops->inode_delete(inode);
} }
int security_inode_setxattr(struct dentry *dentry, char *name, int security_inode_setxattr(struct dentry *dentry, const char *name,
void *value, size_t size, int flags) const void *value, size_t size, int flags)
{ {
if (unlikely(IS_PRIVATE(dentry->d_inode))) if (unlikely(IS_PRIVATE(dentry->d_inode)))
return 0; return 0;
return security_ops->inode_setxattr(dentry, name, value, size, flags); return security_ops->inode_setxattr(dentry, name, value, size, flags);
} }
void security_inode_post_setxattr(struct dentry *dentry, char *name, void security_inode_post_setxattr(struct dentry *dentry, const char *name,
void *value, size_t size, int flags) const void *value, size_t size, int flags)
{ {
if (unlikely(IS_PRIVATE(dentry->d_inode))) if (unlikely(IS_PRIVATE(dentry->d_inode)))
return; return;
security_ops->inode_post_setxattr(dentry, name, value, size, flags); security_ops->inode_post_setxattr(dentry, name, value, size, flags);
} }
int security_inode_getxattr(struct dentry *dentry, char *name) int security_inode_getxattr(struct dentry *dentry, const char *name)
{ {
if (unlikely(IS_PRIVATE(dentry->d_inode))) if (unlikely(IS_PRIVATE(dentry->d_inode)))
return 0; return 0;
...@@ -521,7 +521,7 @@ int security_inode_listxattr(struct dentry *dentry) ...@@ -521,7 +521,7 @@ int security_inode_listxattr(struct dentry *dentry)
return security_ops->inode_listxattr(dentry); return security_ops->inode_listxattr(dentry);
} }
int security_inode_removexattr(struct dentry *dentry, char *name) int security_inode_removexattr(struct dentry *dentry, const char *name)
{ {
if (unlikely(IS_PRIVATE(dentry->d_inode))) if (unlikely(IS_PRIVATE(dentry->d_inode)))
return 0; return 0;
......
...@@ -2619,7 +2619,7 @@ static int selinux_inode_getattr(struct vfsmount *mnt, struct dentry *dentry) ...@@ -2619,7 +2619,7 @@ static int selinux_inode_getattr(struct vfsmount *mnt, struct dentry *dentry)
return dentry_has_perm(current, mnt, dentry, FILE__GETATTR); return dentry_has_perm(current, mnt, dentry, FILE__GETATTR);
} }
static int selinux_inode_setotherxattr(struct dentry *dentry, char *name) static int selinux_inode_setotherxattr(struct dentry *dentry, const char *name)
{ {
if (!strncmp(name, XATTR_SECURITY_PREFIX, if (!strncmp(name, XATTR_SECURITY_PREFIX,
sizeof XATTR_SECURITY_PREFIX - 1)) { sizeof XATTR_SECURITY_PREFIX - 1)) {
...@@ -2638,7 +2638,8 @@ static int selinux_inode_setotherxattr(struct dentry *dentry, char *name) ...@@ -2638,7 +2638,8 @@ static int selinux_inode_setotherxattr(struct dentry *dentry, char *name)
return dentry_has_perm(current, NULL, dentry, FILE__SETATTR); return dentry_has_perm(current, NULL, dentry, FILE__SETATTR);
} }
static int selinux_inode_setxattr(struct dentry *dentry, char *name, void *value, size_t size, int flags) static int selinux_inode_setxattr(struct dentry *dentry, const char *name,
const void *value, size_t size, int flags)
{ {
struct task_security_struct *tsec = current->security; struct task_security_struct *tsec = current->security;
struct inode *inode = dentry->d_inode; struct inode *inode = dentry->d_inode;
...@@ -2687,8 +2688,9 @@ static int selinux_inode_setxattr(struct dentry *dentry, char *name, void *value ...@@ -2687,8 +2688,9 @@ static int selinux_inode_setxattr(struct dentry *dentry, char *name, void *value
&ad); &ad);
} }
static void selinux_inode_post_setxattr(struct dentry *dentry, char *name, static void selinux_inode_post_setxattr(struct dentry *dentry, const char *name,
void *value, size_t size, int flags) const void *value, size_t size,
int flags)
{ {
struct inode *inode = dentry->d_inode; struct inode *inode = dentry->d_inode;
struct inode_security_struct *isec = inode->i_security; struct inode_security_struct *isec = inode->i_security;
...@@ -2711,7 +2713,7 @@ static void selinux_inode_post_setxattr(struct dentry *dentry, char *name, ...@@ -2711,7 +2713,7 @@ static void selinux_inode_post_setxattr(struct dentry *dentry, char *name,
return; return;
} }
static int selinux_inode_getxattr(struct dentry *dentry, char *name) static int selinux_inode_getxattr(struct dentry *dentry, const char *name)
{ {
return dentry_has_perm(current, NULL, dentry, FILE__GETATTR); return dentry_has_perm(current, NULL, dentry, FILE__GETATTR);
} }
...@@ -2721,7 +2723,7 @@ static int selinux_inode_listxattr(struct dentry *dentry) ...@@ -2721,7 +2723,7 @@ static int selinux_inode_listxattr(struct dentry *dentry)
return dentry_has_perm(current, NULL, dentry, FILE__GETATTR); return dentry_has_perm(current, NULL, dentry, FILE__GETATTR);
} }
static int selinux_inode_removexattr(struct dentry *dentry, char *name) static int selinux_inode_removexattr(struct dentry *dentry, const char *name)
{ {
if (strcmp(name, XATTR_NAME_SELINUX)) if (strcmp(name, XATTR_NAME_SELINUX))
return selinux_inode_setotherxattr(dentry, name); return selinux_inode_setotherxattr(dentry, name);
......
...@@ -93,7 +93,7 @@ int security_change_sid(u32 ssid, u32 tsid, ...@@ -93,7 +93,7 @@ int security_change_sid(u32 ssid, u32 tsid,
int security_sid_to_context(u32 sid, char **scontext, int security_sid_to_context(u32 sid, char **scontext,
u32 *scontext_len); u32 *scontext_len);
int security_context_to_sid(char *scontext, u32 scontext_len, int security_context_to_sid(const char *scontext, u32 scontext_len,
u32 *out_sid); u32 *out_sid);
int security_context_to_sid_default(char *scontext, u32 scontext_len, int security_context_to_sid_default(char *scontext, u32 scontext_len,
......
...@@ -708,7 +708,7 @@ int security_sid_to_context(u32 sid, char **scontext, u32 *scontext_len) ...@@ -708,7 +708,7 @@ int security_sid_to_context(u32 sid, char **scontext, u32 *scontext_len)
} }
static int security_context_to_sid_core(char *scontext, u32 scontext_len, static int security_context_to_sid_core(const char *scontext, u32 scontext_len,
u32 *sid, u32 def_sid, gfp_t gfp_flags) u32 *sid, u32 def_sid, gfp_t gfp_flags)
{ {
char *scontext2; char *scontext2;
...@@ -835,7 +835,7 @@ static int security_context_to_sid_core(char *scontext, u32 scontext_len, ...@@ -835,7 +835,7 @@ static int security_context_to_sid_core(char *scontext, u32 scontext_len,
* Returns -%EINVAL if the context is invalid, -%ENOMEM if insufficient * Returns -%EINVAL if the context is invalid, -%ENOMEM if insufficient
* memory is available, or 0 on success. * memory is available, or 0 on success.
*/ */
int security_context_to_sid(char *scontext, u32 scontext_len, u32 *sid) int security_context_to_sid(const char *scontext, u32 scontext_len, u32 *sid)
{ {
return security_context_to_sid_core(scontext, scontext_len, return security_context_to_sid_core(scontext, scontext_len,
sid, SECSID_NULL, GFP_KERNEL); sid, SECSID_NULL, GFP_KERNEL);
......
...@@ -574,8 +574,8 @@ static int smack_inode_getattr(struct vfsmount *mnt, struct dentry *dentry) ...@@ -574,8 +574,8 @@ static int smack_inode_getattr(struct vfsmount *mnt, struct dentry *dentry)
* *
* Returns 0 if access is permitted, an error code otherwise * Returns 0 if access is permitted, an error code otherwise
*/ */
static int smack_inode_setxattr(struct dentry *dentry, char *name, static int smack_inode_setxattr(struct dentry *dentry, const char *name,
void *value, size_t size, int flags) const void *value, size_t size, int flags)
{ {
int rc = 0; int rc = 0;
...@@ -604,8 +604,8 @@ static int smack_inode_setxattr(struct dentry *dentry, char *name, ...@@ -604,8 +604,8 @@ static int smack_inode_setxattr(struct dentry *dentry, char *name,
* Set the pointer in the inode blob to the entry found * Set the pointer in the inode blob to the entry found
* in the master label list. * in the master label list.
*/ */
static void smack_inode_post_setxattr(struct dentry *dentry, char *name, static void smack_inode_post_setxattr(struct dentry *dentry, const char *name,
void *value, size_t size, int flags) const void *value, size_t size, int flags)
{ {
struct inode_smack *isp; struct inode_smack *isp;
char *nsp; char *nsp;
...@@ -641,7 +641,7 @@ static void smack_inode_post_setxattr(struct dentry *dentry, char *name, ...@@ -641,7 +641,7 @@ static void smack_inode_post_setxattr(struct dentry *dentry, char *name,
* *
* Returns 0 if access is permitted, an error code otherwise * Returns 0 if access is permitted, an error code otherwise
*/ */
static int smack_inode_getxattr(struct dentry *dentry, char *name) static int smack_inode_getxattr(struct dentry *dentry, const char *name)
{ {
return smk_curacc(smk_of_inode(dentry->d_inode), MAY_READ); return smk_curacc(smk_of_inode(dentry->d_inode), MAY_READ);
} }
...@@ -655,7 +655,7 @@ static int smack_inode_getxattr(struct dentry *dentry, char *name) ...@@ -655,7 +655,7 @@ static int smack_inode_getxattr(struct dentry *dentry, char *name)
* *
* Returns 0 if access is permitted, an error code otherwise * Returns 0 if access is permitted, an error code otherwise
*/ */
static int smack_inode_removexattr(struct dentry *dentry, char *name) static int smack_inode_removexattr(struct dentry *dentry, const char *name)
{ {
int rc = 0; int rc = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment