path: root/mm/fadvise.c
diff options
authorHeiko Carstens <heiko.carstens@de.ibm.com>2009-01-14 14:14:02 +0100
committerHeiko Carstens <heiko.carstens@de.ibm.com>2009-01-14 14:15:18 +0100
commit6673e0c3fbeaed2cd08e2fd4a4aa97382d6fedb0 (patch)
treeeb33a94f5e4b0e035001f7c96ef44cade0fbb489 /mm/fadvise.c
parented6bb6194350dc6ae97a65dbf2d621a3dbe6bbe9 (diff)
[CVE-2009-0029] System call wrapper special cases
System calls with an unsigned long long argument can't be converted with the standard wrappers since that would include a cast to long, which in turn means that we would lose the upper 32 bit on 32 bit architectures. Also semctl can't use the standard wrapper since it has a 'union' parameter. So we handle them as special case and add some extra wrappers instead. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Diffstat (limited to 'mm/fadvise.c')
1 files changed, 16 insertions, 2 deletions
diff --git a/mm/fadvise.c b/mm/fadvise.c
index a1da969bd98..54a0f8040af 100644
--- a/mm/fadvise.c
+++ b/mm/fadvise.c
@@ -24,7 +24,7 @@
* POSIX_FADV_WILLNEED could set PG_Referenced, and POSIX_FADV_NOREUSE could
* deactivate the pages and clear PG_Referenced.
-asmlinkage long sys_fadvise64_64(int fd, loff_t offset, loff_t len, int advice)
+SYSCALL_DEFINE(fadvise64_64)(int fd, loff_t offset, loff_t len, int advice)
struct file *file = fget(fd);
struct address_space *mapping;
@@ -126,12 +126,26 @@ out:
return ret;
+asmlinkage long SyS_fadvise64_64(long fd, loff_t offset, loff_t len, long advice)
+ return SYSC_fadvise64_64((int) fd, offset, len, (int) advice);
+SYSCALL_ALIAS(sys_fadvise64_64, SyS_fadvise64_64);
-asmlinkage long sys_fadvise64(int fd, loff_t offset, size_t len, int advice)
+SYSCALL_DEFINE(fadvise64)(int fd, loff_t offset, size_t len, int advice)
return sys_fadvise64_64(fd, offset, len, advice);
+asmlinkage long SyS_fadvise64(long fd, loff_t offset, long len, long advice)
+ return SYSC_fadvise64((int) fd, offset, (size_t)len, (int)advice);
+SYSCALL_ALIAS(sys_fadvise64, SyS_fadvise64);