Commit 25cd22ca authored by Linus Torvalds's avatar Linus Torvalds

Annotate fs/stat.c with user pointer annotations.

parent 898df34c
......@@ -56,7 +56,7 @@ int vfs_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat)
return 0;
}
int vfs_stat(char *name, struct kstat *stat)
int vfs_stat(char __user *name, struct kstat *stat)
{
struct nameidata nd;
int error;
......@@ -69,7 +69,7 @@ int vfs_stat(char *name, struct kstat *stat)
return error;
}
int vfs_lstat(char *name, struct kstat *stat)
int vfs_lstat(char __user *name, struct kstat *stat)
{
struct nameidata nd;
int error;
......@@ -102,7 +102,7 @@ int vfs_fstat(unsigned int fd, struct kstat *stat)
* For backward compatibility? Maybe this should be moved
* into arch/i386 instead?
*/
static int cp_old_stat(struct kstat *stat, struct __old_kernel_stat * statbuf)
static int cp_old_stat(struct kstat *stat, struct __old_kernel_stat __user * statbuf)
{
static int warncount = 5;
struct __old_kernel_stat tmp;
......@@ -134,7 +134,7 @@ static int cp_old_stat(struct kstat *stat, struct __old_kernel_stat * statbuf)
return copy_to_user(statbuf,&tmp,sizeof(tmp)) ? -EFAULT : 0;
}
asmlinkage long sys_stat(char * filename, struct __old_kernel_stat * statbuf)
asmlinkage long sys_stat(char __user * filename, struct __old_kernel_stat __user * statbuf)
{
struct kstat stat;
int error = vfs_stat(filename, &stat);
......@@ -144,7 +144,7 @@ asmlinkage long sys_stat(char * filename, struct __old_kernel_stat * statbuf)
return error;
}
asmlinkage long sys_lstat(char * filename, struct __old_kernel_stat * statbuf)
asmlinkage long sys_lstat(char __user * filename, struct __old_kernel_stat __user * statbuf)
{
struct kstat stat;
int error = vfs_lstat(filename, &stat);
......@@ -154,7 +154,7 @@ asmlinkage long sys_lstat(char * filename, struct __old_kernel_stat * statbuf)
return error;
}
asmlinkage long sys_fstat(unsigned int fd, struct __old_kernel_stat * statbuf)
asmlinkage long sys_fstat(unsigned int fd, struct __old_kernel_stat __user * statbuf)
{
struct kstat stat;
int error = vfs_fstat(fd, &stat);
......@@ -167,7 +167,7 @@ asmlinkage long sys_fstat(unsigned int fd, struct __old_kernel_stat * statbuf)
#endif
static int cp_new_stat(struct kstat *stat, struct stat *statbuf)
static int cp_new_stat(struct kstat *stat, struct stat __user *statbuf)
{
struct stat tmp;
......@@ -197,7 +197,7 @@ static int cp_new_stat(struct kstat *stat, struct stat *statbuf)
return copy_to_user(statbuf,&tmp,sizeof(tmp)) ? -EFAULT : 0;
}
asmlinkage long sys_newstat(char * filename, struct stat * statbuf)
asmlinkage long sys_newstat(char __user * filename, struct stat __user * statbuf)
{
struct kstat stat;
int error = vfs_stat(filename, &stat);
......@@ -207,7 +207,7 @@ asmlinkage long sys_newstat(char * filename, struct stat * statbuf)
return error;
}
asmlinkage long sys_newlstat(char * filename, struct stat * statbuf)
asmlinkage long sys_newlstat(char __user * filename, struct stat __user * statbuf)
{
struct kstat stat;
int error = vfs_lstat(filename, &stat);
......@@ -217,7 +217,7 @@ asmlinkage long sys_newlstat(char * filename, struct stat * statbuf)
return error;
}
asmlinkage long sys_newfstat(unsigned int fd, struct stat * statbuf)
asmlinkage long sys_newfstat(unsigned int fd, struct stat __user * statbuf)
{
struct kstat stat;
int error = vfs_fstat(fd, &stat);
......@@ -228,7 +228,7 @@ asmlinkage long sys_newfstat(unsigned int fd, struct stat * statbuf)
return error;
}
asmlinkage long sys_readlink(const char * path, char * buf, int bufsiz)
asmlinkage long sys_readlink(const char __user * path, char __user * buf, int bufsiz)
{
struct nameidata nd;
int error;
......@@ -257,7 +257,7 @@ asmlinkage long sys_readlink(const char * path, char * buf, int bufsiz)
/* ---------- LFS-64 ----------- */
#if !defined(__alpha__) && !defined(__ia64__) && !defined(__mips64) && !defined(__x86_64__) && !defined(CONFIG_ARCH_S390X)
static long cp_new_stat64(struct kstat *stat, struct stat64 *statbuf)
static long cp_new_stat64(struct kstat *stat, struct stat64 __user *statbuf)
{
struct stat64 tmp;
......@@ -284,7 +284,7 @@ static long cp_new_stat64(struct kstat *stat, struct stat64 *statbuf)
return copy_to_user(statbuf,&tmp,sizeof(tmp)) ? -EFAULT : 0;
}
asmlinkage long sys_stat64(char * filename, struct stat64 * statbuf, long flags)
asmlinkage long sys_stat64(char __user * filename, struct stat64 __user * statbuf, long flags)
{
struct kstat stat;
int error = vfs_stat(filename, &stat);
......@@ -294,7 +294,7 @@ asmlinkage long sys_stat64(char * filename, struct stat64 * statbuf, long flags)
return error;
}
asmlinkage long sys_lstat64(char * filename, struct stat64 * statbuf, long flags)
asmlinkage long sys_lstat64(char __user * filename, struct stat64 __user * statbuf, long flags)
{
struct kstat stat;
int error = vfs_lstat(filename, &stat);
......@@ -304,7 +304,7 @@ asmlinkage long sys_lstat64(char * filename, struct stat64 * statbuf, long flags
return error;
}
asmlinkage long sys_fstat64(unsigned long fd, struct stat64 * statbuf, long flags)
asmlinkage long sys_fstat64(unsigned long fd, struct stat64 __user * statbuf, long flags)
{
struct kstat stat;
int error = vfs_fstat(fd, &stat);
......
......@@ -738,7 +738,7 @@ struct inode_operations {
int (*mknod) (struct inode *,struct dentry *,int,dev_t);
int (*rename) (struct inode *, struct dentry *,
struct inode *, struct dentry *);
int (*readlink) (struct dentry *, char *,int);
int (*readlink) (struct dentry *, char __user *,int);
int (*follow_link) (struct dentry *, struct nameidata *);
void (*truncate) (struct inode *);
int (*permission) (struct inode *, int);
......
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