aboutsummaryrefslogtreecommitdiffstats
path: root/fs/compat.c
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 /fs/compat.c
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>
Diffstat (limited to 'fs/compat.c')
-rw-r--r--fs/compat.c23
1 files changed, 13 insertions, 10 deletions
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;