aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2010-08-11 06:26:22 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-08-13 19:53:13 -0400
commitc7887325230aec47d47a32562a6e26014a0fafca (patch)
tree10535943dace59ddb01d3440aa582bc4640e8016
parentb84ae4a1401a731ef5fee987c0cb08743838dda7 (diff)
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: David Howells <dhowells@redhat.com> Acked-by: David S. Miller <davem@davemloft.net> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--arch/alpha/kernel/osf_sys.c6
-rw-r--r--arch/alpha/kernel/process.c2
-rw-r--r--arch/arm/kernel/sys_arm.c4
-rw-r--r--arch/arm/kernel/sys_oabi-compat.c6
-rw-r--r--arch/avr32/include/asm/syscalls.h2
-rw-r--r--arch/avr32/kernel/process.c3
-rw-r--r--arch/blackfin/kernel/process.c2
-rw-r--r--arch/frv/kernel/process.c3
-rw-r--r--arch/h8300/kernel/process.c2
-rw-r--r--arch/ia64/include/asm/unistd.h2
-rw-r--r--arch/ia64/kernel/process.c2
-rw-r--r--arch/m32r/kernel/process.c3
-rw-r--r--arch/m68k/kernel/process.c2
-rw-r--r--arch/m68knommu/kernel/process.c2
-rw-r--r--arch/microblaze/kernel/sys_microblaze.c2
-rw-r--r--arch/mips/kernel/syscall.c2
-rw-r--r--arch/mn10300/kernel/process.c2
-rw-r--r--arch/parisc/hpux/fs.c7
-rw-r--r--arch/powerpc/kernel/process.c2
-rw-r--r--arch/powerpc/kernel/sys_ppc32.c2
-rw-r--r--arch/s390/kernel/compat_linux.c10
-rw-r--r--arch/s390/kernel/compat_linux.h10
-rw-r--r--arch/s390/kernel/entry.h2
-rw-r--r--arch/s390/kernel/process.c2
-rw-r--r--arch/sh/include/asm/syscalls_32.h2
-rw-r--r--arch/sh/include/asm/syscalls_64.h2
-rw-r--r--arch/sh/kernel/process_64.c2
-rw-r--r--arch/sparc/kernel/sys_sparc32.c7
-rw-r--r--arch/um/kernel/exec.c6
-rw-r--r--arch/um/kernel/internal.h2
-rw-r--r--arch/um/kernel/syscall.c2
-rw-r--r--arch/x86/ia32/sys_ia32.c14
-rw-r--r--arch/x86/include/asm/sys_ia32.h12
-rw-r--r--arch/x86/include/asm/syscalls.h2
-rw-r--r--arch/x86/kernel/entry_64.S4
-rw-r--r--arch/x86/kernel/process.c2
-rw-r--r--arch/xtensa/kernel/process.c2
-rw-r--r--fs/compat.c23
-rw-r--r--fs/stat.c29
-rw-r--r--fs/utimes.c7
-rw-r--r--include/linux/compat.h6
-rw-r--r--include/linux/fs.h6
-rw-r--r--include/linux/syscalls.h20
-rw-r--r--include/linux/time.h2
44 files changed, 125 insertions, 109 deletions
diff --git a/arch/alpha/kernel/osf_sys.c b/arch/alpha/kernel/osf_sys.c
index 88131c6e42e3..fb58150a7e8f 100644
--- a/arch/alpha/kernel/osf_sys.c
+++ b/arch/alpha/kernel/osf_sys.c
@@ -244,7 +244,7 @@ do_osf_statfs(struct path *path, struct osf_statfs __user *buffer,
244 return error; 244 return error;
245} 245}
246 246
247SYSCALL_DEFINE3(osf_statfs, char __user *, pathname, 247SYSCALL_DEFINE3(osf_statfs, const char __user *, pathname,
248 struct osf_statfs __user *, buffer, unsigned long, bufsiz) 248 struct osf_statfs __user *, buffer, unsigned long, bufsiz)
249{ 249{
250 struct path path; 250 struct path path;
@@ -358,7 +358,7 @@ osf_procfs_mount(char *dirname, struct procfs_args __user *args, int flags)
358 return do_mount("", dirname, "proc", flags, NULL); 358 return do_mount("", dirname, "proc", flags, NULL);
359} 359}
360 360
361SYSCALL_DEFINE4(osf_mount, unsigned long, typenr, char __user *, path, 361SYSCALL_DEFINE4(osf_mount, unsigned long, typenr, const char __user *, path,
362 int, flag, void __user *, data) 362 int, flag, void __user *, data)
363{ 363{
364 int retval; 364 int retval;
@@ -932,7 +932,7 @@ SYSCALL_DEFINE3(osf_setitimer, int, which, struct itimerval32 __user *, in,
932 932
933} 933}
934 934
935SYSCALL_DEFINE2(osf_utimes, char __user *, filename, 935SYSCALL_DEFINE2(osf_utimes, const char __user *, filename,
936 struct timeval32 __user *, tvs) 936 struct timeval32 __user *, tvs)
937{ 937{
938 struct timespec tv[2]; 938 struct timespec tv[2];
diff --git a/arch/alpha/kernel/process.c b/arch/alpha/kernel/process.c
index 395a464353b8..88e608aebc8c 100644
--- a/arch/alpha/kernel/process.c
+++ b/arch/alpha/kernel/process.c
@@ -387,7 +387,7 @@ EXPORT_SYMBOL(dump_elf_task_fp);
387 * sys_execve() executes a new program. 387 * sys_execve() executes a new program.
388 */ 388 */
389asmlinkage int 389asmlinkage int
390do_sys_execve(char __user *ufilename, char __user * __user *argv, 390do_sys_execve(const char __user *ufilename, char __user * __user *argv,
391 char __user * __user *envp, struct pt_regs *regs) 391 char __user * __user *envp, struct pt_regs *regs)
392{ 392{
393 int error; 393 int error;
diff --git a/arch/arm/kernel/sys_arm.c b/arch/arm/kernel/sys_arm.c
index c23501842b98..5b7c541a4c63 100644
--- a/arch/arm/kernel/sys_arm.c
+++ b/arch/arm/kernel/sys_arm.c
@@ -62,7 +62,7 @@ asmlinkage int sys_vfork(struct pt_regs *regs)
62/* sys_execve() executes a new program. 62/* sys_execve() executes a new program.
63 * This is called indirectly via a small wrapper 63 * This is called indirectly via a small wrapper
64 */ 64 */
65asmlinkage int sys_execve(char __user *filenamei, char __user * __user *argv, 65asmlinkage int sys_execve(const char __user *filenamei, char __user * __user *argv,
66 char __user * __user *envp, struct pt_regs *regs) 66 char __user * __user *envp, struct pt_regs *regs)
67{ 67{
68 int error; 68 int error;
@@ -84,7 +84,7 @@ int kernel_execve(const char *filename, char *const argv[], char *const envp[])
84 int ret; 84 int ret;
85 85
86 memset(&regs, 0, sizeof(struct pt_regs)); 86 memset(&regs, 0, sizeof(struct pt_regs));
87 ret = do_execve((char *)filename, (char __user * __user *)argv, 87 ret = do_execve(filename, (char __user * __user *)argv,
88 (char __user * __user *)envp, &regs); 88 (char __user * __user *)envp, &regs);
89 if (ret < 0) 89 if (ret < 0)
90 goto out; 90 goto out;
diff --git a/arch/arm/kernel/sys_oabi-compat.c b/arch/arm/kernel/sys_oabi-compat.c
index 33ff678e32f2..4ad8da15ef2b 100644
--- a/arch/arm/kernel/sys_oabi-compat.c
+++ b/arch/arm/kernel/sys_oabi-compat.c
@@ -141,7 +141,7 @@ static long cp_oldabi_stat64(struct kstat *stat,
141 return copy_to_user(statbuf,&tmp,sizeof(tmp)) ? -EFAULT : 0; 141 return copy_to_user(statbuf,&tmp,sizeof(tmp)) ? -EFAULT : 0;
142} 142}
143 143
144asmlinkage long sys_oabi_stat64(char __user * filename, 144asmlinkage long sys_oabi_stat64(const char __user * filename,
145 struct oldabi_stat64 __user * statbuf) 145 struct oldabi_stat64 __user * statbuf)
146{ 146{
147 struct kstat stat; 147 struct kstat stat;
@@ -151,7 +151,7 @@ asmlinkage long sys_oabi_stat64(char __user * filename,
151 return error; 151 return error;
152} 152}
153 153
154asmlinkage long sys_oabi_lstat64(char __user * filename, 154asmlinkage long sys_oabi_lstat64(const char __user * filename,
155 struct oldabi_stat64 __user * statbuf) 155 struct oldabi_stat64 __user * statbuf)
156{ 156{
157 struct kstat stat; 157 struct kstat stat;
@@ -172,7 +172,7 @@ asmlinkage long sys_oabi_fstat64(unsigned long fd,
172} 172}
173 173
174asmlinkage long sys_oabi_fstatat64(int dfd, 174asmlinkage long sys_oabi_fstatat64(int dfd,
175 char __user *filename, 175 const char __user *filename,
176 struct oldabi_stat64 __user *statbuf, 176 struct oldabi_stat64 __user *statbuf,
177 int flag) 177 int flag)
178{ 178{
diff --git a/arch/avr32/include/asm/syscalls.h b/arch/avr32/include/asm/syscalls.h
index 66a197266637..ab608b70b24d 100644
--- a/arch/avr32/include/asm/syscalls.h
+++ b/arch/avr32/include/asm/syscalls.h
@@ -21,7 +21,7 @@ asmlinkage int sys_clone(unsigned long, unsigned long,
21 unsigned long, unsigned long, 21 unsigned long, unsigned long,
22 struct pt_regs *); 22 struct pt_regs *);
23asmlinkage int sys_vfork(struct pt_regs *); 23asmlinkage int sys_vfork(struct pt_regs *);
24asmlinkage int sys_execve(char __user *, char __user *__user *, 24asmlinkage int sys_execve(const char __user *, char __user *__user *,
25 char __user *__user *, struct pt_regs *); 25 char __user *__user *, struct pt_regs *);
26 26
27/* kernel/signal.c */ 27/* kernel/signal.c */
diff --git a/arch/avr32/kernel/process.c b/arch/avr32/kernel/process.c
index 2d76515745a4..e5daddff397d 100644
--- a/arch/avr32/kernel/process.c
+++ b/arch/avr32/kernel/process.c
@@ -383,7 +383,8 @@ asmlinkage int sys_vfork(struct pt_regs *regs)
383 0, NULL, NULL); 383 0, NULL, NULL);
384} 384}
385 385
386asmlinkage int sys_execve(char __user *ufilename, char __user *__user *uargv, 386asmlinkage int sys_execve(const char __user *ufilename,
387 char __user *__user *uargv,
387 char __user *__user *uenvp, struct pt_regs *regs) 388 char __user *__user *uenvp, struct pt_regs *regs)
388{ 389{
389 int error; 390 int error;
diff --git a/arch/blackfin/kernel/process.c b/arch/blackfin/kernel/process.c
index 93ec07da2e51..a566f61c002a 100644
--- a/arch/blackfin/kernel/process.c
+++ b/arch/blackfin/kernel/process.c
@@ -209,7 +209,7 @@ copy_thread(unsigned long clone_flags,
209/* 209/*
210 * sys_execve() executes a new program. 210 * sys_execve() executes a new program.
211 */ 211 */
212asmlinkage int sys_execve(char __user *name, char __user * __user *argv, char __user * __user *envp) 212asmlinkage int sys_execve(const char __user *name, char __user * __user *argv, char __user * __user *envp)
213{ 213{
214 int error; 214 int error;
215 char *filename; 215 char *filename;
diff --git a/arch/frv/kernel/process.c b/arch/frv/kernel/process.c
index 21d0fd19276d..428931cf2f0c 100644
--- a/arch/frv/kernel/process.c
+++ b/arch/frv/kernel/process.c
@@ -250,7 +250,8 @@ int copy_thread(unsigned long clone_flags,
250/* 250/*
251 * sys_execve() executes a new program. 251 * sys_execve() executes a new program.
252 */ 252 */
253asmlinkage int sys_execve(char __user *name, char __user * __user *argv, char __user * __user *envp) 253asmlinkage int sys_execve(const char __user *name, char __user * __user *argv,
254 char __user * __user *envp)
254{ 255{
255 int error; 256 int error;
256 char * filename; 257 char * filename;
diff --git a/arch/h8300/kernel/process.c b/arch/h8300/kernel/process.c
index 8c8b0ffa6ad7..8b7b78d77d5c 100644
--- a/arch/h8300/kernel/process.c
+++ b/arch/h8300/kernel/process.c
@@ -212,7 +212,7 @@ int copy_thread(unsigned long clone_flags,
212/* 212/*
213 * sys_execve() executes a new program. 213 * sys_execve() executes a new program.
214 */ 214 */
215asmlinkage int sys_execve(char *name, char **argv, char **envp,int dummy,...) 215asmlinkage int sys_execve(const char *name, char **argv, char **envp,int dummy,...)
216{ 216{
217 int error; 217 int error;
218 char * filename; 218 char * filename;
diff --git a/arch/ia64/include/asm/unistd.h b/arch/ia64/include/asm/unistd.h
index bb8b0fff32b3..46f36fc5125f 100644
--- a/arch/ia64/include/asm/unistd.h
+++ b/arch/ia64/include/asm/unistd.h
@@ -353,7 +353,7 @@ asmlinkage unsigned long sys_mmap2(
353 int fd, long pgoff); 353 int fd, long pgoff);
354struct pt_regs; 354struct pt_regs;
355struct sigaction; 355struct sigaction;
356long sys_execve(char __user *filename, char __user * __user *argv, 356long sys_execve(const char __user *filename, char __user * __user *argv,
357 char __user * __user *envp, struct pt_regs *regs); 357 char __user * __user *envp, struct pt_regs *regs);
358asmlinkage long sys_ia64_pipe(void); 358asmlinkage long sys_ia64_pipe(void);
359asmlinkage long sys_rt_sigaction(int sig, 359asmlinkage long sys_rt_sigaction(int sig,
diff --git a/arch/ia64/kernel/process.c b/arch/ia64/kernel/process.c
index 53f1648c8b81..a879c03b7f1c 100644
--- a/arch/ia64/kernel/process.c
+++ b/arch/ia64/kernel/process.c
@@ -633,7 +633,7 @@ dump_fpu (struct pt_regs *pt, elf_fpregset_t dst)
633} 633}
634 634
635long 635long
636sys_execve (char __user *filename, char __user * __user *argv, char __user * __user *envp, 636sys_execve (const char __user *filename, char __user * __user *argv, char __user * __user *envp,
637 struct pt_regs *regs) 637 struct pt_regs *regs)
638{ 638{
639 char *fname; 639 char *fname;
diff --git a/arch/m32r/kernel/process.c b/arch/m32r/kernel/process.c
index bc8c8c1511b2..8665a4d868ec 100644
--- a/arch/m32r/kernel/process.c
+++ b/arch/m32r/kernel/process.c
@@ -288,7 +288,8 @@ asmlinkage int sys_vfork(unsigned long r0, unsigned long r1, unsigned long r2,
288/* 288/*
289 * sys_execve() executes a new program. 289 * sys_execve() executes a new program.
290 */ 290 */
291asmlinkage int sys_execve(char __user *ufilename, char __user * __user *uargv, 291asmlinkage int sys_execve(const char __user *ufilename,
292 char __user * __user *uargv,
292 char __user * __user *uenvp, 293 char __user * __user *uenvp,
293 unsigned long r3, unsigned long r4, unsigned long r5, 294 unsigned long r3, unsigned long r4, unsigned long r5,
294 unsigned long r6, struct pt_regs regs) 295 unsigned long r6, struct pt_regs regs)
diff --git a/arch/m68k/kernel/process.c b/arch/m68k/kernel/process.c
index 1a6be27cf165..221d0b71ce39 100644
--- a/arch/m68k/kernel/process.c
+++ b/arch/m68k/kernel/process.c
@@ -315,7 +315,7 @@ EXPORT_SYMBOL(dump_fpu);
315/* 315/*
316 * sys_execve() executes a new program. 316 * sys_execve() executes a new program.
317 */ 317 */
318asmlinkage int sys_execve(char __user *name, char __user * __user *argv, char __user * __user *envp) 318asmlinkage int sys_execve(const char __user *name, char __user * __user *argv, char __user * __user *envp)
319{ 319{
320 int error; 320 int error;
321 char * filename; 321 char * filename;
diff --git a/arch/m68knommu/kernel/process.c b/arch/m68knommu/kernel/process.c
index 6aa66134b433..6350f68cd026 100644
--- a/arch/m68knommu/kernel/process.c
+++ b/arch/m68knommu/kernel/process.c
@@ -350,7 +350,7 @@ void dump(struct pt_regs *fp)
350/* 350/*
351 * sys_execve() executes a new program. 351 * sys_execve() executes a new program.
352 */ 352 */
353asmlinkage int sys_execve(char *name, char **argv, char **envp) 353asmlinkage int sys_execve(const char *name, char **argv, char **envp)
354{ 354{
355 int error; 355 int error;
356 char * filename; 356 char * filename;
diff --git a/arch/microblaze/kernel/sys_microblaze.c b/arch/microblaze/kernel/sys_microblaze.c
index f4e00b7f1259..6abab6ebedbe 100644
--- a/arch/microblaze/kernel/sys_microblaze.c
+++ b/arch/microblaze/kernel/sys_microblaze.c
@@ -47,7 +47,7 @@ asmlinkage long microblaze_clone(int flags, unsigned long stack, struct pt_regs
47 return do_fork(flags, stack, regs, 0, NULL, NULL); 47 return do_fork(flags, stack, regs, 0, NULL, NULL);
48} 48}
49 49
50asmlinkage long microblaze_execve(char __user *filenamei, char __user *__user *argv, 50asmlinkage long microblaze_execve(const char __user *filenamei, char __user *__user *argv,
51 char __user *__user *envp, struct pt_regs *regs) 51 char __user *__user *envp, struct pt_regs *regs)
52{ 52{
53 int error; 53 int error;
diff --git a/arch/mips/kernel/syscall.c b/arch/mips/kernel/syscall.c
index 58bab2ef257f..bddce0bca195 100644
--- a/arch/mips/kernel/syscall.c
+++ b/arch/mips/kernel/syscall.c
@@ -254,7 +254,7 @@ asmlinkage int sys_execve(nabi_no_regargs struct pt_regs regs)
254 int error; 254 int error;
255 char * filename; 255 char * filename;
256 256
257 filename = getname((char __user *) (long)regs.regs[4]); 257 filename = getname((const char __user *) (long)regs.regs[4]);
258 error = PTR_ERR(filename); 258 error = PTR_ERR(filename);
259 if (IS_ERR(filename)) 259 if (IS_ERR(filename))
260 goto out; 260 goto out;
diff --git a/arch/mn10300/kernel/process.c b/arch/mn10300/kernel/process.c
index 82b817c7f7b6..762eb325b949 100644
--- a/arch/mn10300/kernel/process.c
+++ b/arch/mn10300/kernel/process.c
@@ -268,7 +268,7 @@ asmlinkage long sys_vfork(void)
268 0, NULL, NULL); 268 0, NULL, NULL);
269} 269}
270 270
271asmlinkage long sys_execve(char __user *name, 271asmlinkage long sys_execve(const char __user *name,
272 char __user * __user *argv, 272 char __user * __user *argv,
273 char __user * __user *envp) 273 char __user * __user *envp)
274{ 274{
diff --git a/arch/parisc/hpux/fs.c b/arch/parisc/hpux/fs.c
index 6935123178eb..1444875a7611 100644
--- a/arch/parisc/hpux/fs.c
+++ b/arch/parisc/hpux/fs.c
@@ -36,7 +36,7 @@ int hpux_execve(struct pt_regs *regs)
36 int error; 36 int error;
37 char *filename; 37 char *filename;
38 38
39 filename = getname((char __user *) regs->gr[26]); 39 filename = getname((const char __user *) regs->gr[26]);
40 error = PTR_ERR(filename); 40 error = PTR_ERR(filename);
41 if (IS_ERR(filename)) 41 if (IS_ERR(filename))
42 goto out; 42 goto out;
@@ -169,7 +169,7 @@ static int cp_hpux_stat(struct kstat *stat, struct hpux_stat64 __user *statbuf)
169 return copy_to_user(statbuf,&tmp,sizeof(tmp)) ? -EFAULT : 0; 169 return copy_to_user(statbuf,&tmp,sizeof(tmp)) ? -EFAULT : 0;
170} 170}
171 171
172long hpux_stat64(char __user *filename, struct hpux_stat64 __user *statbuf) 172long hpux_stat64(const char __user *filename, struct hpux_stat64 __user *statbuf)
173{ 173{
174 struct kstat stat; 174 struct kstat stat;
175 int error = vfs_stat(filename, &stat); 175 int error = vfs_stat(filename, &stat);
@@ -191,7 +191,8 @@ long hpux_fstat64(unsigned int fd, struct hpux_stat64 __user *statbuf)
191 return error; 191 return error;
192} 192}
193 193
194long hpux_lstat64(char __user *filename, struct hpux_stat64 __user *statbuf) 194long hpux_lstat64(const char __user *filename,
195 struct hpux_stat64 __user *statbuf)
195{ 196{
196 struct kstat stat; 197 struct kstat stat;
197 int error = vfs_lstat(filename, &stat); 198 int error = vfs_lstat(filename, &stat);
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index e78a5add7f15..feacfb789686 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -1027,7 +1027,7 @@ int sys_execve(unsigned long a0, unsigned long a1, unsigned long a2,
1027 int error; 1027 int error;
1028 char *filename; 1028 char *filename;
1029 1029
1030 filename = getname((char __user *) a0); 1030 filename = getname((const char __user *) a0);
1031 error = PTR_ERR(filename); 1031 error = PTR_ERR(filename);
1032 if (IS_ERR(filename)) 1032 if (IS_ERR(filename))
1033 goto out; 1033 goto out;
diff --git a/arch/powerpc/kernel/sys_ppc32.c b/arch/powerpc/kernel/sys_ppc32.c
index 19471a1cef1a..20fd701a686a 100644
--- a/arch/powerpc/kernel/sys_ppc32.c
+++ b/arch/powerpc/kernel/sys_ppc32.c
@@ -546,7 +546,7 @@ compat_ssize_t compat_sys_pread64(unsigned int fd, char __user *ubuf, compat_siz
546 return sys_pread64(fd, ubuf, count, ((loff_t)poshi << 32) | poslo); 546 return sys_pread64(fd, ubuf, count, ((loff_t)poshi << 32) | poslo);
547} 547}
548 548
549compat_ssize_t compat_sys_pwrite64(unsigned int fd, char __user *ubuf, compat_size_t count, 549compat_ssize_t compat_sys_pwrite64(unsigned int fd, const char __user *ubuf, compat_size_t count,
550 u32 reg6, u32 poshi, u32 poslo) 550 u32 reg6, u32 poshi, u32 poslo)
551{ 551{
552 return sys_pwrite64(fd, ubuf, count, ((loff_t)poshi << 32) | poslo); 552 return sys_pwrite64(fd, ubuf, count, ((loff_t)poshi << 32) | poslo);
diff --git a/arch/s390/kernel/compat_linux.c b/arch/s390/kernel/compat_linux.c
index 73b624ed9cd8..1e6449c79ab6 100644
--- a/arch/s390/kernel/compat_linux.c
+++ b/arch/s390/kernel/compat_linux.c
@@ -436,7 +436,7 @@ sys32_rt_sigqueueinfo(int pid, int sig, compat_siginfo_t __user *uinfo)
436 * sys32_execve() executes a new program after the asm stub has set 436 * sys32_execve() executes a new program after the asm stub has set
437 * things up for us. This should basically do what I want it to. 437 * things up for us. This should basically do what I want it to.
438 */ 438 */
439asmlinkage long sys32_execve(char __user *name, compat_uptr_t __user *argv, 439asmlinkage long sys32_execve(const char __user *name, compat_uptr_t __user *argv,
440 compat_uptr_t __user *envp) 440 compat_uptr_t __user *envp)
441{ 441{
442 struct pt_regs *regs = task_pt_regs(current); 442 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 return copy_to_user(ubuf,&tmp,sizeof(tmp)) ? -EFAULT : 0; 570 return copy_to_user(ubuf,&tmp,sizeof(tmp)) ? -EFAULT : 0;
571} 571}
572 572
573asmlinkage long sys32_stat64(char __user * filename, struct stat64_emu31 __user * statbuf) 573asmlinkage long sys32_stat64(const char __user * filename, struct stat64_emu31 __user * statbuf)
574{ 574{
575 struct kstat stat; 575 struct kstat stat;
576 int ret = vfs_stat(filename, &stat); 576 int ret = vfs_stat(filename, &stat);
@@ -579,7 +579,7 @@ asmlinkage long sys32_stat64(char __user * filename, struct stat64_emu31 __user
579 return ret; 579 return ret;
580} 580}
581 581
582asmlinkage long sys32_lstat64(char __user * filename, struct stat64_emu31 __user * statbuf) 582asmlinkage long sys32_lstat64(const char __user * filename, struct stat64_emu31 __user * statbuf)
583{ 583{
584 struct kstat stat; 584 struct kstat stat;
585 int ret = vfs_lstat(filename, &stat); 585 int ret = vfs_lstat(filename, &stat);
@@ -597,7 +597,7 @@ asmlinkage long sys32_fstat64(unsigned long fd, struct stat64_emu31 __user * sta
597 return ret; 597 return ret;
598} 598}
599 599
600asmlinkage long sys32_fstatat64(unsigned int dfd, char __user *filename, 600asmlinkage long sys32_fstatat64(unsigned int dfd, const char __user *filename,
601 struct stat64_emu31 __user* statbuf, int flag) 601 struct stat64_emu31 __user* statbuf, int flag)
602{ 602{
603 struct kstat stat; 603 struct kstat stat;
@@ -655,7 +655,7 @@ asmlinkage long sys32_read(unsigned int fd, char __user * buf, size_t count)
655 return sys_read(fd, buf, count); 655 return sys_read(fd, buf, count);
656} 656}
657 657
658asmlinkage long sys32_write(unsigned int fd, char __user * buf, size_t count) 658asmlinkage long sys32_write(unsigned int fd, const char __user * buf, size_t count)
659{ 659{
660 if ((compat_ssize_t) count < 0) 660 if ((compat_ssize_t) count < 0)
661 return -EINVAL; 661 return -EINVAL;
diff --git a/arch/s390/kernel/compat_linux.h b/arch/s390/kernel/compat_linux.h
index cb97afc85c94..9635d759c2b9 100644
--- a/arch/s390/kernel/compat_linux.h
+++ b/arch/s390/kernel/compat_linux.h
@@ -193,7 +193,7 @@ long sys32_rt_sigprocmask(int how, compat_sigset_t __user *set,
193 compat_sigset_t __user *oset, size_t sigsetsize); 193 compat_sigset_t __user *oset, size_t sigsetsize);
194long sys32_rt_sigpending(compat_sigset_t __user *set, size_t sigsetsize); 194long sys32_rt_sigpending(compat_sigset_t __user *set, size_t sigsetsize);
195long sys32_rt_sigqueueinfo(int pid, int sig, compat_siginfo_t __user *uinfo); 195long sys32_rt_sigqueueinfo(int pid, int sig, compat_siginfo_t __user *uinfo);
196long sys32_execve(char __user *name, compat_uptr_t __user *argv, 196long sys32_execve(const char __user *name, compat_uptr_t __user *argv,
197 compat_uptr_t __user *envp); 197 compat_uptr_t __user *envp);
198long sys32_init_module(void __user *umod, unsigned long len, 198long sys32_init_module(void __user *umod, unsigned long len,
199 const char __user *uargs); 199 const char __user *uargs);
@@ -207,16 +207,16 @@ long sys32_sendfile(int out_fd, int in_fd, compat_off_t __user *offset,
207 size_t count); 207 size_t count);
208long sys32_sendfile64(int out_fd, int in_fd, compat_loff_t __user *offset, 208long sys32_sendfile64(int out_fd, int in_fd, compat_loff_t __user *offset,
209 s32 count); 209 s32 count);
210long sys32_stat64(char __user * filename, struct stat64_emu31 __user * statbuf); 210long sys32_stat64(const char __user * filename, struct stat64_emu31 __user * statbuf);
211long sys32_lstat64(char __user * filename, 211long sys32_lstat64(const char __user * filename,
212 struct stat64_emu31 __user * statbuf); 212 struct stat64_emu31 __user * statbuf);
213long sys32_fstat64(unsigned long fd, struct stat64_emu31 __user * statbuf); 213long sys32_fstat64(unsigned long fd, struct stat64_emu31 __user * statbuf);
214long sys32_fstatat64(unsigned int dfd, char __user *filename, 214long sys32_fstatat64(unsigned int dfd, const char __user *filename,
215 struct stat64_emu31 __user* statbuf, int flag); 215 struct stat64_emu31 __user* statbuf, int flag);
216unsigned long old32_mmap(struct mmap_arg_struct_emu31 __user *arg); 216unsigned long old32_mmap(struct mmap_arg_struct_emu31 __user *arg);
217long sys32_mmap2(struct mmap_arg_struct_emu31 __user *arg); 217long sys32_mmap2(struct mmap_arg_struct_emu31 __user *arg);
218long sys32_read(unsigned int fd, char __user * buf, size_t count); 218long sys32_read(unsigned int fd, char __user * buf, size_t count);
219long sys32_write(unsigned int fd, char __user * buf, size_t count); 219long sys32_write(unsigned int fd, const char __user * buf, size_t count);
220long sys32_fadvise64(int fd, loff_t offset, size_t len, int advise); 220long sys32_fadvise64(int fd, loff_t offset, size_t len, int advise);
221long sys32_fadvise64_64(struct fadvise64_64_args __user *args); 221long sys32_fadvise64_64(struct fadvise64_64_args __user *args);
222long sys32_sigaction(int sig, const struct old_sigaction32 __user *act, 222long sys32_sigaction(int sig, const struct old_sigaction32 __user *act,
diff --git a/arch/s390/kernel/entry.h b/arch/s390/kernel/entry.h
index 5bb1e6b5db26..403fb430a896 100644
--- a/arch/s390/kernel/entry.h
+++ b/arch/s390/kernel/entry.h
@@ -42,7 +42,7 @@ long sys_clone(unsigned long newsp, unsigned long clone_flags,
42 int __user *parent_tidptr, int __user *child_tidptr); 42 int __user *parent_tidptr, int __user *child_tidptr);
43long sys_vfork(void); 43long sys_vfork(void);
44void execve_tail(void); 44void execve_tail(void);
45long sys_execve(char __user *name, char __user * __user *argv, 45long sys_execve(const char __user *name, char __user * __user *argv,
46 char __user * __user *envp); 46 char __user * __user *envp);
47long sys_sigsuspend(int history0, int history1, old_sigset_t mask); 47long sys_sigsuspend(int history0, int history1, old_sigset_t mask);
48long sys_sigaction(int sig, const struct old_sigaction __user *act, 48long sys_sigaction(int sig, const struct old_sigaction __user *act,
diff --git a/arch/s390/kernel/process.c b/arch/s390/kernel/process.c
index 1039fdea15b5..7eafaf2662b9 100644
--- a/arch/s390/kernel/process.c
+++ b/arch/s390/kernel/process.c
@@ -267,7 +267,7 @@ asmlinkage void execve_tail(void)
267/* 267/*
268 * sys_execve() executes a new program. 268 * sys_execve() executes a new program.
269 */ 269 */
270SYSCALL_DEFINE3(execve, char __user *, name, char __user * __user *, argv, 270SYSCALL_DEFINE3(execve, const char __user *, name, char __user * __user *, argv,
271 char __user * __user *, envp) 271 char __user * __user *, envp)
272{ 272{
273 struct pt_regs *regs = task_pt_regs(current); 273 struct pt_regs *regs = task_pt_regs(current);
diff --git a/arch/sh/include/asm/syscalls_32.h b/arch/sh/include/asm/syscalls_32.h
index 8b30200305c3..be201fdc97aa 100644
--- a/arch/sh/include/asm/syscalls_32.h
+++ b/arch/sh/include/asm/syscalls_32.h
@@ -19,7 +19,7 @@ asmlinkage int sys_clone(unsigned long clone_flags, unsigned long newsp,
19asmlinkage int sys_vfork(unsigned long r4, unsigned long r5, 19asmlinkage int sys_vfork(unsigned long r4, unsigned long r5,
20 unsigned long r6, unsigned long r7, 20 unsigned long r6, unsigned long r7,
21 struct pt_regs __regs); 21 struct pt_regs __regs);
22asmlinkage int sys_execve(char __user *ufilename, char __user * __user *uargv, 22asmlinkage int sys_execve(const char __user *ufilename, char __user * __user *uargv,
23 char __user * __user *uenvp, unsigned long r7, 23 char __user * __user *uenvp, unsigned long r7,
24 struct pt_regs __regs); 24 struct pt_regs __regs);
25asmlinkage int sys_sigsuspend(old_sigset_t mask, unsigned long r5, 25asmlinkage int sys_sigsuspend(old_sigset_t mask, unsigned long r5,
diff --git a/arch/sh/include/asm/syscalls_64.h b/arch/sh/include/asm/syscalls_64.h
index 751fd8811364..ee519f41d950 100644
--- a/arch/sh/include/asm/syscalls_64.h
+++ b/arch/sh/include/asm/syscalls_64.h
@@ -21,7 +21,7 @@ asmlinkage int sys_vfork(unsigned long r2, unsigned long r3,
21 unsigned long r4, unsigned long r5, 21 unsigned long r4, unsigned long r5,
22 unsigned long r6, unsigned long r7, 22 unsigned long r6, unsigned long r7,
23 struct pt_regs *pregs); 23 struct pt_regs *pregs);
24asmlinkage int sys_execve(char *ufilename, char **uargv, 24asmlinkage int sys_execve(const char *ufilename, char **uargv,
25 char **uenvp, unsigned long r5, 25 char **uenvp, unsigned long r5,
26 unsigned long r6, unsigned long r7, 26 unsigned long r6, unsigned long r7,
27 struct pt_regs *pregs); 27 struct pt_regs *pregs);
diff --git a/arch/sh/kernel/process_64.c b/arch/sh/kernel/process_64.c
index d4ca6480e355..68d128d651b3 100644
--- a/arch/sh/kernel/process_64.c
+++ b/arch/sh/kernel/process_64.c
@@ -483,7 +483,7 @@ asmlinkage int sys_vfork(unsigned long r2, unsigned long r3,
483/* 483/*
484 * sys_execve() executes a new program. 484 * sys_execve() executes a new program.
485 */ 485 */
486asmlinkage int sys_execve(char *ufilename, char **uargv, 486asmlinkage int sys_execve(const char *ufilename, char **uargv,
487 char **uenvp, unsigned long r5, 487 char **uenvp, unsigned long r5,
488 unsigned long r6, unsigned long r7, 488 unsigned long r6, unsigned long r7,
489 struct pt_regs *pregs) 489 struct pt_regs *pregs)
diff --git a/arch/sparc/kernel/sys_sparc32.c b/arch/sparc/kernel/sys_sparc32.c
index c0ca87553e1c..e6375a750d9a 100644
--- a/arch/sparc/kernel/sys_sparc32.c
+++ b/arch/sparc/kernel/sys_sparc32.c
@@ -162,7 +162,7 @@ static int cp_compat_stat64(struct kstat *stat,
162 return err; 162 return err;
163} 163}
164 164
165asmlinkage long compat_sys_stat64(char __user * filename, 165asmlinkage long compat_sys_stat64(const char __user * filename,
166 struct compat_stat64 __user *statbuf) 166 struct compat_stat64 __user *statbuf)
167{ 167{
168 struct kstat stat; 168 struct kstat stat;
@@ -173,7 +173,7 @@ asmlinkage long compat_sys_stat64(char __user * filename,
173 return error; 173 return error;
174} 174}
175 175
176asmlinkage long compat_sys_lstat64(char __user * filename, 176asmlinkage long compat_sys_lstat64(const char __user * filename,
177 struct compat_stat64 __user *statbuf) 177 struct compat_stat64 __user *statbuf)
178{ 178{
179 struct kstat stat; 179 struct kstat stat;
@@ -195,7 +195,8 @@ asmlinkage long compat_sys_fstat64(unsigned int fd,
195 return error; 195 return error;
196} 196}
197 197
198asmlinkage long compat_sys_fstatat64(unsigned int dfd, char __user *filename, 198asmlinkage long compat_sys_fstatat64(unsigned int dfd,
199 const char __user *filename,
199 struct compat_stat64 __user * statbuf, int flag) 200 struct compat_stat64 __user * statbuf, int flag)
200{ 201{
201 struct kstat stat; 202 struct kstat stat;
diff --git a/arch/um/kernel/exec.c b/arch/um/kernel/exec.c
index 97974c1bdd12..59b20d93b6d4 100644
--- a/arch/um/kernel/exec.c
+++ b/arch/um/kernel/exec.c
@@ -44,7 +44,7 @@ void start_thread(struct pt_regs *regs, unsigned long eip, unsigned long esp)
44 PT_REGS_SP(regs) = esp; 44 PT_REGS_SP(regs) = esp;
45} 45}
46 46
47static long execve1(char *file, char __user * __user *argv, 47static long execve1(const char *file, char __user * __user *argv,
48 char __user *__user *env) 48 char __user *__user *env)
49{ 49{
50 long error; 50 long error;
@@ -61,7 +61,7 @@ static long execve1(char *file, char __user * __user *argv,
61 return error; 61 return error;
62} 62}
63 63
64long um_execve(char *file, char __user *__user *argv, char __user *__user *env) 64long um_execve(const char *file, char __user *__user *argv, char __user *__user *env)
65{ 65{
66 long err; 66 long err;
67 67
@@ -71,7 +71,7 @@ long um_execve(char *file, char __user *__user *argv, char __user *__user *env)
71 return err; 71 return err;
72} 72}
73 73
74long sys_execve(char __user *file, char __user *__user *argv, 74long sys_execve(const char __user *file, char __user *__user *argv,
75 char __user *__user *env) 75 char __user *__user *env)
76{ 76{
77 long error; 77 long error;
diff --git a/arch/um/kernel/internal.h b/arch/um/kernel/internal.h
index 3bda43c7a786..1303a105fe91 100644
--- a/arch/um/kernel/internal.h
+++ b/arch/um/kernel/internal.h
@@ -1 +1 @@
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);
diff --git a/arch/um/kernel/syscall.c b/arch/um/kernel/syscall.c
index 4393173923f5..7427c0b1930c 100644
--- a/arch/um/kernel/syscall.c
+++ b/arch/um/kernel/syscall.c
@@ -58,7 +58,7 @@ int kernel_execve(const char *filename, char *const argv[], char *const envp[])
58 58
59 fs = get_fs(); 59 fs = get_fs();
60 set_fs(KERNEL_DS); 60 set_fs(KERNEL_DS);
61 ret = um_execve((char *)filename, (char __user *__user *)argv, 61 ret = um_execve(filename, (char __user *__user *)argv,
62 (char __user *__user *) envp); 62 (char __user *__user *) envp);
63 set_fs(fs); 63 set_fs(fs);
64 64
diff --git a/arch/x86/ia32/sys_ia32.c b/arch/x86/ia32/sys_ia32.c
index 3d093311d5e2..849813f398e7 100644
--- a/arch/x86/ia32/sys_ia32.c
+++ b/arch/x86/ia32/sys_ia32.c
@@ -51,7 +51,7 @@
51#define AA(__x) ((unsigned long)(__x)) 51#define AA(__x) ((unsigned long)(__x))
52 52
53 53
54asmlinkage long sys32_truncate64(char __user *filename, 54asmlinkage long sys32_truncate64(const char __user *filename,
55 unsigned long offset_low, 55 unsigned long offset_low,
56 unsigned long offset_high) 56 unsigned long offset_high)
57{ 57{
@@ -96,7 +96,7 @@ static int cp_stat64(struct stat64 __user *ubuf, struct kstat *stat)
96 return 0; 96 return 0;
97} 97}
98 98
99asmlinkage long sys32_stat64(char __user *filename, 99asmlinkage long sys32_stat64(const char __user *filename,
100 struct stat64 __user *statbuf) 100 struct stat64 __user *statbuf)
101{ 101{
102 struct kstat stat; 102 struct kstat stat;
@@ -107,7 +107,7 @@ asmlinkage long sys32_stat64(char __user *filename,
107 return ret; 107 return ret;
108} 108}
109 109
110asmlinkage long sys32_lstat64(char __user *filename, 110asmlinkage long sys32_lstat64(const char __user *filename,
111 struct stat64 __user *statbuf) 111 struct stat64 __user *statbuf)
112{ 112{
113 struct kstat stat; 113 struct kstat stat;
@@ -126,7 +126,7 @@ asmlinkage long sys32_fstat64(unsigned int fd, struct stat64 __user *statbuf)
126 return ret; 126 return ret;
127} 127}
128 128
129asmlinkage long sys32_fstatat(unsigned int dfd, char __user *filename, 129asmlinkage long sys32_fstatat(unsigned int dfd, const char __user *filename,
130 struct stat64 __user *statbuf, int flag) 130 struct stat64 __user *statbuf, int flag)
131{ 131{
132 struct kstat stat; 132 struct kstat stat;
@@ -408,8 +408,8 @@ asmlinkage long sys32_pread(unsigned int fd, char __user *ubuf, u32 count,
408 ((loff_t)AA(poshi) << 32) | AA(poslo)); 408 ((loff_t)AA(poshi) << 32) | AA(poslo));
409} 409}
410 410
411asmlinkage long sys32_pwrite(unsigned int fd, char __user *ubuf, u32 count, 411asmlinkage long sys32_pwrite(unsigned int fd, const char __user *ubuf,
412 u32 poslo, u32 poshi) 412 u32 count, u32 poslo, u32 poshi)
413{ 413{
414 return sys_pwrite64(fd, ubuf, count, 414 return sys_pwrite64(fd, ubuf, count,
415 ((loff_t)AA(poshi) << 32) | AA(poslo)); 415 ((loff_t)AA(poshi) << 32) | AA(poslo));
@@ -449,7 +449,7 @@ asmlinkage long sys32_sendfile(int out_fd, int in_fd,
449 return ret; 449 return ret;
450} 450}
451 451
452asmlinkage long sys32_execve(char __user *name, compat_uptr_t __user *argv, 452asmlinkage long sys32_execve(const char __user *name, compat_uptr_t __user *argv,
453 compat_uptr_t __user *envp, struct pt_regs *regs) 453 compat_uptr_t __user *envp, struct pt_regs *regs)
454{ 454{
455 long error; 455 long error;
diff --git a/arch/x86/include/asm/sys_ia32.h b/arch/x86/include/asm/sys_ia32.h
index cf4e2e381cba..cb238526a9f1 100644
--- a/arch/x86/include/asm/sys_ia32.h
+++ b/arch/x86/include/asm/sys_ia32.h
@@ -18,13 +18,13 @@
18#include <asm/ia32.h> 18#include <asm/ia32.h>
19 19
20/* ia32/sys_ia32.c */ 20/* ia32/sys_ia32.c */
21asmlinkage long sys32_truncate64(char __user *, unsigned long, unsigned long); 21asmlinkage long sys32_truncate64(const char __user *, unsigned long, unsigned long);
22asmlinkage long sys32_ftruncate64(unsigned int, unsigned long, unsigned long); 22asmlinkage long sys32_ftruncate64(unsigned int, unsigned long, unsigned long);
23 23
24asmlinkage long sys32_stat64(char __user *, struct stat64 __user *); 24asmlinkage long sys32_stat64(const char __user *, struct stat64 __user *);
25asmlinkage long sys32_lstat64(char __user *, struct stat64 __user *); 25asmlinkage long sys32_lstat64(const char __user *, struct stat64 __user *);
26asmlinkage long sys32_fstat64(unsigned int, struct stat64 __user *); 26asmlinkage long sys32_fstat64(unsigned int, struct stat64 __user *);
27asmlinkage long sys32_fstatat(unsigned int, char __user *, 27asmlinkage long sys32_fstatat(unsigned int, const char __user *,
28 struct stat64 __user *, int); 28 struct stat64 __user *, int);
29struct mmap_arg_struct32; 29struct mmap_arg_struct32;
30asmlinkage long sys32_mmap(struct mmap_arg_struct32 __user *); 30asmlinkage long sys32_mmap(struct mmap_arg_struct32 __user *);
@@ -49,12 +49,12 @@ asmlinkage long sys32_rt_sigpending(compat_sigset_t __user *, compat_size_t);
49asmlinkage long sys32_rt_sigqueueinfo(int, int, compat_siginfo_t __user *); 49asmlinkage long sys32_rt_sigqueueinfo(int, int, compat_siginfo_t __user *);
50 50
51asmlinkage long sys32_pread(unsigned int, char __user *, u32, u32, u32); 51asmlinkage long sys32_pread(unsigned int, char __user *, u32, u32, u32);
52asmlinkage long sys32_pwrite(unsigned int, char __user *, u32, u32, u32); 52asmlinkage long sys32_pwrite(unsigned int, const char __user *, u32, u32, u32);
53 53
54asmlinkage long sys32_personality(unsigned long); 54asmlinkage long sys32_personality(unsigned long);
55asmlinkage long sys32_sendfile(int, int, compat_off_t __user *, s32); 55asmlinkage long sys32_sendfile(int, int, compat_off_t __user *, s32);
56 56
57asmlinkage long sys32_execve(char __user *, compat_uptr_t __user *, 57asmlinkage long sys32_execve(const char __user *, compat_uptr_t __user *,
58 compat_uptr_t __user *, struct pt_regs *); 58 compat_uptr_t __user *, struct pt_regs *);
59asmlinkage long sys32_clone(unsigned int, unsigned int, struct pt_regs *); 59asmlinkage long sys32_clone(unsigned int, unsigned int, struct pt_regs *);
60 60
diff --git a/arch/x86/include/asm/syscalls.h b/arch/x86/include/asm/syscalls.h
index 5c044b43e9a7..feb2ff9bfc2d 100644
--- a/arch/x86/include/asm/syscalls.h
+++ b/arch/x86/include/asm/syscalls.h
@@ -23,7 +23,7 @@ long sys_iopl(unsigned int, struct pt_regs *);
23/* kernel/process.c */ 23/* kernel/process.c */
24int sys_fork(struct pt_regs *); 24int sys_fork(struct pt_regs *);
25int sys_vfork(struct pt_regs *); 25int sys_vfork(struct pt_regs *);
26long sys_execve(char __user *, char __user * __user *, 26long sys_execve(const char __user *, char __user * __user *,
27 char __user * __user *, struct pt_regs *); 27 char __user * __user *, struct pt_regs *);
28long sys_clone(unsigned long, unsigned long, void __user *, 28long sys_clone(unsigned long, unsigned long, void __user *,
29 void __user *, struct pt_regs *); 29 void __user *, struct pt_regs *);
diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S
index c5ea5cdbe7b3..17be5ec7cbba 100644
--- a/arch/x86/kernel/entry_64.S
+++ b/arch/x86/kernel/entry_64.S
@@ -1185,13 +1185,13 @@ END(kernel_thread_helper)
1185 * execve(). This function needs to use IRET, not SYSRET, to set up all state properly. 1185 * execve(). This function needs to use IRET, not SYSRET, to set up all state properly.
1186 * 1186 *
1187 * C extern interface: 1187 * C extern interface:
1188 * extern long execve(char *name, char **argv, char **envp) 1188 * extern long execve(const char *name, char **argv, char **envp)
1189 * 1189 *
1190 * asm input arguments: 1190 * asm input arguments:
1191 * rdi: name, rsi: argv, rdx: envp 1191 * rdi: name, rsi: argv, rdx: envp
1192 * 1192 *
1193 * We want to fallback into: 1193 * We want to fallback into:
1194 * extern long sys_execve(char *name, char **argv,char **envp, struct pt_regs *regs) 1194 * extern long sys_execve(const char *name, char **argv,char **envp, struct pt_regs *regs)
1195 * 1195 *
1196 * do_sys_execve asm fallback arguments: 1196 * do_sys_execve asm fallback arguments:
1197 * rdi: name, rsi: argv, rdx: envp, rcx: fake frame on the stack 1197 * rdi: name, rsi: argv, rdx: envp, rcx: fake frame on the stack
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c
index d401f1d2d06e..64ecaf0af9af 100644
--- a/arch/x86/kernel/process.c
+++ b/arch/x86/kernel/process.c
@@ -301,7 +301,7 @@ EXPORT_SYMBOL(kernel_thread);
301/* 301/*
302 * sys_execve() executes a new program. 302 * sys_execve() executes a new program.
303 */ 303 */
304long sys_execve(char __user *name, char __user * __user *argv, 304long sys_execve(const char __user *name, char __user * __user *argv,
305 char __user * __user *envp, struct pt_regs *regs) 305 char __user * __user *envp, struct pt_regs *regs)
306{ 306{
307 long error; 307 long error;
diff --git a/arch/xtensa/kernel/process.c b/arch/xtensa/kernel/process.c
index f167e0f5e05e..7c2f38f68ebb 100644
--- a/arch/xtensa/kernel/process.c
+++ b/arch/xtensa/kernel/process.c
@@ -318,7 +318,7 @@ long xtensa_clone(unsigned long clone_flags, unsigned long newsp,
318 */ 318 */
319 319
320asmlinkage 320asmlinkage
321long xtensa_execve(char __user *name, char __user * __user *argv, 321long xtensa_execve(const char __user *name, char __user * __user *argv,
322 char __user * __user *envp, 322 char __user * __user *envp,
323 long a3, long a4, long a5, 323 long a3, long a4, long a5,
324 struct pt_regs *regs) 324 struct pt_regs *regs)
diff --git a/fs/compat.c b/fs/compat.c
index e6d5d70cf3cf..718c7062aec1 100644
--- a/fs/compat.c
+++ b/fs/compat.c
@@ -77,7 +77,8 @@ int compat_printk(const char *fmt, ...)
77 * Not all architectures have sys_utime, so implement this in terms 77 * Not all architectures have sys_utime, so implement this in terms
78 * of sys_utimes. 78 * of sys_utimes.
79 */ 79 */
80asmlinkage long compat_sys_utime(char __user *filename, struct compat_utimbuf __user *t) 80asmlinkage long compat_sys_utime(const char __user *filename,
81 struct compat_utimbuf __user *t)
81{ 82{
82 struct timespec tv[2]; 83 struct timespec tv[2];
83 84
@@ -91,7 +92,7 @@ asmlinkage long compat_sys_utime(char __user *filename, struct compat_utimbuf __
91 return do_utimes(AT_FDCWD, filename, t ? tv : NULL, 0); 92 return do_utimes(AT_FDCWD, filename, t ? tv : NULL, 0);
92} 93}
93 94
94asmlinkage long compat_sys_utimensat(unsigned int dfd, char __user *filename, struct compat_timespec __user *t, int flags) 95asmlinkage long compat_sys_utimensat(unsigned int dfd, const char __user *filename, struct compat_timespec __user *t, int flags)
95{ 96{
96 struct timespec tv[2]; 97 struct timespec tv[2];
97 98
@@ -106,7 +107,7 @@ asmlinkage long compat_sys_utimensat(unsigned int dfd, char __user *filename, st
106 return do_utimes(dfd, filename, t ? tv : NULL, flags); 107 return do_utimes(dfd, filename, t ? tv : NULL, flags);
107} 108}
108 109
109asmlinkage long compat_sys_futimesat(unsigned int dfd, char __user *filename, struct compat_timeval __user *t) 110asmlinkage long compat_sys_futimesat(unsigned int dfd, const char __user *filename, struct compat_timeval __user *t)
110{ 111{
111 struct timespec tv[2]; 112 struct timespec tv[2];
112 113
@@ -125,7 +126,7 @@ asmlinkage long compat_sys_futimesat(unsigned int dfd, char __user *filename, st
125 return do_utimes(dfd, filename, t ? tv : NULL, 0); 126 return do_utimes(dfd, filename, t ? tv : NULL, 0);
126} 127}
127 128
128asmlinkage long compat_sys_utimes(char __user *filename, struct compat_timeval __user *t) 129asmlinkage long compat_sys_utimes(const char __user *filename, struct compat_timeval __user *t)
129{ 130{
130 return compat_sys_futimesat(AT_FDCWD, filename, t); 131 return compat_sys_futimesat(AT_FDCWD, filename, t);
131} 132}
@@ -169,7 +170,7 @@ static int cp_compat_stat(struct kstat *stat, struct compat_stat __user *ubuf)
169 return err; 170 return err;
170} 171}
171 172
172asmlinkage long compat_sys_newstat(char __user * filename, 173asmlinkage long compat_sys_newstat(const char __user * filename,
173 struct compat_stat __user *statbuf) 174 struct compat_stat __user *statbuf)
174{ 175{
175 struct kstat stat; 176 struct kstat stat;
@@ -181,7 +182,7 @@ asmlinkage long compat_sys_newstat(char __user * filename,
181 return cp_compat_stat(&stat, statbuf); 182 return cp_compat_stat(&stat, statbuf);
182} 183}
183 184
184asmlinkage long compat_sys_newlstat(char __user * filename, 185asmlinkage long compat_sys_newlstat(const char __user * filename,
185 struct compat_stat __user *statbuf) 186 struct compat_stat __user *statbuf)
186{ 187{
187 struct kstat stat; 188 struct kstat stat;
@@ -194,7 +195,8 @@ asmlinkage long compat_sys_newlstat(char __user * filename,
194} 195}
195 196
196#ifndef __ARCH_WANT_STAT64 197#ifndef __ARCH_WANT_STAT64
197asmlinkage long compat_sys_newfstatat(unsigned int dfd, char __user *filename, 198asmlinkage long compat_sys_newfstatat(unsigned int dfd,
199 const char __user *filename,
198 struct compat_stat __user *statbuf, int flag) 200 struct compat_stat __user *statbuf, int flag)
199{ 201{
200 struct kstat stat; 202 struct kstat stat;
@@ -837,9 +839,10 @@ static int do_nfs4_super_data_conv(void *raw_data)
837#define NCPFS_NAME "ncpfs" 839#define NCPFS_NAME "ncpfs"
838#define NFS4_NAME "nfs4" 840#define NFS4_NAME "nfs4"
839 841
840asmlinkage long compat_sys_mount(char __user * dev_name, char __user * dir_name, 842asmlinkage long compat_sys_mount(const char __user * dev_name,
841 char __user * type, unsigned long flags, 843 const char __user * dir_name,
842 void __user * data) 844 const char __user * type, unsigned long flags,
845 const void __user * data)
843{ 846{
844 char *kernel_type; 847 char *kernel_type;
845 unsigned long data_page; 848 unsigned long data_page;
diff --git a/fs/stat.c b/fs/stat.c
index c4ecd52c5737..12e90e213900 100644
--- a/fs/stat.c
+++ b/fs/stat.c
@@ -68,7 +68,8 @@ int vfs_fstat(unsigned int fd, struct kstat *stat)
68} 68}
69EXPORT_SYMBOL(vfs_fstat); 69EXPORT_SYMBOL(vfs_fstat);
70 70
71int vfs_fstatat(int dfd, char __user *filename, struct kstat *stat, int flag) 71int vfs_fstatat(int dfd, const char __user *filename, struct kstat *stat,
72 int flag)
72{ 73{
73 struct path path; 74 struct path path;
74 int error = -EINVAL; 75 int error = -EINVAL;
@@ -91,13 +92,13 @@ out:
91} 92}
92EXPORT_SYMBOL(vfs_fstatat); 93EXPORT_SYMBOL(vfs_fstatat);
93 94
94int vfs_stat(char __user *name, struct kstat *stat) 95int vfs_stat(const char __user *name, struct kstat *stat)
95{ 96{
96 return vfs_fstatat(AT_FDCWD, name, stat, 0); 97 return vfs_fstatat(AT_FDCWD, name, stat, 0);
97} 98}
98EXPORT_SYMBOL(vfs_stat); 99EXPORT_SYMBOL(vfs_stat);
99 100
100int vfs_lstat(char __user *name, struct kstat *stat) 101int vfs_lstat(const char __user *name, struct kstat *stat)
101{ 102{
102 return vfs_fstatat(AT_FDCWD, name, stat, AT_SYMLINK_NOFOLLOW); 103 return vfs_fstatat(AT_FDCWD, name, stat, AT_SYMLINK_NOFOLLOW);
103} 104}
@@ -147,7 +148,8 @@ static int cp_old_stat(struct kstat *stat, struct __old_kernel_stat __user * sta
147 return copy_to_user(statbuf,&tmp,sizeof(tmp)) ? -EFAULT : 0; 148 return copy_to_user(statbuf,&tmp,sizeof(tmp)) ? -EFAULT : 0;
148} 149}
149 150
150SYSCALL_DEFINE2(stat, char __user *, filename, struct __old_kernel_stat __user *, statbuf) 151SYSCALL_DEFINE2(stat, const char __user *, filename,
152 struct __old_kernel_stat __user *, statbuf)
151{ 153{
152 struct kstat stat; 154 struct kstat stat;
153 int error; 155 int error;
@@ -159,7 +161,8 @@ SYSCALL_DEFINE2(stat, char __user *, filename, struct __old_kernel_stat __user *
159 return cp_old_stat(&stat, statbuf); 161 return cp_old_stat(&stat, statbuf);
160} 162}
161 163
162SYSCALL_DEFINE2(lstat, char __user *, filename, struct __old_kernel_stat __user *, statbuf) 164SYSCALL_DEFINE2(lstat, const char __user *, filename,
165 struct __old_kernel_stat __user *, statbuf)
163{ 166{
164 struct kstat stat; 167 struct kstat stat;
165 int error; 168 int error;
@@ -234,7 +237,8 @@ static int cp_new_stat(struct kstat *stat, struct stat __user *statbuf)
234 return copy_to_user(statbuf,&tmp,sizeof(tmp)) ? -EFAULT : 0; 237 return copy_to_user(statbuf,&tmp,sizeof(tmp)) ? -EFAULT : 0;
235} 238}
236 239
237SYSCALL_DEFINE2(newstat, char __user *, filename, struct stat __user *, statbuf) 240SYSCALL_DEFINE2(newstat, const char __user *, filename,
241 struct stat __user *, statbuf)
238{ 242{
239 struct kstat stat; 243 struct kstat stat;
240 int error = vfs_stat(filename, &stat); 244 int error = vfs_stat(filename, &stat);
@@ -244,7 +248,8 @@ SYSCALL_DEFINE2(newstat, char __user *, filename, struct stat __user *, statbuf)
244 return cp_new_stat(&stat, statbuf); 248 return cp_new_stat(&stat, statbuf);
245} 249}
246 250
247SYSCALL_DEFINE2(newlstat, char __user *, filename, struct stat __user *, statbuf) 251SYSCALL_DEFINE2(newlstat, const char __user *, filename,
252 struct stat __user *, statbuf)
248{ 253{
249 struct kstat stat; 254 struct kstat stat;
250 int error; 255 int error;
@@ -257,7 +262,7 @@ SYSCALL_DEFINE2(newlstat, char __user *, filename, struct stat __user *, statbuf
257} 262}
258 263
259#if !defined(__ARCH_WANT_STAT64) || defined(__ARCH_WANT_SYS_NEWFSTATAT) 264#if !defined(__ARCH_WANT_STAT64) || defined(__ARCH_WANT_SYS_NEWFSTATAT)
260SYSCALL_DEFINE4(newfstatat, int, dfd, char __user *, filename, 265SYSCALL_DEFINE4(newfstatat, int, dfd, const char __user *, filename,
261 struct stat __user *, statbuf, int, flag) 266 struct stat __user *, statbuf, int, flag)
262{ 267{
263 struct kstat stat; 268 struct kstat stat;
@@ -355,7 +360,8 @@ static long cp_new_stat64(struct kstat *stat, struct stat64 __user *statbuf)
355 return copy_to_user(statbuf,&tmp,sizeof(tmp)) ? -EFAULT : 0; 360 return copy_to_user(statbuf,&tmp,sizeof(tmp)) ? -EFAULT : 0;
356} 361}
357 362
358SYSCALL_DEFINE2(stat64, char __user *, filename, struct stat64 __user *, statbuf) 363SYSCALL_DEFINE2(stat64, const char __user *, filename,
364 struct stat64 __user *, statbuf)
359{ 365{
360 struct kstat stat; 366 struct kstat stat;
361 int error = vfs_stat(filename, &stat); 367 int error = vfs_stat(filename, &stat);
@@ -366,7 +372,8 @@ SYSCALL_DEFINE2(stat64, char __user *, filename, struct stat64 __user *, statbuf
366 return error; 372 return error;
367} 373}
368 374
369SYSCALL_DEFINE2(lstat64, char __user *, filename, struct stat64 __user *, statbuf) 375SYSCALL_DEFINE2(lstat64, const char __user *, filename,
376 struct stat64 __user *, statbuf)
370{ 377{
371 struct kstat stat; 378 struct kstat stat;
372 int error = vfs_lstat(filename, &stat); 379 int error = vfs_lstat(filename, &stat);
@@ -388,7 +395,7 @@ SYSCALL_DEFINE2(fstat64, unsigned long, fd, struct stat64 __user *, statbuf)
388 return error; 395 return error;
389} 396}
390 397
391SYSCALL_DEFINE4(fstatat64, int, dfd, char __user *, filename, 398SYSCALL_DEFINE4(fstatat64, int, dfd, const char __user *, filename,
392 struct stat64 __user *, statbuf, int, flag) 399 struct stat64 __user *, statbuf, int, flag)
393{ 400{
394 struct kstat stat; 401 struct kstat stat;
diff --git a/fs/utimes.c b/fs/utimes.c
index e4c75db5d373..179b58690657 100644
--- a/fs/utimes.c
+++ b/fs/utimes.c
@@ -126,7 +126,8 @@ out:
126 * must be owner or have write permission. 126 * must be owner or have write permission.
127 * Else, update from *times, must be owner or super user. 127 * Else, update from *times, must be owner or super user.
128 */ 128 */
129long do_utimes(int dfd, char __user *filename, struct timespec *times, int flags) 129long do_utimes(int dfd, const char __user *filename, struct timespec *times,
130 int flags)
130{ 131{
131 int error = -EINVAL; 132 int error = -EINVAL;
132 133
@@ -170,7 +171,7 @@ out:
170 return error; 171 return error;
171} 172}
172 173
173SYSCALL_DEFINE4(utimensat, int, dfd, char __user *, filename, 174SYSCALL_DEFINE4(utimensat, int, dfd, const char __user *, filename,
174 struct timespec __user *, utimes, int, flags) 175 struct timespec __user *, utimes, int, flags)
175{ 176{
176 struct timespec tstimes[2]; 177 struct timespec tstimes[2];
@@ -188,7 +189,7 @@ SYSCALL_DEFINE4(utimensat, int, dfd, char __user *, filename,
188 return do_utimes(dfd, filename, utimes ? tstimes : NULL, flags); 189 return do_utimes(dfd, filename, utimes ? tstimes : NULL, flags);
189} 190}
190 191
191SYSCALL_DEFINE3(futimesat, int, dfd, char __user *, filename, 192SYSCALL_DEFINE3(futimesat, int, dfd, const char __user *, filename,
192 struct timeval __user *, utimes) 193 struct timeval __user *, utimes)
193{ 194{
194 struct timeval times[2]; 195 struct timeval times[2];
diff --git a/include/linux/compat.h b/include/linux/compat.h
index 168f7daa7bde..9ddc8780e8db 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -331,7 +331,7 @@ asmlinkage long compat_sys_epoll_pwait(int epfd,
331 const compat_sigset_t __user *sigmask, 331 const compat_sigset_t __user *sigmask,
332 compat_size_t sigsetsize); 332 compat_size_t sigsetsize);
333 333
334asmlinkage long compat_sys_utimensat(unsigned int dfd, char __user *filename, 334asmlinkage long compat_sys_utimensat(unsigned int dfd, const char __user *filename,
335 struct compat_timespec __user *t, int flags); 335 struct compat_timespec __user *t, int flags);
336 336
337asmlinkage long compat_sys_signalfd(int ufd, 337asmlinkage long compat_sys_signalfd(int ufd,
@@ -348,9 +348,9 @@ asmlinkage long compat_sys_move_pages(pid_t pid, unsigned long nr_page,
348 const int __user *nodes, 348 const int __user *nodes,
349 int __user *status, 349 int __user *status,
350 int flags); 350 int flags);
351asmlinkage long compat_sys_futimesat(unsigned int dfd, char __user *filename, 351asmlinkage long compat_sys_futimesat(unsigned int dfd, const char __user *filename,
352 struct compat_timeval __user *t); 352 struct compat_timeval __user *t);
353asmlinkage long compat_sys_newfstatat(unsigned int dfd, char __user * filename, 353asmlinkage long compat_sys_newfstatat(unsigned int dfd, const char __user * filename,
354 struct compat_stat __user *statbuf, 354 struct compat_stat __user *statbuf,
355 int flag); 355 int flag);
356asmlinkage long compat_sys_openat(unsigned int dfd, const char __user *filename, 356asmlinkage long compat_sys_openat(unsigned int dfd, const char __user *filename,
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 7a0625e26a39..5f0ca2fbb2a0 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -2320,10 +2320,10 @@ void inode_set_bytes(struct inode *inode, loff_t bytes);
2320 2320
2321extern int vfs_readdir(struct file *, filldir_t, void *); 2321extern int vfs_readdir(struct file *, filldir_t, void *);
2322 2322
2323extern int vfs_stat(char __user *, struct kstat *); 2323extern int vfs_stat(const char __user *, struct kstat *);
2324extern int vfs_lstat(char __user *, struct kstat *); 2324extern int vfs_lstat(const char __user *, struct kstat *);
2325extern int vfs_fstat(unsigned int, struct kstat *); 2325extern int vfs_fstat(unsigned int, struct kstat *);
2326extern int vfs_fstatat(int , char __user *, struct kstat *, int); 2326extern int vfs_fstatat(int , const char __user *, struct kstat *, int);
2327 2327
2328extern int do_vfs_ioctl(struct file *filp, unsigned int fd, unsigned int cmd, 2328extern int do_vfs_ioctl(struct file *filp, unsigned int fd, unsigned int cmd,
2329 unsigned long arg); 2329 unsigned long arg);
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index 1b67bd333b5e..6e5d19788634 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -394,7 +394,7 @@ asmlinkage long sys_umount(char __user *name, int flags);
394asmlinkage long sys_oldumount(char __user *name); 394asmlinkage long sys_oldumount(char __user *name);
395asmlinkage long sys_truncate(const char __user *path, long length); 395asmlinkage long sys_truncate(const char __user *path, long length);
396asmlinkage long sys_ftruncate(unsigned int fd, unsigned long length); 396asmlinkage long sys_ftruncate(unsigned int fd, unsigned long length);
397asmlinkage long sys_stat(char __user *filename, 397asmlinkage long sys_stat(const char __user *filename,
398 struct __old_kernel_stat __user *statbuf); 398 struct __old_kernel_stat __user *statbuf);
399asmlinkage long sys_statfs(const char __user * path, 399asmlinkage long sys_statfs(const char __user * path,
400 struct statfs __user *buf); 400 struct statfs __user *buf);
@@ -403,21 +403,21 @@ asmlinkage long sys_statfs64(const char __user *path, size_t sz,
403asmlinkage long sys_fstatfs(unsigned int fd, struct statfs __user *buf); 403asmlinkage long sys_fstatfs(unsigned int fd, struct statfs __user *buf);
404asmlinkage long sys_fstatfs64(unsigned int fd, size_t sz, 404asmlinkage long sys_fstatfs64(unsigned int fd, size_t sz,
405 struct statfs64 __user *buf); 405 struct statfs64 __user *buf);
406asmlinkage long sys_lstat(char __user *filename, 406asmlinkage long sys_lstat(const char __user *filename,
407 struct __old_kernel_stat __user *statbuf); 407 struct __old_kernel_stat __user *statbuf);
408asmlinkage long sys_fstat(unsigned int fd, 408asmlinkage long sys_fstat(unsigned int fd,
409 struct __old_kernel_stat __user *statbuf); 409 struct __old_kernel_stat __user *statbuf);
410asmlinkage long sys_newstat(char __user *filename, 410asmlinkage long sys_newstat(const char __user *filename,
411 struct stat __user *statbuf); 411 struct stat __user *statbuf);
412asmlinkage long sys_newlstat(char __user *filename, 412asmlinkage long sys_newlstat(const char __user *filename,
413 struct stat __user *statbuf); 413 struct stat __user *statbuf);
414asmlinkage long sys_newfstat(unsigned int fd, struct stat __user *statbuf); 414asmlinkage long sys_newfstat(unsigned int fd, struct stat __user *statbuf);
415asmlinkage long sys_ustat(unsigned dev, struct ustat __user *ubuf); 415asmlinkage long sys_ustat(unsigned dev, struct ustat __user *ubuf);
416#if BITS_PER_LONG == 32 416#if BITS_PER_LONG == 32
417asmlinkage long sys_stat64(char __user *filename, 417asmlinkage long sys_stat64(const char __user *filename,
418 struct stat64 __user *statbuf); 418 struct stat64 __user *statbuf);
419asmlinkage long sys_fstat64(unsigned long fd, struct stat64 __user *statbuf); 419asmlinkage long sys_fstat64(unsigned long fd, struct stat64 __user *statbuf);
420asmlinkage long sys_lstat64(char __user *filename, 420asmlinkage long sys_lstat64(const char __user *filename,
421 struct stat64 __user *statbuf); 421 struct stat64 __user *statbuf);
422asmlinkage long sys_truncate64(const char __user *path, loff_t length); 422asmlinkage long sys_truncate64(const char __user *path, loff_t length);
423asmlinkage long sys_ftruncate64(unsigned int fd, loff_t length); 423asmlinkage long sys_ftruncate64(unsigned int fd, loff_t length);
@@ -760,7 +760,7 @@ asmlinkage long sys_linkat(int olddfd, const char __user *oldname,
760 int newdfd, const char __user *newname, int flags); 760 int newdfd, const char __user *newname, int flags);
761asmlinkage long sys_renameat(int olddfd, const char __user * oldname, 761asmlinkage long sys_renameat(int olddfd, const char __user * oldname,
762 int newdfd, const char __user * newname); 762 int newdfd, const char __user * newname);
763asmlinkage long sys_futimesat(int dfd, char __user *filename, 763asmlinkage long sys_futimesat(int dfd, const char __user *filename,
764 struct timeval __user *utimes); 764 struct timeval __user *utimes);
765asmlinkage long sys_faccessat(int dfd, const char __user *filename, int mode); 765asmlinkage long sys_faccessat(int dfd, const char __user *filename, int mode);
766asmlinkage long sys_fchmodat(int dfd, const char __user * filename, 766asmlinkage 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 gid_t group, int flag); 769 gid_t group, int flag);
770asmlinkage long sys_openat(int dfd, const char __user *filename, int flags, 770asmlinkage long sys_openat(int dfd, const char __user *filename, int flags,
771 int mode); 771 int mode);
772asmlinkage long sys_newfstatat(int dfd, char __user *filename, 772asmlinkage long sys_newfstatat(int dfd, const char __user *filename,
773 struct stat __user *statbuf, int flag); 773 struct stat __user *statbuf, int flag);
774asmlinkage long sys_fstatat64(int dfd, char __user *filename, 774asmlinkage long sys_fstatat64(int dfd, const char __user *filename,
775 struct stat64 __user *statbuf, int flag); 775 struct stat64 __user *statbuf, int flag);
776asmlinkage long sys_readlinkat(int dfd, const char __user *path, char __user *buf, 776asmlinkage long sys_readlinkat(int dfd, const char __user *path, char __user *buf,
777 int bufsiz); 777 int bufsiz);
778asmlinkage long sys_utimensat(int dfd, char __user *filename, 778asmlinkage long sys_utimensat(int dfd, const char __user *filename,
779 struct timespec __user *utimes, int flags); 779 struct timespec __user *utimes, int flags);
780asmlinkage long sys_unshare(unsigned long unshare_flags); 780asmlinkage long sys_unshare(unsigned long unshare_flags);
781 781
diff --git a/include/linux/time.h b/include/linux/time.h
index 12612701b1ae..9f15ac7ab92a 100644
--- a/include/linux/time.h
+++ b/include/linux/time.h
@@ -150,7 +150,7 @@ extern void do_gettimeofday(struct timeval *tv);
150extern int do_settimeofday(struct timespec *tv); 150extern int do_settimeofday(struct timespec *tv);
151extern int do_sys_settimeofday(struct timespec *tv, struct timezone *tz); 151extern int do_sys_settimeofday(struct timespec *tv, struct timezone *tz);
152#define do_posix_clock_monotonic_gettime(ts) ktime_get_ts(ts) 152#define do_posix_clock_monotonic_gettime(ts) ktime_get_ts(ts)
153extern long do_utimes(int dfd, char __user *filename, struct timespec *times, int flags); 153extern long do_utimes(int dfd, const char __user *filename, struct timespec *times, int flags);
154struct itimerval; 154struct itimerval;
155extern int do_setitimer(int which, struct itimerval *value, 155extern int do_setitimer(int which, struct itimerval *value,
156 struct itimerval *ovalue); 156 struct itimerval *ovalue);