Commit 8ab184ad authored by Andries E. Brouwer's avatar Andries E. Brouwer Committed by Linus Torvalds

[PATCH] sparse fix xattr

parent c867b862
...@@ -53,7 +53,8 @@ xattr_free(void *ptr, size_t size) ...@@ -53,7 +53,8 @@ xattr_free(void *ptr, size_t size)
* Extended attribute SET operations * Extended attribute SET operations
*/ */
static long static long
setxattr(struct dentry *d, char *name, void *value, size_t size, int flags) setxattr(struct dentry *d, char __user *name, void __user *value,
size_t size, int flags)
{ {
int error; int error;
void *kvalue; void *kvalue;
...@@ -94,7 +95,8 @@ setxattr(struct dentry *d, char *name, void *value, size_t size, int flags) ...@@ -94,7 +95,8 @@ setxattr(struct dentry *d, char *name, void *value, size_t size, int flags)
} }
asmlinkage long asmlinkage long
sys_setxattr(char *path, char *name, void *value, size_t size, int flags) sys_setxattr(char __user *path, char __user *name, void __user *value,
size_t size, int flags)
{ {
struct nameidata nd; struct nameidata nd;
int error; int error;
...@@ -108,7 +110,8 @@ sys_setxattr(char *path, char *name, void *value, size_t size, int flags) ...@@ -108,7 +110,8 @@ sys_setxattr(char *path, char *name, void *value, size_t size, int flags)
} }
asmlinkage long asmlinkage long
sys_lsetxattr(char *path, char *name, void *value, size_t size, int flags) sys_lsetxattr(char __user *path, char __user *name, void __user *value,
size_t size, int flags)
{ {
struct nameidata nd; struct nameidata nd;
int error; int error;
...@@ -122,7 +125,8 @@ sys_lsetxattr(char *path, char *name, void *value, size_t size, int flags) ...@@ -122,7 +125,8 @@ sys_lsetxattr(char *path, char *name, void *value, size_t size, int flags)
} }
asmlinkage long asmlinkage long
sys_fsetxattr(int fd, char *name, void *value, size_t size, int flags) sys_fsetxattr(int fd, char __user *name, void __user *value,
size_t size, int flags)
{ {
struct file *f; struct file *f;
int error = -EBADF; int error = -EBADF;
...@@ -139,7 +143,7 @@ sys_fsetxattr(int fd, char *name, void *value, size_t size, int flags) ...@@ -139,7 +143,7 @@ sys_fsetxattr(int fd, char *name, void *value, size_t size, int flags)
* Extended attribute GET operations * Extended attribute GET operations
*/ */
static ssize_t static ssize_t
getxattr(struct dentry *d, char *name, void *value, size_t size) getxattr(struct dentry *d, char __user *name, void __user *value, size_t size)
{ {
ssize_t error; ssize_t error;
void *kvalue; void *kvalue;
...@@ -172,7 +176,8 @@ getxattr(struct dentry *d, char *name, void *value, size_t size) ...@@ -172,7 +176,8 @@ getxattr(struct dentry *d, char *name, void *value, size_t size)
} }
asmlinkage ssize_t asmlinkage ssize_t
sys_getxattr(char *path, char *name, void *value, size_t size) sys_getxattr(char __user *path, char __user *name, void __user *value,
size_t size)
{ {
struct nameidata nd; struct nameidata nd;
ssize_t error; ssize_t error;
...@@ -186,7 +191,8 @@ sys_getxattr(char *path, char *name, void *value, size_t size) ...@@ -186,7 +191,8 @@ sys_getxattr(char *path, char *name, void *value, size_t size)
} }
asmlinkage ssize_t asmlinkage ssize_t
sys_lgetxattr(char *path, char *name, void *value, size_t size) sys_lgetxattr(char __user *path, char __user *name, void __user *value,
size_t size)
{ {
struct nameidata nd; struct nameidata nd;
ssize_t error; ssize_t error;
...@@ -200,7 +206,7 @@ sys_lgetxattr(char *path, char *name, void *value, size_t size) ...@@ -200,7 +206,7 @@ sys_lgetxattr(char *path, char *name, void *value, size_t size)
} }
asmlinkage ssize_t asmlinkage ssize_t
sys_fgetxattr(int fd, char *name, void *value, size_t size) sys_fgetxattr(int fd, char __user *name, void __user *value, size_t size)
{ {
struct file *f; struct file *f;
ssize_t error = -EBADF; ssize_t error = -EBADF;
...@@ -217,7 +223,7 @@ sys_fgetxattr(int fd, char *name, void *value, size_t size) ...@@ -217,7 +223,7 @@ sys_fgetxattr(int fd, char *name, void *value, size_t size)
* Extended attribute LIST operations * Extended attribute LIST operations
*/ */
static ssize_t static ssize_t
listxattr(struct dentry *d, char *list, size_t size) listxattr(struct dentry *d, char __user *list, size_t size)
{ {
ssize_t error; ssize_t error;
char *klist; char *klist;
...@@ -243,7 +249,7 @@ listxattr(struct dentry *d, char *list, size_t size) ...@@ -243,7 +249,7 @@ listxattr(struct dentry *d, char *list, size_t size)
} }
asmlinkage ssize_t asmlinkage ssize_t
sys_listxattr(char *path, char *list, size_t size) sys_listxattr(char __user *path, char __user *list, size_t size)
{ {
struct nameidata nd; struct nameidata nd;
ssize_t error; ssize_t error;
...@@ -257,7 +263,7 @@ sys_listxattr(char *path, char *list, size_t size) ...@@ -257,7 +263,7 @@ sys_listxattr(char *path, char *list, size_t size)
} }
asmlinkage ssize_t asmlinkage ssize_t
sys_llistxattr(char *path, char *list, size_t size) sys_llistxattr(char __user *path, char __user *list, size_t size)
{ {
struct nameidata nd; struct nameidata nd;
ssize_t error; ssize_t error;
...@@ -271,7 +277,7 @@ sys_llistxattr(char *path, char *list, size_t size) ...@@ -271,7 +277,7 @@ sys_llistxattr(char *path, char *list, size_t size)
} }
asmlinkage ssize_t asmlinkage ssize_t
sys_flistxattr(int fd, char *list, size_t size) sys_flistxattr(int fd, char __user *list, size_t size)
{ {
struct file *f; struct file *f;
ssize_t error = -EBADF; ssize_t error = -EBADF;
...@@ -288,7 +294,7 @@ sys_flistxattr(int fd, char *list, size_t size) ...@@ -288,7 +294,7 @@ sys_flistxattr(int fd, char *list, size_t size)
* Extended attribute REMOVE operations * Extended attribute REMOVE operations
*/ */
static long static long
removexattr(struct dentry *d, char *name) removexattr(struct dentry *d, char __user *name)
{ {
int error; int error;
char kname[XATTR_NAME_MAX + 1]; char kname[XATTR_NAME_MAX + 1];
...@@ -313,7 +319,7 @@ removexattr(struct dentry *d, char *name) ...@@ -313,7 +319,7 @@ removexattr(struct dentry *d, char *name)
} }
asmlinkage long asmlinkage long
sys_removexattr(char *path, char *name) sys_removexattr(char __user *path, char __user *name)
{ {
struct nameidata nd; struct nameidata nd;
int error; int error;
...@@ -327,7 +333,7 @@ sys_removexattr(char *path, char *name) ...@@ -327,7 +333,7 @@ sys_removexattr(char *path, char *name)
} }
asmlinkage long asmlinkage long
sys_lremovexattr(char *path, char *name) sys_lremovexattr(char __user *path, char __user *name)
{ {
struct nameidata nd; struct nameidata nd;
int error; int error;
...@@ -341,7 +347,7 @@ sys_lremovexattr(char *path, char *name) ...@@ -341,7 +347,7 @@ sys_lremovexattr(char *path, char *name)
} }
asmlinkage long asmlinkage long
sys_fremovexattr(int fd, char *name) sys_fremovexattr(int fd, char __user *name)
{ {
struct file *f; struct file *f;
int error = -EBADF; int error = -EBADF;
......
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