Commit c7887325 authored by David Howells's avatar David Howells Committed by Linus Torvalds

Mark arguments to certain syscalls as being const

Mark arguments to certain system calls as being const where they should be but
aren't.  The list includes:

 (*) The filename arguments of various stat syscalls, execve(), various utimes
     syscalls and some mount syscalls.

 (*) The filename arguments of some syscall helpers relating to the above.

 (*) The buffer argument of various write syscalls.
Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
Acked-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent b84ae4a1
...@@ -244,7 +244,7 @@ do_osf_statfs(struct path *path, struct osf_statfs __user *buffer, ...@@ -244,7 +244,7 @@ do_osf_statfs(struct path *path, struct osf_statfs __user *buffer,
return error; return error;
} }
SYSCALL_DEFINE3(osf_statfs, char __user *, pathname, SYSCALL_DEFINE3(osf_statfs, const char __user *, pathname,
struct osf_statfs __user *, buffer, unsigned long, bufsiz) struct osf_statfs __user *, buffer, unsigned long, bufsiz)
{ {
struct path path; struct path path;
...@@ -358,7 +358,7 @@ osf_procfs_mount(char *dirname, struct procfs_args __user *args, int flags) ...@@ -358,7 +358,7 @@ osf_procfs_mount(char *dirname, struct procfs_args __user *args, int flags)
return do_mount("", dirname, "proc", flags, NULL); return do_mount("", dirname, "proc", flags, NULL);
} }
SYSCALL_DEFINE4(osf_mount, unsigned long, typenr, char __user *, path, SYSCALL_DEFINE4(osf_mount, unsigned long, typenr, const char __user *, path,
int, flag, void __user *, data) int, flag, void __user *, data)
{ {
int retval; int retval;
...@@ -932,7 +932,7 @@ SYSCALL_DEFINE3(osf_setitimer, int, which, struct itimerval32 __user *, in, ...@@ -932,7 +932,7 @@ SYSCALL_DEFINE3(osf_setitimer, int, which, struct itimerval32 __user *, in,
} }
SYSCALL_DEFINE2(osf_utimes, char __user *, filename, SYSCALL_DEFINE2(osf_utimes, const char __user *, filename,
struct timeval32 __user *, tvs) struct timeval32 __user *, tvs)
{ {
struct timespec tv[2]; struct timespec tv[2];
......
...@@ -387,7 +387,7 @@ EXPORT_SYMBOL(dump_elf_task_fp); ...@@ -387,7 +387,7 @@ EXPORT_SYMBOL(dump_elf_task_fp);
* sys_execve() executes a new program. * sys_execve() executes a new program.
*/ */
asmlinkage int asmlinkage int
do_sys_execve(char __user *ufilename, char __user * __user *argv, do_sys_execve(const char __user *ufilename, char __user * __user *argv,
char __user * __user *envp, struct pt_regs *regs) char __user * __user *envp, struct pt_regs *regs)
{ {
int error; int error;
......
...@@ -62,7 +62,7 @@ asmlinkage int sys_vfork(struct pt_regs *regs) ...@@ -62,7 +62,7 @@ asmlinkage int sys_vfork(struct pt_regs *regs)
/* sys_execve() executes a new program. /* sys_execve() executes a new program.
* This is called indirectly via a small wrapper * This is called indirectly via a small wrapper
*/ */
asmlinkage int sys_execve(char __user *filenamei, char __user * __user *argv, asmlinkage int sys_execve(const char __user *filenamei, char __user * __user *argv,
char __user * __user *envp, struct pt_regs *regs) char __user * __user *envp, struct pt_regs *regs)
{ {
int error; int error;
...@@ -84,7 +84,7 @@ int kernel_execve(const char *filename, char *const argv[], char *const envp[]) ...@@ -84,7 +84,7 @@ int kernel_execve(const char *filename, char *const argv[], char *const envp[])
int ret; int ret;
memset(&regs, 0, sizeof(struct pt_regs)); memset(&regs, 0, sizeof(struct pt_regs));
ret = do_execve((char *)filename, (char __user * __user *)argv, ret = do_execve(filename, (char __user * __user *)argv,
(char __user * __user *)envp, &regs); (char __user * __user *)envp, &regs);
if (ret < 0) if (ret < 0)
goto out; goto out;
......
...@@ -141,7 +141,7 @@ static long cp_oldabi_stat64(struct kstat *stat, ...@@ -141,7 +141,7 @@ static long cp_oldabi_stat64(struct kstat *stat,
return copy_to_user(statbuf,&tmp,sizeof(tmp)) ? -EFAULT : 0; return copy_to_user(statbuf,&tmp,sizeof(tmp)) ? -EFAULT : 0;
} }
asmlinkage long sys_oabi_stat64(char __user * filename, asmlinkage long sys_oabi_stat64(const char __user * filename,
struct oldabi_stat64 __user * statbuf) struct oldabi_stat64 __user * statbuf)
{ {
struct kstat stat; struct kstat stat;
...@@ -151,7 +151,7 @@ asmlinkage long sys_oabi_stat64(char __user * filename, ...@@ -151,7 +151,7 @@ asmlinkage long sys_oabi_stat64(char __user * filename,
return error; return error;
} }
asmlinkage long sys_oabi_lstat64(char __user * filename, asmlinkage long sys_oabi_lstat64(const char __user * filename,
struct oldabi_stat64 __user * statbuf) struct oldabi_stat64 __user * statbuf)
{ {
struct kstat stat; struct kstat stat;
...@@ -172,7 +172,7 @@ asmlinkage long sys_oabi_fstat64(unsigned long fd, ...@@ -172,7 +172,7 @@ asmlinkage long sys_oabi_fstat64(unsigned long fd,
} }
asmlinkage long sys_oabi_fstatat64(int dfd, asmlinkage long sys_oabi_fstatat64(int dfd,
char __user *filename, const char __user *filename,
struct oldabi_stat64 __user *statbuf, struct oldabi_stat64 __user *statbuf,
int flag) int flag)
{ {
......
...@@ -21,7 +21,7 @@ asmlinkage int sys_clone(unsigned long, unsigned long, ...@@ -21,7 +21,7 @@ asmlinkage int sys_clone(unsigned long, unsigned long,
unsigned long, unsigned long, unsigned long, unsigned long,
struct pt_regs *); struct pt_regs *);
asmlinkage int sys_vfork(struct pt_regs *); asmlinkage int sys_vfork(struct pt_regs *);
asmlinkage int sys_execve(char __user *, char __user *__user *, asmlinkage int sys_execve(const char __user *, char __user *__user *,
char __user *__user *, struct pt_regs *); char __user *__user *, struct pt_regs *);
/* kernel/signal.c */ /* kernel/signal.c */
......
...@@ -383,7 +383,8 @@ asmlinkage int sys_vfork(struct pt_regs *regs) ...@@ -383,7 +383,8 @@ asmlinkage int sys_vfork(struct pt_regs *regs)
0, NULL, NULL); 0, NULL, NULL);
} }
asmlinkage int sys_execve(char __user *ufilename, char __user *__user *uargv, asmlinkage int sys_execve(const char __user *ufilename,
char __user *__user *uargv,
char __user *__user *uenvp, struct pt_regs *regs) char __user *__user *uenvp, struct pt_regs *regs)
{ {
int error; int error;
......
...@@ -209,7 +209,7 @@ copy_thread(unsigned long clone_flags, ...@@ -209,7 +209,7 @@ copy_thread(unsigned long clone_flags,
/* /*
* sys_execve() executes a new program. * sys_execve() executes a new program.
*/ */
asmlinkage int sys_execve(char __user *name, char __user * __user *argv, char __user * __user *envp) asmlinkage int sys_execve(const char __user *name, char __user * __user *argv, char __user * __user *envp)
{ {
int error; int error;
char *filename; char *filename;
......
...@@ -250,7 +250,8 @@ int copy_thread(unsigned long clone_flags, ...@@ -250,7 +250,8 @@ int copy_thread(unsigned long clone_flags,
/* /*
* sys_execve() executes a new program. * sys_execve() executes a new program.
*/ */
asmlinkage int sys_execve(char __user *name, char __user * __user *argv, char __user * __user *envp) asmlinkage int sys_execve(const char __user *name, char __user * __user *argv,
char __user * __user *envp)
{ {
int error; int error;
char * filename; char * filename;
......
...@@ -212,7 +212,7 @@ int copy_thread(unsigned long clone_flags, ...@@ -212,7 +212,7 @@ int copy_thread(unsigned long clone_flags,
/* /*
* sys_execve() executes a new program. * sys_execve() executes a new program.
*/ */
asmlinkage int sys_execve(char *name, char **argv, char **envp,int dummy,...) asmlinkage int sys_execve(const char *name, char **argv, char **envp,int dummy,...)
{ {
int error; int error;
char * filename; char * filename;
......
...@@ -353,7 +353,7 @@ asmlinkage unsigned long sys_mmap2( ...@@ -353,7 +353,7 @@ asmlinkage unsigned long sys_mmap2(
int fd, long pgoff); int fd, long pgoff);
struct pt_regs; struct pt_regs;
struct sigaction; struct sigaction;
long sys_execve(char __user *filename, char __user * __user *argv, long sys_execve(const char __user *filename, char __user * __user *argv,
char __user * __user *envp, struct pt_regs *regs); char __user * __user *envp, struct pt_regs *regs);
asmlinkage long sys_ia64_pipe(void); asmlinkage long sys_ia64_pipe(void);
asmlinkage long sys_rt_sigaction(int sig, asmlinkage long sys_rt_sigaction(int sig,
......
...@@ -633,7 +633,7 @@ dump_fpu (struct pt_regs *pt, elf_fpregset_t dst) ...@@ -633,7 +633,7 @@ dump_fpu (struct pt_regs *pt, elf_fpregset_t dst)
} }
long long
sys_execve (char __user *filename, char __user * __user *argv, char __user * __user *envp, sys_execve (const char __user *filename, char __user * __user *argv, char __user * __user *envp,
struct pt_regs *regs) struct pt_regs *regs)
{ {
char *fname; char *fname;
......
...@@ -288,7 +288,8 @@ asmlinkage int sys_vfork(unsigned long r0, unsigned long r1, unsigned long r2, ...@@ -288,7 +288,8 @@ asmlinkage int sys_vfork(unsigned long r0, unsigned long r1, unsigned long r2,
/* /*
* sys_execve() executes a new program. * sys_execve() executes a new program.
*/ */
asmlinkage int sys_execve(char __user *ufilename, char __user * __user *uargv, asmlinkage int sys_execve(const char __user *ufilename,
char __user * __user *uargv,
char __user * __user *uenvp, char __user * __user *uenvp,
unsigned long r3, unsigned long r4, unsigned long r5, unsigned long r3, unsigned long r4, unsigned long r5,
unsigned long r6, struct pt_regs regs) unsigned long r6, struct pt_regs regs)
......
...@@ -315,7 +315,7 @@ EXPORT_SYMBOL(dump_fpu); ...@@ -315,7 +315,7 @@ EXPORT_SYMBOL(dump_fpu);
/* /*
* sys_execve() executes a new program. * sys_execve() executes a new program.
*/ */
asmlinkage int sys_execve(char __user *name, char __user * __user *argv, char __user * __user *envp) asmlinkage int sys_execve(const char __user *name, char __user * __user *argv, char __user * __user *envp)
{ {
int error; int error;
char * filename; char * filename;
......
...@@ -350,7 +350,7 @@ void dump(struct pt_regs *fp) ...@@ -350,7 +350,7 @@ void dump(struct pt_regs *fp)
/* /*
* sys_execve() executes a new program. * sys_execve() executes a new program.
*/ */
asmlinkage int sys_execve(char *name, char **argv, char **envp) asmlinkage int sys_execve(const char *name, char **argv, char **envp)
{ {
int error; int error;
char * filename; char * filename;
......
...@@ -47,7 +47,7 @@ asmlinkage long microblaze_clone(int flags, unsigned long stack, struct pt_regs ...@@ -47,7 +47,7 @@ asmlinkage long microblaze_clone(int flags, unsigned long stack, struct pt_regs
return do_fork(flags, stack, regs, 0, NULL, NULL); return do_fork(flags, stack, regs, 0, NULL, NULL);
} }
asmlinkage long microblaze_execve(char __user *filenamei, char __user *__user *argv, asmlinkage long microblaze_execve(const char __user *filenamei, char __user *__user *argv,
char __user *__user *envp, struct pt_regs *regs) char __user *__user *envp, struct pt_regs *regs)
{ {
int error; int error;
......
...@@ -254,7 +254,7 @@ asmlinkage int sys_execve(nabi_no_regargs struct pt_regs regs) ...@@ -254,7 +254,7 @@ asmlinkage int sys_execve(nabi_no_regargs struct pt_regs regs)
int error; int error;
char * filename; char * filename;
filename = getname((char __user *) (long)regs.regs[4]); filename = getname((const char __user *) (long)regs.regs[4]);
error = PTR_ERR(filename); error = PTR_ERR(filename);
if (IS_ERR(filename)) if (IS_ERR(filename))
goto out; goto out;
......
...@@ -268,7 +268,7 @@ asmlinkage long sys_vfork(void) ...@@ -268,7 +268,7 @@ asmlinkage long sys_vfork(void)
0, NULL, NULL); 0, NULL, NULL);
} }
asmlinkage long sys_execve(char __user *name, asmlinkage long sys_execve(const char __user *name,
char __user * __user *argv, char __user * __user *argv,
char __user * __user *envp) char __user * __user *envp)
{ {
......
...@@ -36,7 +36,7 @@ int hpux_execve(struct pt_regs *regs) ...@@ -36,7 +36,7 @@ int hpux_execve(struct pt_regs *regs)
int error; int error;
char *filename; char *filename;
filename = getname((char __user *) regs->gr[26]); filename = getname((const char __user *) regs->gr[26]);
error = PTR_ERR(filename); error = PTR_ERR(filename);
if (IS_ERR(filename)) if (IS_ERR(filename))
goto out; goto out;
...@@ -169,7 +169,7 @@ static int cp_hpux_stat(struct kstat *stat, struct hpux_stat64 __user *statbuf) ...@@ -169,7 +169,7 @@ static int cp_hpux_stat(struct kstat *stat, struct hpux_stat64 __user *statbuf)
return copy_to_user(statbuf,&tmp,sizeof(tmp)) ? -EFAULT : 0; return copy_to_user(statbuf,&tmp,sizeof(tmp)) ? -EFAULT : 0;
} }
long hpux_stat64(char __user *filename, struct hpux_stat64 __user *statbuf) long hpux_stat64(const char __user *filename, struct hpux_stat64 __user *statbuf)
{ {
struct kstat stat; struct kstat stat;
int error = vfs_stat(filename, &stat); int error = vfs_stat(filename, &stat);
...@@ -191,7 +191,8 @@ long hpux_fstat64(unsigned int fd, struct hpux_stat64 __user *statbuf) ...@@ -191,7 +191,8 @@ long hpux_fstat64(unsigned int fd, struct hpux_stat64 __user *statbuf)
return error; return error;
} }
long hpux_lstat64(char __user *filename, struct hpux_stat64 __user *statbuf) long hpux_lstat64(const char __user *filename,
struct hpux_stat64 __user *statbuf)
{ {
struct kstat stat; struct kstat stat;
int error = vfs_lstat(filename, &stat); int error = vfs_lstat(filename, &stat);
......
...@@ -1027,7 +1027,7 @@ int sys_execve(unsigned long a0, unsigned long a1, unsigned long a2, ...@@ -1027,7 +1027,7 @@ int sys_execve(unsigned long a0, unsigned long a1, unsigned long a2,
int error; int error;
char *filename; char *filename;
filename = getname((char __user *) a0); filename = getname((const char __user *) a0);
error = PTR_ERR(filename); error = PTR_ERR(filename);
if (IS_ERR(filename)) if (IS_ERR(filename))
goto out; goto out;
......
...@@ -546,7 +546,7 @@ compat_ssize_t compat_sys_pread64(unsigned int fd, char __user *ubuf, compat_siz ...@@ -546,7 +546,7 @@ compat_ssize_t compat_sys_pread64(unsigned int fd, char __user *ubuf, compat_siz
return sys_pread64(fd, ubuf, count, ((loff_t)poshi << 32) | poslo); return sys_pread64(fd, ubuf, count, ((loff_t)poshi << 32) | poslo);
} }
compat_ssize_t compat_sys_pwrite64(unsigned int fd, char __user *ubuf, compat_size_t count, compat_ssize_t compat_sys_pwrite64(unsigned int fd, const char __user *ubuf, compat_size_t count,
u32 reg6, u32 poshi, u32 poslo) u32 reg6, u32 poshi, u32 poslo)
{ {
return sys_pwrite64(fd, ubuf, count, ((loff_t)poshi << 32) | poslo); return sys_pwrite64(fd, ubuf, count, ((loff_t)poshi << 32) | poslo);
......
...@@ -436,7 +436,7 @@ sys32_rt_sigqueueinfo(int pid, int sig, compat_siginfo_t __user *uinfo) ...@@ -436,7 +436,7 @@ sys32_rt_sigqueueinfo(int pid, int sig, compat_siginfo_t __user *uinfo)
* sys32_execve() executes a new program after the asm stub has set * sys32_execve() executes a new program after the asm stub has set
* things up for us. This should basically do what I want it to. * things up for us. This should basically do what I want it to.
*/ */
asmlinkage long sys32_execve(char __user *name, compat_uptr_t __user *argv, asmlinkage long sys32_execve(const char __user *name, compat_uptr_t __user *argv,
compat_uptr_t __user *envp) compat_uptr_t __user *envp)
{ {
struct pt_regs *regs = task_pt_regs(current); struct pt_regs *regs = task_pt_regs(current);
...@@ -570,7 +570,7 @@ static int cp_stat64(struct stat64_emu31 __user *ubuf, struct kstat *stat) ...@@ -570,7 +570,7 @@ static int cp_stat64(struct stat64_emu31 __user *ubuf, struct kstat *stat)
return copy_to_user(ubuf,&tmp,sizeof(tmp)) ? -EFAULT : 0; return copy_to_user(ubuf,&tmp,sizeof(tmp)) ? -EFAULT : 0;
} }
asmlinkage long sys32_stat64(char __user * filename, struct stat64_emu31 __user * statbuf) asmlinkage long sys32_stat64(const char __user * filename, struct stat64_emu31 __user * statbuf)
{ {
struct kstat stat; struct kstat stat;
int ret = vfs_stat(filename, &stat); int ret = vfs_stat(filename, &stat);
...@@ -579,7 +579,7 @@ asmlinkage long sys32_stat64(char __user * filename, struct stat64_emu31 __user ...@@ -579,7 +579,7 @@ asmlinkage long sys32_stat64(char __user * filename, struct stat64_emu31 __user
return ret; return ret;
} }
asmlinkage long sys32_lstat64(char __user * filename, struct stat64_emu31 __user * statbuf) asmlinkage long sys32_lstat64(const char __user * filename, struct stat64_emu31 __user * statbuf)
{ {
struct kstat stat; struct kstat stat;
int ret = vfs_lstat(filename, &stat); int ret = vfs_lstat(filename, &stat);
...@@ -597,7 +597,7 @@ asmlinkage long sys32_fstat64(unsigned long fd, struct stat64_emu31 __user * sta ...@@ -597,7 +597,7 @@ asmlinkage long sys32_fstat64(unsigned long fd, struct stat64_emu31 __user * sta
return ret; return ret;
} }
asmlinkage long sys32_fstatat64(unsigned int dfd, char __user *filename, asmlinkage long sys32_fstatat64(unsigned int dfd, const char __user *filename,
struct stat64_emu31 __user* statbuf, int flag) struct stat64_emu31 __user* statbuf, int flag)
{ {
struct kstat stat; struct kstat stat;
...@@ -655,7 +655,7 @@ asmlinkage long sys32_read(unsigned int fd, char __user * buf, size_t count) ...@@ -655,7 +655,7 @@ asmlinkage long sys32_read(unsigned int fd, char __user * buf, size_t count)
return sys_read(fd, buf, count); return sys_read(fd, buf, count);
} }
asmlinkage long sys32_write(unsigned int fd, char __user * buf, size_t count) asmlinkage long sys32_write(unsigned int fd, const char __user * buf, size_t count)
{ {
if ((compat_ssize_t) count < 0) if ((compat_ssize_t) count < 0)
return -EINVAL; return -EINVAL;
......
...@@ -193,7 +193,7 @@ long sys32_rt_sigprocmask(int how, compat_sigset_t __user *set, ...@@ -193,7 +193,7 @@ long sys32_rt_sigprocmask(int how, compat_sigset_t __user *set,
compat_sigset_t __user *oset, size_t sigsetsize); compat_sigset_t __user *oset, size_t sigsetsize);
long sys32_rt_sigpending(compat_sigset_t __user *set, size_t sigsetsize); long sys32_rt_sigpending(compat_sigset_t __user *set, size_t sigsetsize);
long sys32_rt_sigqueueinfo(int pid, int sig, compat_siginfo_t __user *uinfo); long sys32_rt_sigqueueinfo(int pid, int sig, compat_siginfo_t __user *uinfo);
long sys32_execve(char __user *name, compat_uptr_t __user *argv, long sys32_execve(const char __user *name, compat_uptr_t __user *argv,
compat_uptr_t __user *envp); compat_uptr_t __user *envp);
long sys32_init_module(void __user *umod, unsigned long len, long sys32_init_module(void __user *umod, unsigned long len,
const char __user *uargs); const char __user *uargs);
...@@ -207,16 +207,16 @@ long sys32_sendfile(int out_fd, int in_fd, compat_off_t __user *offset, ...@@ -207,16 +207,16 @@ long sys32_sendfile(int out_fd, int in_fd, compat_off_t __user *offset,
size_t count); size_t count);
long sys32_sendfile64(int out_fd, int in_fd, compat_loff_t __user *offset, long sys32_sendfile64(int out_fd, int in_fd, compat_loff_t __user *offset,
s32 count); s32 count);
long sys32_stat64(char __user * filename, struct stat64_emu31 __user * statbuf); long sys32_stat64(const char __user * filename, struct stat64_emu31 __user * statbuf);
long sys32_lstat64(char __user * filename, long sys32_lstat64(const char __user * filename,
struct stat64_emu31 __user * statbuf); struct stat64_emu31 __user * statbuf);
long sys32_fstat64(unsigned long fd, struct stat64_emu31 __user * statbuf); long sys32_fstat64(unsigned long fd, struct stat64_emu31 __user * statbuf);
long sys32_fstatat64(unsigned int dfd, char __user *filename, long sys32_fstatat64(unsigned int dfd, const char __user *filename,
struct stat64_emu31 __user* statbuf, int flag); struct stat64_emu31 __user* statbuf, int flag);
unsigned long old32_mmap(struct mmap_arg_struct_emu31 __user *arg); unsigned long old32_mmap(struct mmap_arg_struct_emu31 __user *arg);
long sys32_mmap2(struct mmap_arg_struct_emu31 __user *arg); long sys32_mmap2(struct mmap_arg_struct_emu31 __user *arg);
long sys32_read(unsigned int fd, char __user * buf, size_t count); long sys32_read(unsigned int fd, char __user * buf, size_t count);
long sys32_write(unsigned int fd, char __user * buf, size_t count); long sys32_write(unsigned int fd, const char __user * buf, size_t count);
long sys32_fadvise64(int fd, loff_t offset, size_t len, int advise); long sys32_fadvise64(int fd, loff_t offset, size_t len, int advise);
long sys32_fadvise64_64(struct fadvise64_64_args __user *args); long sys32_fadvise64_64(struct fadvise64_64_args __user *args);
long sys32_sigaction(int sig, const struct old_sigaction32 __user *act, long sys32_sigaction(int sig, const struct old_sigaction32 __user *act,
......
...@@ -42,7 +42,7 @@ long sys_clone(unsigned long newsp, unsigned long clone_flags, ...@@ -42,7 +42,7 @@ long sys_clone(unsigned long newsp, unsigned long clone_flags,
int __user *parent_tidptr, int __user *child_tidptr); int __user *parent_tidptr, int __user *child_tidptr);
long sys_vfork(void); long sys_vfork(void);
void execve_tail(void); void execve_tail(void);
long sys_execve(char __user *name, char __user * __user *argv, long sys_execve(const char __user *name, char __user * __user *argv,
char __user * __user *envp); char __user * __user *envp);
long sys_sigsuspend(int history0, int history1, old_sigset_t mask); long sys_sigsuspend(int history0, int history1, old_sigset_t mask);
long sys_sigaction(int sig, const struct old_sigaction __user *act, long sys_sigaction(int sig, const struct old_sigaction __user *act,
......
...@@ -267,7 +267,7 @@ asmlinkage void execve_tail(void) ...@@ -267,7 +267,7 @@ asmlinkage void execve_tail(void)
/* /*
* sys_execve() executes a new program. * sys_execve() executes a new program.
*/ */
SYSCALL_DEFINE3(execve, char __user *, name, char __user * __user *, argv, SYSCALL_DEFINE3(execve, const char __user *, name, char __user * __user *, argv,
char __user * __user *, envp) char __user * __user *, envp)
{ {
struct pt_regs *regs = task_pt_regs(current); struct pt_regs *regs = task_pt_regs(current);
......
...@@ -19,7 +19,7 @@ asmlinkage int sys_clone(unsigned long clone_flags, unsigned long newsp, ...@@ -19,7 +19,7 @@ asmlinkage int sys_clone(unsigned long clone_flags, unsigned long newsp,
asmlinkage int sys_vfork(unsigned long r4, unsigned long r5, asmlinkage int sys_vfork(unsigned long r4, unsigned long r5,
unsigned long r6, unsigned long r7, unsigned long r6, unsigned long r7,
struct pt_regs __regs); struct pt_regs __regs);
asmlinkage int sys_execve(char __user *ufilename, char __user * __user *uargv, asmlinkage int sys_execve(const char __user *ufilename, char __user * __user *uargv,
char __user * __user *uenvp, unsigned long r7, char __user * __user *uenvp, unsigned long r7,
struct pt_regs __regs); struct pt_regs __regs);
asmlinkage int sys_sigsuspend(old_sigset_t mask, unsigned long r5, asmlinkage int sys_sigsuspend(old_sigset_t mask, unsigned long r5,
......
...@@ -21,7 +21,7 @@ asmlinkage int sys_vfork(unsigned long r2, unsigned long r3, ...@@ -21,7 +21,7 @@ asmlinkage int sys_vfork(unsigned long r2, unsigned long r3,
unsigned long r4, unsigned long r5, unsigned long r4, unsigned long r5,
unsigned long r6, unsigned long r7, unsigned long r6, unsigned long r7,
struct pt_regs *pregs); struct pt_regs *pregs);
asmlinkage int sys_execve(char *ufilename, char **uargv, asmlinkage int sys_execve(const char *ufilename, char **uargv,
char **uenvp, unsigned long r5, char **uenvp, unsigned long r5,
unsigned long r6, unsigned long r7, unsigned long r6, unsigned long r7,
struct pt_regs *pregs); struct pt_regs *pregs);
......
...@@ -483,7 +483,7 @@ asmlinkage int sys_vfork(unsigned long r2, unsigned long r3, ...@@ -483,7 +483,7 @@ asmlinkage int sys_vfork(unsigned long r2, unsigned long r3,
/* /*
* sys_execve() executes a new program. * sys_execve() executes a new program.
*/ */
asmlinkage int sys_execve(char *ufilename, char **uargv, asmlinkage int sys_execve(const char *ufilename, char **uargv,
char **uenvp, unsigned long r5, char **uenvp, unsigned long r5,
unsigned long r6, unsigned long r7, unsigned long r6, unsigned long r7,
struct pt_regs *pregs) struct pt_regs *pregs)
......
...@@ -162,7 +162,7 @@ static int cp_compat_stat64(struct kstat *stat, ...@@ -162,7 +162,7 @@ static int cp_compat_stat64(struct kstat *stat,
return err; return err;
} }
asmlinkage long compat_sys_stat64(char __user * filename, asmlinkage long compat_sys_stat64(const char __user * filename,
struct compat_stat64 __user *statbuf) struct compat_stat64 __user *statbuf)
{ {
struct kstat stat; struct kstat stat;
...@@ -173,7 +173,7 @@ asmlinkage long compat_sys_stat64(char __user * filename, ...@@ -173,7 +173,7 @@ asmlinkage long compat_sys_stat64(char __user * filename,
return error; return error;
} }
asmlinkage long compat_sys_lstat64(char __user * filename, asmlinkage long compat_sys_lstat64(const char __user * filename,
struct compat_stat64 __user *statbuf) struct compat_stat64 __user *statbuf)
{ {
struct kstat stat; struct kstat stat;
...@@ -195,7 +195,8 @@ asmlinkage long compat_sys_fstat64(unsigned int fd, ...@@ -195,7 +195,8 @@ asmlinkage long compat_sys_fstat64(unsigned int fd,
return error; return error;
} }
asmlinkage long compat_sys_fstatat64(unsigned int dfd, char __user *filename, asmlinkage long compat_sys_fstatat64(unsigned int dfd,
const char __user *filename,
struct compat_stat64 __user * statbuf, int flag) struct compat_stat64 __user * statbuf, int flag)
{ {
struct kstat stat; struct kstat stat;
......
...@@ -44,7 +44,7 @@ void start_thread(struct pt_regs *regs, unsigned long eip, unsigned long esp) ...@@ -44,7 +44,7 @@ void start_thread(struct pt_regs *regs, unsigned long eip, unsigned long esp)
PT_REGS_SP(regs) = esp; PT_REGS_SP(regs) = esp;
} }
static long execve1(char *file, char __user * __user *argv, static long execve1(const char *file, char __user * __user *argv,
char __user *__user *env) char __user *__user *env)
{ {
long error; long error;
...@@ -61,7 +61,7 @@ static long execve1(char *file, char __user * __user *argv, ...@@ -61,7 +61,7 @@ static long execve1(char *file, char __user * __user *argv,
return error; return error;
} }
long um_execve(char *file, char __user *__user *argv, char __user *__user *env) long um_execve(const char *file, char __user *__user *argv, char __user *__user *env)
{ {
long err; long err;
...@@ -71,7 +71,7 @@ long um_execve(char *file, char __user *__user *argv, char __user *__user *env) ...@@ -71,7 +71,7 @@ long um_execve(char *file, char __user *__user *argv, char __user *__user *env)
return err; return err;
} }
long sys_execve(char __user *file, char __user *__user *argv, long sys_execve(const char __user *file, char __user *__user *argv,
char __user *__user *env) char __user *__user *env)
{ {
long error; long error;
......
extern long um_execve(char *file, char __user *__user *argv, char __user *__user *env); extern long um_execve(const char *file, char __user *__user *argv, char __user *__user *env);
...@@ -58,7 +58,7 @@ int kernel_execve(const char *filename, char *const argv[], char *const envp[]) ...@@ -58,7 +58,7 @@ int kernel_execve(const char *filename, char *const argv[], char *const envp[])
fs = get_fs(); fs = get_fs();
set_fs(KERNEL_DS); set_fs(KERNEL_DS);
ret = um_execve((char *)filename, (char __user *__user *)argv, ret = um_execve(filename, (char __user *__user *)argv,
(char __user *__user *) envp); (char __user *__user *) envp);
set_fs(fs); set_fs(fs);
......
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
#define AA(__x) ((unsigned long)(__x)) #define AA(__x) ((unsigned long)(__x))
asmlinkage long sys32_truncate64(char __user *filename, asmlinkage long sys32_truncate64(const char __user *filename,
unsigned long offset_low, unsigned long offset_low,
unsigned long offset_high) unsigned long offset_high)
{ {
...@@ -96,7 +96,7 @@ static int cp_stat64(struct stat64 __user *ubuf, struct kstat *stat) ...@@ -96,7 +96,7 @@ static int cp_stat64(struct stat64 __user *ubuf, struct kstat *stat)
return 0; return 0;
} }
asmlinkage long sys32_stat64(char __user *filename, asmlinkage long sys32_stat64(const char __user *filename,
struct stat64 __user *statbuf) struct stat64 __user *statbuf)
{ {
struct kstat stat; struct kstat stat;
...@@ -107,7 +107,7 @@ asmlinkage long sys32_stat64(char __user *filename, ...@@ -107,7 +107,7 @@ asmlinkage long sys32_stat64(char __user *filename,
return ret; return ret;
} }
asmlinkage long sys32_lstat64(char __user *filename, asmlinkage long sys32_lstat64(const char __user *filename,
struct stat64 __user *statbuf) struct stat64 __user *statbuf)
{ {
struct kstat stat; struct kstat stat;
...@@ -126,7 +126,7 @@ asmlinkage long sys32_fstat64(unsigned int fd, struct stat64 __user *statbuf) ...@@ -126,7 +126,7 @@ asmlinkage long sys32_fstat64(unsigned int fd, struct stat64 __user *statbuf)
return ret; return ret;
} }
asmlinkage long sys32_fstatat(unsigned int dfd, char __user *filename, asmlinkage long sys32_fstatat(unsigned int dfd, const char __user *filename,
struct stat64 __user *statbuf, int flag) struct stat64 __user *statbuf, int flag)
{ {
struct kstat stat; struct kstat stat;
...@@ -408,8 +408,8 @@ asmlinkage long sys32_pread(unsigned int fd, char __user *ubuf, u32 count, ...@@ -408,8 +408,8 @@ asmlinkage long sys32_pread(unsigned int fd, char __user *ubuf, u32 count,
((loff_t)AA(poshi) << 32) | AA(poslo)); ((loff_t)AA(poshi) << 32) | AA(poslo));
} }
asmlinkage long sys32_pwrite(unsigned int fd, char __user *ubuf, u32 count, asmlinkage long sys32_pwrite(unsigned int fd, const char __user *ubuf,
u32 poslo, u32 poshi) u32 count, u32 poslo, u32 poshi)
{ {
return sys_pwrite64(fd, ubuf, count, return sys_pwrite64(fd, ubuf, count,
((loff_t)AA(poshi) << 32) | AA(poslo)); ((loff_t)AA(poshi) << 32) | AA(poslo));
...@@ -449,7 +449,7 @@ asmlinkage long sys32_sendfile(int out_fd, int in_fd, ...@@ -449,7 +449,7 @@ asmlinkage long sys32_sendfile(int out_fd, int in_fd,
return ret; return ret;
} }
asmlinkage long sys32_execve(char __user *name, compat_uptr_t __user *argv, asmlinkage long sys32_execve(const char __user *name, compat_uptr_t __user *argv,
compat_uptr_t __user *envp, struct pt_regs *regs) compat_uptr_t __user *envp, struct pt_regs *regs)
{ {
long error; long error;
......
...@@ -18,13 +18,13 @@ ...@@ -18,13 +18,13 @@
#include <asm/ia32.h> #include <asm/ia32.h>
/* ia32/sys_ia32.c */ /* ia32/sys_ia32.c */
asmlinkage long sys32_truncate64(char __user *, unsigned long, unsigned long); asmlinkage long sys32_truncate64(const char __user *, unsigned long, unsigned long);
asmlinkage long sys32_ftruncate64(unsigned int, unsigned long, unsigned long); asmlinkage long sys32_ftruncate64(unsigned int, unsigned long, unsigned long);
asmlinkage long sys32_stat64(char __user *, struct stat64 __user *); asmlinkage long sys32_stat64(const char __user *, struct stat64 __user *);
asmlinkage long sys32_lstat64(char __user *, struct stat64 __user *); asmlinkage long sys32_lstat64(const char __user *, struct stat64 __user *);
asmlinkage long sys32_fstat64(unsigned int, struct stat64 __user *); asmlinkage long sys32_fstat64(unsigned int, struct stat64 __user *);
asmlinkage long sys32_fstatat(unsigned int, char __user *, asmlinkage long sys32_fstatat(unsigned int, const char __user *,
struct stat64 __user *, int); struct stat64 __user *, int);
struct mmap_arg_struct32; struct mmap_arg_struct32;
asmlinkage long sys32_mmap(struct mmap_arg_struct32 __user *); asmlinkage long sys32_mmap(struct mmap_arg_struct32 __user *);
...@@ -49,12 +49,12 @@ asmlinkage long sys32_rt_sigpending(compat_sigset_t __user *, compat_size_t); ...@@ -49,12 +49,12 @@ asmlinkage long sys32_rt_sigpending(compat_sigset_t __user *, compat_size_t);
asmlinkage long sys32_rt_sigqueueinfo(int, int, compat_siginfo_t __user *); asmlinkage long sys32_rt_sigqueueinfo(int, int, compat_siginfo_t __user *);
asmlinkage long sys32_pread(unsigned int, char __user *, u32, u32, u32); asmlinkage long sys32_pread(unsigned int, char __user *, u32, u32, u32);
asmlinkage long sys32_pwrite(unsigned int, char __user *, u32, u32, u32); asmlinkage long sys32_pwrite(unsigned int, const char __user *, u32, u32, u32);
asmlinkage long sys32_personality(unsigned long); asmlinkage long sys32_personality(unsigned long);
asmlinkage long sys32_sendfile(int, int, compat_off_t __user *, s32); asmlinkage long sys32_sendfile(int, int, compat_off_t __user *, s32);
asmlinkage long sys32_execve(char __user *, compat_uptr_t __user *, asmlinkage long sys32_execve(const char __user *, compat_uptr_t __user *,
compat_uptr_t __user *, struct pt_regs *); compat_uptr_t __user *, struct pt_regs *);
asmlinkage long sys32_clone(unsigned int, unsigned int, struct pt_regs *); asmlinkage long sys32_clone(unsigned int, unsigned int, struct pt_regs *);
......
...@@ -23,7 +23,7 @@ long sys_iopl(unsigned int, struct pt_regs *); ...@@ -23,7 +23,7 @@ long sys_iopl(unsigned int, struct pt_regs *);
/* kernel/process.c */ /* kernel/process.c */
int sys_fork(struct pt_regs *); int sys_fork(struct pt_regs *);
int sys_vfork(struct pt_regs *); int sys_vfork(struct pt_regs *);
long sys_execve(char __user *, char __user * __user *, long sys_execve(const char __user *, char __user * __user *,
char __user * __user *, struct pt_regs *); char __user * __user *, struct pt_regs *);
long sys_clone(unsigned long, unsigned long, void __user *, long sys_clone(unsigned long, unsigned long, void __user *,
void __user *, struct pt_regs *); void __user *, struct pt_regs *);
......
...@@ -1185,13 +1185,13 @@ END(kernel_thread_helper) ...@@ -1185,13 +1185,13 @@ END(kernel_thread_helper)
* execve(). This function needs to use IRET, not SYSRET, to set up all state properly. * execve(). This function needs to use IRET, not SYSRET, to set up all state properly.
* *
* C extern interface: * C extern interface:
* extern long execve(char *name, char **argv, char **envp) * extern long execve(const char *name, char **argv, char **envp)
* *
* asm input arguments: * asm input arguments:
* rdi: name, rsi: argv, rdx: envp * rdi: name, rsi: argv, rdx: envp
* *
* We want to fallback into: * We want to fallback into:
* extern long sys_execve(char *name, char **argv,char **envp, struct pt_regs *regs) * extern long sys_execve(const char *name, char **argv,char **envp, struct pt_regs *regs)
* *
* do_sys_execve asm fallback arguments: * do_sys_execve asm fallback arguments:
* rdi: name, rsi: argv, rdx: envp, rcx: fake frame on the stack * rdi: name, rsi: argv, rdx: envp, rcx: fake frame on the stack
......
...@@ -301,7 +301,7 @@ EXPORT_SYMBOL(kernel_thread); ...@@ -301,7 +301,7 @@ EXPORT_SYMBOL(kernel_thread);
/* /*
* sys_execve() executes a new program. * sys_execve() executes a new program.
*/ */
long sys_execve(char __user *name, char __user * __user *argv, long sys_execve(const char __user *name, char __user * __user *argv,
char __user * __user *envp, struct pt_regs *regs) char __user * __user *envp, struct pt_regs *regs)
{ {
long error; long error;
......
...@@ -318,7 +318,7 @@ long xtensa_clone(unsigned long clone_flags, unsigned long newsp, ...@@ -318,7 +318,7 @@ long xtensa_clone(unsigned long clone_flags, unsigned long newsp,
*/ */
asmlinkage asmlinkage
long xtensa_execve(char __user *name, char __user * __user *argv, long xtensa_execve(const char __user *name, char __user * __user *argv,
char __user * __user *envp, char __user * __user *envp,
long a3, long a4, long a5, long a3, long a4, long a5,
struct pt_regs *regs) struct pt_regs *regs)
......
...@@ -77,7 +77,8 @@ int compat_printk(const char *fmt, ...) ...@@ -77,7 +77,8 @@ int compat_printk(const char *fmt, ...)
* Not all architectures have sys_utime, so implement this in terms * Not all architectures have sys_utime, so implement this in terms
* of sys_utimes. * of sys_utimes.
*/ */
asmlinkage long compat_sys_utime(char __user *filename, struct compat_utimbuf __user *t) asmlinkage long compat_sys_utime(const char __user *filename,
struct compat_utimbuf __user *t)
{ {
struct timespec tv[2]; struct timespec tv[2];
...@@ -91,7 +92,7 @@ asmlinkage long compat_sys_utime(char __user *filename, struct compat_utimbuf __ ...@@ -91,7 +92,7 @@ asmlinkage long compat_sys_utime(char __user *filename, struct compat_utimbuf __
return do_utimes(AT_FDCWD, filename, t ? tv : NULL, 0); return do_utimes(AT_FDCWD, filename, t ? tv : NULL, 0);
} }
asmlinkage long compat_sys_utimensat(unsigned int dfd, char __user *filename, struct compat_timespec __user *t, int flags) asmlinkage long compat_sys_utimensat(unsigned int dfd, const char __user *filename, struct compat_timespec __user *t, int flags)
{ {
struct timespec tv[2]; struct timespec tv[2];
...@@ -106,7 +107,7 @@ asmlinkage long compat_sys_utimensat(unsigned int dfd, char __user *filename, st ...@@ -106,7 +107,7 @@ asmlinkage long compat_sys_utimensat(unsigned int dfd, char __user *filename, st
return do_utimes(dfd, filename, t ? tv : NULL, flags); return do_utimes(dfd, filename, t ? tv : NULL, flags);
} }
asmlinkage long compat_sys_futimesat(unsigned int dfd, char __user *filename, struct compat_timeval __user *t) asmlinkage long compat_sys_futimesat(unsigned int dfd, const char __user *filename, struct compat_timeval __user *t)
{ {
struct timespec tv[2]; struct timespec tv[2];
...@@ -125,7 +126,7 @@ asmlinkage long compat_sys_futimesat(unsigned int dfd, char __user *filename, st ...@@ -125,7 +126,7 @@ asmlinkage long compat_sys_futimesat(unsigned int dfd, char __user *filename, st
return do_utimes(dfd, filename, t ? tv : NULL, 0); return do_utimes(dfd, filename, t ? tv : NULL, 0);
} }
asmlinkage long compat_sys_utimes(char __user *filename, struct compat_timeval __user *t) asmlinkage long compat_sys_utimes(const char __user *filename, struct compat_timeval __user *t)
{ {
return compat_sys_futimesat(AT_FDCWD, filename, t); return compat_sys_futimesat(AT_FDCWD, filename, t);
} }
...@@ -169,7 +170,7 @@ static int cp_compat_stat(struct kstat *stat, struct compat_stat __user *ubuf) ...@@ -169,7 +170,7 @@ static int cp_compat_stat(struct kstat *stat, struct compat_stat __user *ubuf)
return err; return err;
} }
asmlinkage long compat_sys_newstat(char __user * filename, asmlinkage long compat_sys_newstat(const char __user * filename,
struct compat_stat __user *statbuf) struct compat_stat __user *statbuf)
{ {
struct kstat stat; struct kstat stat;
...@@ -181,7 +182,7 @@ asmlinkage long compat_sys_newstat(char __user * filename, ...@@ -181,7 +182,7 @@ asmlinkage long compat_sys_newstat(char __user * filename,
return cp_compat_stat(&stat, statbuf); return cp_compat_stat(&stat, statbuf);
} }
asmlinkage long compat_sys_newlstat(char __user * filename, asmlinkage long compat_sys_newlstat(const char __user * filename,
struct compat_stat __user *statbuf) struct compat_stat __user *statbuf)
{ {
struct kstat stat; struct kstat stat;
...@@ -194,7 +195,8 @@ asmlinkage long compat_sys_newlstat(char __user * filename, ...@@ -194,7 +195,8 @@ asmlinkage long compat_sys_newlstat(char __user * filename,
} }
#ifndef __ARCH_WANT_STAT64 #ifndef __ARCH_WANT_STAT64
asmlinkage long compat_sys_newfstatat(unsigned int dfd, char __user *filename, asmlinkage long compat_sys_newfstatat(unsigned int dfd,
const char __user *filename,
struct compat_stat __user *statbuf, int flag) struct compat_stat __user *statbuf, int flag)
{ {
struct kstat stat; struct kstat stat;
...@@ -837,9 +839,10 @@ static int do_nfs4_super_data_conv(void *raw_data) ...@@ -837,9 +839,10 @@ static int do_nfs4_super_data_conv(void *raw_data)
#define NCPFS_NAME "ncpfs" #define NCPFS_NAME "ncpfs"
#define NFS4_NAME "nfs4" #define NFS4_NAME "nfs4"
asmlinkage long compat_sys_mount(char __user * dev_name, char __user * dir_name, asmlinkage long compat_sys_mount(const char __user * dev_name,
char __user * type, unsigned long flags, const char __user * dir_name,
void __user * data) const char __user * type, unsigned long flags,
const void __user * data)
{ {
char *kernel_type; char *kernel_type;
unsigned long data_page; unsigned long data_page;
......
...@@ -68,7 +68,8 @@ int vfs_fstat(unsigned int fd, struct kstat *stat) ...@@ -68,7 +68,8 @@ int vfs_fstat(unsigned int fd, struct kstat *stat)
} }
EXPORT_SYMBOL(vfs_fstat); EXPORT_SYMBOL(vfs_fstat);
int vfs_fstatat(int dfd, char __user *filename, struct kstat *stat, int flag) int vfs_fstatat(int dfd, const char __user *filename, struct kstat *stat,
int flag)
{ {
struct path path; struct path path;
int error = -EINVAL; int error = -EINVAL;
...@@ -91,13 +92,13 @@ int vfs_fstatat(int dfd, char __user *filename, struct kstat *stat, int flag) ...@@ -91,13 +92,13 @@ int vfs_fstatat(int dfd, char __user *filename, struct kstat *stat, int flag)
} }
EXPORT_SYMBOL(vfs_fstatat); EXPORT_SYMBOL(vfs_fstatat);
int vfs_stat(char __user *name, struct kstat *stat) int vfs_stat(const char __user *name, struct kstat *stat)
{ {
return vfs_fstatat(AT_FDCWD, name, stat, 0); return vfs_fstatat(AT_FDCWD, name, stat, 0);
} }
EXPORT_SYMBOL(vfs_stat); EXPORT_SYMBOL(vfs_stat);
int vfs_lstat(char __user *name, struct kstat *stat) int vfs_lstat(const char __user *name, struct kstat *stat)
{ {
return vfs_fstatat(AT_FDCWD, name, stat, AT_SYMLINK_NOFOLLOW); return vfs_fstatat(AT_FDCWD, name, stat, AT_SYMLINK_NOFOLLOW);
} }
...@@ -147,7 +148,8 @@ static int cp_old_stat(struct kstat *stat, struct __old_kernel_stat __user * sta ...@@ -147,7 +148,8 @@ static int cp_old_stat(struct kstat *stat, struct __old_kernel_stat __user * sta
return copy_to_user(statbuf,&tmp,sizeof(tmp)) ? -EFAULT : 0; return copy_to_user(statbuf,&tmp,sizeof(tmp)) ? -EFAULT : 0;
} }
SYSCALL_DEFINE2(stat, char __user *, filename, struct __old_kernel_stat __user *, statbuf) SYSCALL_DEFINE2(stat, const char __user *, filename,
struct __old_kernel_stat __user *, statbuf)
{ {
struct kstat stat; struct kstat stat;
int error; int error;
...@@ -159,7 +161,8 @@ SYSCALL_DEFINE2(stat, char __user *, filename, struct __old_kernel_stat __user * ...@@ -159,7 +161,8 @@ SYSCALL_DEFINE2(stat, char __user *, filename, struct __old_kernel_stat __user *
return cp_old_stat(&stat, statbuf); return cp_old_stat(&stat, statbuf);
} }
SYSCALL_DEFINE2(lstat, char __user *, filename, struct __old_kernel_stat __user *, statbuf) SYSCALL_DEFINE2(lstat, const char __user *, filename,
struct __old_kernel_stat __user *, statbuf)
{ {
struct kstat stat; struct kstat stat;
int error; int error;
...@@ -234,7 +237,8 @@ static int cp_new_stat(struct kstat *stat, struct stat __user *statbuf) ...@@ -234,7 +237,8 @@ static int cp_new_stat(struct kstat *stat, struct stat __user *statbuf)
return copy_to_user(statbuf,&tmp,sizeof(tmp)) ? -EFAULT : 0; return copy_to_user(statbuf,&tmp,sizeof(tmp)) ? -EFAULT : 0;
} }
SYSCALL_DEFINE2(newstat, char __user *, filename, struct stat __user *, statbuf) SYSCALL_DEFINE2(newstat, const char __user *, filename,
struct stat __user *, statbuf)
{ {
struct kstat stat; struct kstat stat;
int error = vfs_stat(filename, &stat); int error = vfs_stat(filename, &stat);
...@@ -244,7 +248,8 @@ SYSCALL_DEFINE2(newstat, char __user *, filename, struct stat __user *, statbuf) ...@@ -244,7 +248,8 @@ SYSCALL_DEFINE2(newstat, char __user *, filename, struct stat __user *, statbuf)
return cp_new_stat(&stat, statbuf); return cp_new_stat(&stat, statbuf);
} }
SYSCALL_DEFINE2(newlstat, char __user *, filename, struct stat __user *, statbuf) SYSCALL_DEFINE2(newlstat, const char __user *, filename,
struct stat __user *, statbuf)
{ {
struct kstat stat; struct kstat stat;
int error; int error;
...@@ -257,7 +262,7 @@ SYSCALL_DEFINE2(newlstat, char __user *, filename, struct stat __user *, statbuf ...@@ -257,7 +262,7 @@ SYSCALL_DEFINE2(newlstat, char __user *, filename, struct stat __user *, statbuf
} }
#if !defined(__ARCH_WANT_STAT64) || defined(__ARCH_WANT_SYS_NEWFSTATAT) #if !defined(__ARCH_WANT_STAT64) || defined(__ARCH_WANT_SYS_NEWFSTATAT)
SYSCALL_DEFINE4(newfstatat, int, dfd, char __user *, filename, SYSCALL_DEFINE4(newfstatat, int, dfd, const char __user *, filename,
struct stat __user *, statbuf, int, flag) struct stat __user *, statbuf, int, flag)
{ {
struct kstat stat; struct kstat stat;
...@@ -355,7 +360,8 @@ static long cp_new_stat64(struct kstat *stat, struct stat64 __user *statbuf) ...@@ -355,7 +360,8 @@ static long cp_new_stat64(struct kstat *stat, struct stat64 __user *statbuf)
return copy_to_user(statbuf,&tmp,sizeof(tmp)) ? -EFAULT : 0; return copy_to_user(statbuf,&tmp,sizeof(tmp)) ? -EFAULT : 0;
} }
SYSCALL_DEFINE2(stat64, char __user *, filename, struct stat64 __user *, statbuf) SYSCALL_DEFINE2(stat64, const char __user *, filename,
struct stat64 __user *, statbuf)
{ {
struct kstat stat; struct kstat stat;
int error = vfs_stat(filename, &stat); int error = vfs_stat(filename, &stat);
...@@ -366,7 +372,8 @@ SYSCALL_DEFINE2(stat64, char __user *, filename, struct stat64 __user *, statbuf ...@@ -366,7 +372,8 @@ SYSCALL_DEFINE2(stat64, char __user *, filename, struct stat64 __user *, statbuf
return error; return error;
} }
SYSCALL_DEFINE2(lstat64, char __user *, filename, struct stat64 __user *, statbuf) SYSCALL_DEFINE2(lstat64, const char __user *, filename,
struct stat64 __user *, statbuf)
{ {
struct kstat stat; struct kstat stat;
int error = vfs_lstat(filename, &stat); int error = vfs_lstat(filename, &stat);
...@@ -388,7 +395,7 @@ SYSCALL_DEFINE2(fstat64, unsigned long, fd, struct stat64 __user *, statbuf) ...@@ -388,7 +395,7 @@ SYSCALL_DEFINE2(fstat64, unsigned long, fd, struct stat64 __user *, statbuf)
return error; return error;
} }
SYSCALL_DEFINE4(fstatat64, int, dfd, char __user *, filename, SYSCALL_DEFINE4(fstatat64, int, dfd, const char __user *, filename,
struct stat64 __user *, statbuf, int, flag) struct stat64 __user *, statbuf, int, flag)
{ {
struct kstat stat; struct kstat stat;
......
...@@ -126,7 +126,8 @@ static int utimes_common(struct path *path, struct timespec *times) ...@@ -126,7 +126,8 @@ static int utimes_common(struct path *path, struct timespec *times)
* must be owner or have write permission. * must be owner or have write permission.
* Else, update from *times, must be owner or super user. * Else, update from *times, must be owner or super user.
*/ */
long do_utimes(int dfd, char __user *filename, struct timespec *times, int flags) long do_utimes(int dfd, const char __user *filename, struct timespec *times,
int flags)
{ {
int error = -EINVAL; int error = -EINVAL;
...@@ -170,7 +171,7 @@ long do_utimes(int dfd, char __user *filename, struct timespec *times, int flags ...@@ -170,7 +171,7 @@ long do_utimes(int dfd, char __user *filename, struct timespec *times, int flags
return error; return error;
} }
SYSCALL_DEFINE4(utimensat, int, dfd, char __user *, filename, SYSCALL_DEFINE4(utimensat, int, dfd, const char __user *, filename,
struct timespec __user *, utimes, int, flags) struct timespec __user *, utimes, int, flags)
{ {
struct timespec tstimes[2]; struct timespec tstimes[2];
...@@ -188,7 +189,7 @@ SYSCALL_DEFINE4(utimensat, int, dfd, char __user *, filename, ...@@ -188,7 +189,7 @@ SYSCALL_DEFINE4(utimensat, int, dfd, char __user *, filename,
return do_utimes(dfd, filename, utimes ? tstimes : NULL, flags); return do_utimes(dfd, filename, utimes ? tstimes : NULL, flags);
} }
SYSCALL_DEFINE3(futimesat, int, dfd, char __user *, filename, SYSCALL_DEFINE3(futimesat, int, dfd, const char __user *, filename,
struct timeval __user *, utimes) struct timeval __user *, utimes)
{ {
struct timeval times[2]; struct timeval times[2];
......
...@@ -331,7 +331,7 @@ asmlinkage long compat_sys_epoll_pwait(int epfd, ...@@ -331,7 +331,7 @@ asmlinkage long compat_sys_epoll_pwait(int epfd,
const compat_sigset_t __user *sigmask, const compat_sigset_t __user *sigmask,
compat_size_t sigsetsize); compat_size_t sigsetsize);
asmlinkage long compat_sys_utimensat(unsigned int dfd, char __user *filename, asmlinkage long compat_sys_utimensat(unsigned int dfd, const char __user *filename,
struct compat_timespec __user *t, int flags); struct compat_timespec __user *t, int flags);
asmlinkage long compat_sys_signalfd(int ufd, asmlinkage long compat_sys_signalfd(int ufd,
...@@ -348,9 +348,9 @@ asmlinkage long compat_sys_move_pages(pid_t pid, unsigned long nr_page, ...@@ -348,9 +348,9 @@ asmlinkage long compat_sys_move_pages(pid_t pid, unsigned long nr_page,
const int __user *nodes, const int __user *nodes,
int __user *status, int __user *status,
int flags); int flags);
asmlinkage long compat_sys_futimesat(unsigned int dfd, char __user *filename, asmlinkage long compat_sys_futimesat(unsigned int dfd, const char __user *filename,
struct compat_timeval __user *t); struct compat_timeval __user *t);
asmlinkage long compat_sys_newfstatat(unsigned int dfd, char __user * filename, asmlinkage long compat_sys_newfstatat(unsigned int dfd, const char __user * filename,
struct compat_stat __user *statbuf, struct compat_stat __user *statbuf,
int flag); int flag);
asmlinkage long compat_sys_openat(unsigned int dfd, const char __user *filename, asmlinkage long compat_sys_openat(unsigned int dfd, const char __user *filename,
......
...@@ -2320,10 +2320,10 @@ void inode_set_bytes(struct inode *inode, loff_t bytes); ...@@ -2320,10 +2320,10 @@ void inode_set_bytes(struct inode *inode, loff_t bytes);
extern int vfs_readdir(struct file *, filldir_t, void *); extern int vfs_readdir(struct file *, filldir_t, void *);
extern int vfs_stat(char __user *, struct kstat *); extern int vfs_stat(const char __user *, struct kstat *);
extern int vfs_lstat(char __user *, struct kstat *); extern int vfs_lstat(const char __user *, struct kstat *);
extern int vfs_fstat(unsigned int, struct kstat *); extern int vfs_fstat(unsigned int, struct kstat *);
extern int vfs_fstatat(int , char __user *, struct kstat *, int); extern int vfs_fstatat(int , const char __user *, struct kstat *, int);
extern int do_vfs_ioctl(struct file *filp, unsigned int fd, unsigned int cmd, extern int do_vfs_ioctl(struct file *filp, unsigned int fd, unsigned int cmd,
unsigned long arg); unsigned long arg);
......
...@@ -394,7 +394,7 @@ asmlinkage long sys_umount(char __user *name, int flags); ...@@ -394,7 +394,7 @@ asmlinkage long sys_umount(char __user *name, int flags);
asmlinkage long sys_oldumount(char __user *name); asmlinkage long sys_oldumount(char __user *name);
asmlinkage long sys_truncate(const char __user *path, long length); asmlinkage long sys_truncate(const char __user *path, long length);
asmlinkage long sys_ftruncate(unsigned int fd, unsigned long length); asmlinkage long sys_ftruncate(unsigned int fd, unsigned long length);
asmlinkage long sys_stat(char __user *filename, asmlinkage long sys_stat(const char __user *filename,
struct __old_kernel_stat __user *statbuf); struct __old_kernel_stat __user *statbuf);
asmlinkage long sys_statfs(const char __user * path, asmlinkage long sys_statfs(const char __user * path,
struct statfs __user *buf); struct statfs __user *buf);
...@@ -403,21 +403,21 @@ asmlinkage long sys_statfs64(const char __user *path, size_t sz, ...@@ -403,21 +403,21 @@ asmlinkage long sys_statfs64(const char __user *path, size_t sz,
asmlinkage long sys_fstatfs(unsigned int fd, struct statfs __user *buf); asmlinkage long sys_fstatfs(unsigned int fd, struct statfs __user *buf);
asmlinkage long sys_fstatfs64(unsigned int fd, size_t sz, asmlinkage long sys_fstatfs64(unsigned int fd, size_t sz,
struct statfs64 __user *buf); struct statfs64 __user *buf);
asmlinkage long sys_lstat(char __user *filename, asmlinkage long sys_lstat(const char __user *filename,
struct __old_kernel_stat __user *statbuf); struct __old_kernel_stat __user *statbuf);
asmlinkage long sys_fstat(unsigned int fd, asmlinkage long sys_fstat(unsigned int fd,
struct __old_kernel_stat __user *statbuf); struct __old_kernel_stat __user *statbuf);
asmlinkage long sys_newstat(char __user *filename, asmlinkage long sys_newstat(const char __user *filename,
struct stat __user *statbuf); struct stat __user *statbuf);
asmlinkage long sys_newlstat(char __user *filename, asmlinkage long sys_newlstat(const char __user *filename,
struct stat __user *statbuf); struct stat __user *statbuf);
asmlinkage long sys_newfstat(unsigned int fd, struct stat __user *statbuf); asmlinkage long sys_newfstat(unsigned int fd, struct stat __user *statbuf);
asmlinkage long sys_ustat(unsigned dev, struct ustat __user *ubuf); asmlinkage long sys_ustat(unsigned dev, struct ustat __user *ubuf);
#if BITS_PER_LONG == 32 #if BITS_PER_LONG == 32
asmlinkage long sys_stat64(char __user *filename, asmlinkage long sys_stat64(const char __user *filename,
struct stat64 __user *statbuf); struct stat64 __user *statbuf);
asmlinkage long sys_fstat64(unsigned long fd, struct stat64 __user *statbuf); asmlinkage long sys_fstat64(unsigned long fd, struct stat64 __user *statbuf);
asmlinkage long sys_lstat64(char __user *filename, asmlinkage long sys_lstat64(const char __user *filename,
struct stat64 __user *statbuf); struct stat64 __user *statbuf);
asmlinkage long sys_truncate64(const char __user *path, loff_t length); 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);
...@@ -760,7 +760,7 @@ asmlinkage long sys_linkat(int olddfd, const char __user *oldname, ...@@ -760,7 +760,7 @@ asmlinkage long sys_linkat(int olddfd, const char __user *oldname,
int newdfd, const char __user *newname, int flags); int newdfd, const char __user *newname, int flags);
asmlinkage long sys_renameat(int olddfd, const char __user * oldname, asmlinkage long sys_renameat(int olddfd, const char __user * oldname,
int newdfd, const char __user * newname); int newdfd, const char __user * newname);
asmlinkage long sys_futimesat(int dfd, char __user *filename, asmlinkage long sys_futimesat(int dfd, const char __user *filename,
struct timeval __user *utimes); struct timeval __user *utimes);
asmlinkage long sys_faccessat(int dfd, const char __user *filename, int mode); asmlinkage long sys_faccessat(int dfd, const char __user *filename, int mode);
asmlinkage long sys_fchmodat(int dfd, const char __user * filename, asmlinkage long sys_fchmodat(int dfd, const char __user * filename,
...@@ -769,13 +769,13 @@ asmlinkage long sys_fchownat(int dfd, const char __user *filename, uid_t user, ...@@ -769,13 +769,13 @@ asmlinkage long sys_fchownat(int dfd, const char __user *filename, uid_t user,
gid_t group, int flag); gid_t group, int flag);
asmlinkage long sys_openat(int dfd, const char __user *filename, int flags, asmlinkage long sys_openat(int dfd, const char __user *filename, int flags,
int mode); int mode);
asmlinkage long sys_newfstatat(int dfd, char __user *filename, asmlinkage long sys_newfstatat(int dfd, const char __user *filename,
struct stat __user *statbuf, int flag); struct stat __user *statbuf, int flag);
asmlinkage long sys_fstatat64(int dfd, char __user *filename, asmlinkage long sys_fstatat64(int dfd, const char __user *filename,
struct stat64 __user *statbuf, int flag); struct stat64 __user *statbuf, int flag);
asmlinkage long sys_readlinkat(int dfd, const char __user *path, char __user *buf, asmlinkage long sys_readlinkat(int dfd, const char __user *path, char __user *buf,
int bufsiz); int bufsiz);
asmlinkage long sys_utimensat(int dfd, char __user *filename, asmlinkage long sys_utimensat(int dfd, const char __user *filename,
struct timespec __user *utimes, int flags); struct timespec __user *utimes, int flags);
asmlinkage long sys_unshare(unsigned long unshare_flags); asmlinkage long sys_unshare(unsigned long unshare_flags);
......
...@@ -150,7 +150,7 @@ extern void do_gettimeofday(struct timeval *tv); ...@@ -150,7 +150,7 @@ extern void do_gettimeofday(struct timeval *tv);
extern int do_settimeofday(struct timespec *tv); extern int do_settimeofday(struct timespec *tv);
extern int do_sys_settimeofday(struct timespec *tv, struct timezone *tz); extern int do_sys_settimeofday(struct timespec *tv, struct timezone *tz);
#define do_posix_clock_monotonic_gettime(ts) ktime_get_ts(ts) #define do_posix_clock_monotonic_gettime(ts) ktime_get_ts(ts)
extern long do_utimes(int dfd, char __user *filename, struct timespec *times, int flags); extern long do_utimes(int dfd, const char __user *filename, struct timespec *times, int flags);
struct itimerval; struct itimerval;
extern int do_setitimer(int which, struct itimerval *value, extern int do_setitimer(int which, struct itimerval *value,
struct itimerval *ovalue); struct itimerval *ovalue);
......
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