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>
This commit is contained in:
committed by
Linus Torvalds
parent
b84ae4a140
commit
c788732523
@ -62,7 +62,7 @@ asmlinkage int sys_vfork(struct pt_regs *regs)
|
||||
/* sys_execve() executes a new program.
|
||||
* 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)
|
||||
{
|
||||
int error;
|
||||
@ -84,7 +84,7 @@ int kernel_execve(const char *filename, char *const argv[], char *const envp[])
|
||||
int ret;
|
||||
|
||||
memset(®s, 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, ®s);
|
||||
if (ret < 0)
|
||||
goto out;
|
||||
|
@ -141,7 +141,7 @@ static long cp_oldabi_stat64(struct kstat *stat,
|
||||
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 kstat stat;
|
||||
@ -151,7 +151,7 @@ asmlinkage long sys_oabi_stat64(char __user * filename,
|
||||
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 kstat stat;
|
||||
@ -172,7 +172,7 @@ asmlinkage long sys_oabi_fstat64(unsigned long fd,
|
||||
}
|
||||
|
||||
asmlinkage long sys_oabi_fstatat64(int dfd,
|
||||
char __user *filename,
|
||||
const char __user *filename,
|
||||
struct oldabi_stat64 __user *statbuf,
|
||||
int flag)
|
||||
{
|
||||
|
Reference in New Issue
Block a user