diff options
author | Heiko Carstens <heiko.carstens@de.ibm.com> | 2009-09-23 17:49:55 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-23 09:21:05 -0700 |
commit | 4fd8da8d62416d0dae05603ab5990a498d9aeb12 (patch) | |
tree | 81feb3cc66d49cfd89b0b26f067bbb52e164d0d8 /include | |
parent | a6e995ad7409403c5bbd6fe8f666a280e086bb22 (diff) | |
download | op-kernel-dev-4fd8da8d62416d0dae05603ab5990a498d9aeb12.zip op-kernel-dev-4fd8da8d62416d0dae05603ab5990a498d9aeb12.tar.gz |
fs: change sys_truncate length parameter type
For this system call user space passes a signed long length parameter,
while the kernel side takes an unsigned long parameter and converts it
later to signed long again.
This has led to bugs in compat wrappers see e.g. dd90bbd5 "powerpc: Add
compat_sys_truncate". The s390 compat wrapper for this functions is
broken as well since it also performs zero extension instead of sign
extension for the length parameter.
In addition if hpa comes up with an automated way of generating
compat wrappers it would generate a wrong one here.
So change the length parameter from unsigned long to long.
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/syscalls.h | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index 8d8285a..a990ace 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h @@ -460,8 +460,7 @@ asmlinkage long sys_mount(char __user *dev_name, char __user *dir_name, void __user *data); asmlinkage long sys_umount(char __user *name, int flags); asmlinkage long sys_oldumount(char __user *name); -asmlinkage long sys_truncate(const char __user *path, - unsigned 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_stat(char __user *filename, struct __old_kernel_stat __user *statbuf); |