diff options
| author | Linus Torvalds <torvalds@home.transmeta.com> | 2003-04-08 21:44:19 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.transmeta.com> | 2003-04-08 21:44:19 -0700 |
| commit | b1d7a6ca11201bab3e1172d77b1fd05454f4f107 (patch) | |
| tree | ad334a0a71b7224b1ee64aca188ecab92e5560e5 | |
| parent | 7c32f3a2a3407541c961cff8a066583991297a35 (diff) | |
Tag more user-supplied path strings as being user pointers for
type evaluation. This tags the system call interfaces in
fs/open.c, fs/dcache.c and mm/swapfile.c - and tags the path
walking helper functions.
| -rw-r--r-- | fs/dcache.c | 2 | ||||
| -rw-r--r-- | fs/open.c | 32 | ||||
| -rw-r--r-- | include/linux/fs.h | 2 | ||||
| -rw-r--r-- | include/linux/namei.h | 2 | ||||
| -rw-r--r-- | mm/swapfile.c | 4 |
5 files changed, 21 insertions, 21 deletions
diff --git a/fs/dcache.c b/fs/dcache.c index 75c420bb8d97..efc51c38ea25 100644 --- a/fs/dcache.c +++ b/fs/dcache.c @@ -1366,7 +1366,7 @@ char * d_path(struct dentry *dentry, struct vfsmount *vfsmnt, * return NULL; * } */ -asmlinkage long sys_getcwd(char *buf, unsigned long size) +asmlinkage long sys_getcwd(char __user *buf, unsigned long size) { int error; struct vfsmount *pwdmnt, *rootmnt; diff --git a/fs/open.c b/fs/open.c index 30aae79194d7..d56d61efe533 100644 --- a/fs/open.c +++ b/fs/open.c @@ -41,7 +41,7 @@ int vfs_statfs(struct super_block *sb, struct statfs *buf) } -asmlinkage long sys_statfs(const char * path, struct statfs * buf) +asmlinkage long sys_statfs(const char __user * path, struct statfs __user * buf) { struct nameidata nd; int error; @@ -57,7 +57,7 @@ asmlinkage long sys_statfs(const char * path, struct statfs * buf) return error; } -asmlinkage long sys_fstatfs(unsigned int fd, struct statfs * buf) +asmlinkage long sys_fstatfs(unsigned int fd, struct statfs __user * buf) { struct file * file; struct statfs tmp; @@ -92,7 +92,7 @@ int do_truncate(struct dentry *dentry, loff_t length) return err; } -static inline long do_sys_truncate(const char * path, loff_t length) +static inline long do_sys_truncate(const char __user * path, loff_t length) { struct nameidata nd; struct inode * inode; @@ -152,7 +152,7 @@ out: return error; } -asmlinkage long sys_truncate(const char * path, unsigned long length) +asmlinkage long sys_truncate(const char __user * path, unsigned long length) { /* on 32-bit boxen it will cut the range 2^31--2^32-1 off */ return do_sys_truncate(path, (long)length); @@ -208,7 +208,7 @@ asmlinkage long sys_ftruncate(unsigned int fd, unsigned long length) /* LFS versions of truncate are only needed on 32 bit machines */ #if BITS_PER_LONG == 32 -asmlinkage long sys_truncate64(const char * path, loff_t length) +asmlinkage long sys_truncate64(const char __user * path, loff_t length) { return do_sys_truncate(path, length); } @@ -232,7 +232,7 @@ asmlinkage long sys_ftruncate64(unsigned int fd, loff_t length) * must be owner or have write permission. * Else, update from *times, must be owner or super user. */ -asmlinkage long sys_utime(char * filename, struct utimbuf * times) +asmlinkage long sys_utime(char __user * filename, struct utimbuf __user * times) { int error; struct nameidata nd; @@ -280,7 +280,7 @@ out: * must be owner or have write permission. * Else, update from *times, must be owner or super user. */ -long do_utimes(char * filename, struct timeval * times) +long do_utimes(char __user * filename, struct timeval __user * times) { int error; struct nameidata nd; @@ -319,7 +319,7 @@ out: return error; } -asmlinkage long sys_utimes(char * filename, struct timeval * utimes) +asmlinkage long sys_utimes(char __user * filename, struct timeval __user * utimes) { struct timeval times[2]; @@ -334,7 +334,7 @@ asmlinkage long sys_utimes(char * filename, struct timeval * utimes) * We do this by temporarily clearing all FS-related capabilities and * switching the fsuid/fsgid around to the real ones. */ -asmlinkage long sys_access(const char * filename, int mode) +asmlinkage long sys_access(const char __user * filename, int mode) { struct nameidata nd; int old_fsuid, old_fsgid; @@ -381,7 +381,7 @@ asmlinkage long sys_access(const char * filename, int mode) return res; } -asmlinkage long sys_chdir(const char * filename) +asmlinkage long sys_chdir(const char __user * filename) { struct nameidata nd; int error; @@ -432,7 +432,7 @@ out: return error; } -asmlinkage long sys_chroot(const char * filename) +asmlinkage long sys_chroot(const char __user * filename) { struct nameidata nd; int error; @@ -493,7 +493,7 @@ out: return err; } -asmlinkage long sys_chmod(const char * filename, mode_t mode) +asmlinkage long sys_chmod(const char __user * filename, mode_t mode) { struct nameidata nd; struct inode * inode; @@ -562,7 +562,7 @@ out: return error; } -asmlinkage long sys_chown(const char * filename, uid_t user, gid_t group) +asmlinkage long sys_chown(const char __user * filename, uid_t user, gid_t group) { struct nameidata nd; int error; @@ -575,7 +575,7 @@ asmlinkage long sys_chown(const char * filename, uid_t user, gid_t group) return error; } -asmlinkage long sys_lchown(const char * filename, uid_t user, gid_t group) +asmlinkage long sys_lchown(const char __user * filename, uid_t user, gid_t group) { struct nameidata nd; int error; @@ -793,7 +793,7 @@ void fd_install(unsigned int fd, struct file * file) write_unlock(&files->file_lock); } -asmlinkage long sys_open(const char * filename, int flags, int mode) +asmlinkage long sys_open(const char __user * filename, int flags, int mode) { char * tmp; int fd, error; @@ -829,7 +829,7 @@ out_error: * For backward compatibility? Maybe this should be moved * into arch/i386 instead? */ -asmlinkage long sys_creat(const char * pathname, int mode) +asmlinkage long sys_creat(const char __user * pathname, int mode) { return sys_open(pathname, O_CREAT | O_WRONLY | O_TRUNC, mode); } diff --git a/include/linux/fs.h b/include/linux/fs.h index a3315d636032..16ad733f58e4 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -1024,7 +1024,7 @@ extern int do_truncate(struct dentry *, loff_t start); extern struct file *filp_open(const char *, int, int); extern struct file * dentry_open(struct dentry *, struct vfsmount *, int); extern int filp_close(struct file *, fl_owner_t id); -extern char * getname(const char *); +extern char * getname(const char __user *); /* fs/dcache.c */ extern void vfs_caches_init(unsigned long); diff --git a/include/linux/namei.h b/include/linux/namei.h index 9d5b102f9e9e..16baf5cdb9c7 100644 --- a/include/linux/namei.h +++ b/include/linux/namei.h @@ -33,7 +33,7 @@ enum {LAST_NORM, LAST_ROOT, LAST_DOT, LAST_DOTDOT, LAST_BIND}; #define LOOKUP_NOALT 32 -extern int FASTCALL(__user_walk(const char *, unsigned, struct nameidata *)); +extern int FASTCALL(__user_walk(const char __user *, unsigned, struct nameidata *)); #define user_path_walk(name,nd) \ __user_walk(name, LOOKUP_FOLLOW, nd) #define user_path_walk_link(name,nd) \ diff --git a/mm/swapfile.c b/mm/swapfile.c index e60b0fb2e321..8426b3e97464 100644 --- a/mm/swapfile.c +++ b/mm/swapfile.c @@ -995,7 +995,7 @@ int page_queue_congested(struct page *page) } #endif -asmlinkage long sys_swapoff(const char * specialfile) +asmlinkage long sys_swapoff(const char __user * specialfile) { struct swap_info_struct * p = NULL; unsigned short *swap_map; @@ -1199,7 +1199,7 @@ __initcall(procswaps_init); * * The swapon system call */ -asmlinkage long sys_swapon(const char * specialfile, int swap_flags) +asmlinkage long sys_swapon(const char __user * specialfile, int swap_flags) { struct swap_info_struct * p; char *name = NULL; |
