diff options
author | David Howells <dhowells@redhat.com> | 2010-08-11 06:26:22 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-13 19:53:13 -0400 |
commit | c7887325230aec47d47a32562a6e26014a0fafca (patch) | |
tree | 10535943dace59ddb01d3440aa582bc4640e8016 /arch/s390/kernel | |
parent | b84ae4a1401a731ef5fee987c0cb08743838dda7 (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>
Diffstat (limited to 'arch/s390/kernel')
-rw-r--r-- | arch/s390/kernel/compat_linux.c | 10 | ||||
-rw-r--r-- | arch/s390/kernel/compat_linux.h | 10 | ||||
-rw-r--r-- | arch/s390/kernel/entry.h | 2 | ||||
-rw-r--r-- | arch/s390/kernel/process.c | 2 |
4 files changed, 12 insertions, 12 deletions
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 | */ |
439 | asmlinkage long sys32_execve(char __user *name, compat_uptr_t __user *argv, | 439 | asmlinkage 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 | ||
573 | asmlinkage long sys32_stat64(char __user * filename, struct stat64_emu31 __user * statbuf) | 573 | asmlinkage 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 | ||
582 | asmlinkage long sys32_lstat64(char __user * filename, struct stat64_emu31 __user * statbuf) | 582 | asmlinkage 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 | ||
600 | asmlinkage long sys32_fstatat64(unsigned int dfd, char __user *filename, | 600 | asmlinkage 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 | ||
658 | asmlinkage long sys32_write(unsigned int fd, char __user * buf, size_t count) | 658 | asmlinkage 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); |
194 | long sys32_rt_sigpending(compat_sigset_t __user *set, size_t sigsetsize); | 194 | long sys32_rt_sigpending(compat_sigset_t __user *set, size_t sigsetsize); |
195 | long sys32_rt_sigqueueinfo(int pid, int sig, compat_siginfo_t __user *uinfo); | 195 | long sys32_rt_sigqueueinfo(int pid, int sig, compat_siginfo_t __user *uinfo); |
196 | long sys32_execve(char __user *name, compat_uptr_t __user *argv, | 196 | long sys32_execve(const char __user *name, compat_uptr_t __user *argv, |
197 | compat_uptr_t __user *envp); | 197 | compat_uptr_t __user *envp); |
198 | long sys32_init_module(void __user *umod, unsigned long len, | 198 | long 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); |
208 | long sys32_sendfile64(int out_fd, int in_fd, compat_loff_t __user *offset, | 208 | long sys32_sendfile64(int out_fd, int in_fd, compat_loff_t __user *offset, |
209 | s32 count); | 209 | s32 count); |
210 | long sys32_stat64(char __user * filename, struct stat64_emu31 __user * statbuf); | 210 | long sys32_stat64(const char __user * filename, struct stat64_emu31 __user * statbuf); |
211 | long sys32_lstat64(char __user * filename, | 211 | long sys32_lstat64(const char __user * filename, |
212 | struct stat64_emu31 __user * statbuf); | 212 | struct stat64_emu31 __user * statbuf); |
213 | long sys32_fstat64(unsigned long fd, struct stat64_emu31 __user * statbuf); | 213 | long sys32_fstat64(unsigned long fd, struct stat64_emu31 __user * statbuf); |
214 | long sys32_fstatat64(unsigned int dfd, char __user *filename, | 214 | long 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); |
216 | unsigned long old32_mmap(struct mmap_arg_struct_emu31 __user *arg); | 216 | unsigned long old32_mmap(struct mmap_arg_struct_emu31 __user *arg); |
217 | long sys32_mmap2(struct mmap_arg_struct_emu31 __user *arg); | 217 | long sys32_mmap2(struct mmap_arg_struct_emu31 __user *arg); |
218 | long sys32_read(unsigned int fd, char __user * buf, size_t count); | 218 | long sys32_read(unsigned int fd, char __user * buf, size_t count); |
219 | long sys32_write(unsigned int fd, char __user * buf, size_t count); | 219 | long sys32_write(unsigned int fd, const char __user * buf, size_t count); |
220 | long sys32_fadvise64(int fd, loff_t offset, size_t len, int advise); | 220 | long sys32_fadvise64(int fd, loff_t offset, size_t len, int advise); |
221 | long sys32_fadvise64_64(struct fadvise64_64_args __user *args); | 221 | long sys32_fadvise64_64(struct fadvise64_64_args __user *args); |
222 | long sys32_sigaction(int sig, const struct old_sigaction32 __user *act, | 222 | long 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); |
43 | long sys_vfork(void); | 43 | long sys_vfork(void); |
44 | void execve_tail(void); | 44 | void execve_tail(void); |
45 | long sys_execve(char __user *name, char __user * __user *argv, | 45 | long sys_execve(const char __user *name, char __user * __user *argv, |
46 | char __user * __user *envp); | 46 | char __user * __user *envp); |
47 | long sys_sigsuspend(int history0, int history1, old_sigset_t mask); | 47 | long sys_sigsuspend(int history0, int history1, old_sigset_t mask); |
48 | long sys_sigaction(int sig, const struct old_sigaction __user *act, | 48 | long 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 | */ |
270 | SYSCALL_DEFINE3(execve, char __user *, name, char __user * __user *, argv, | 270 | SYSCALL_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); |