diff options
author | Heiko Carstens <heiko.carstens@de.ibm.com> | 2009-01-14 08:14:02 -0500 |
---|---|---|
committer | Heiko Carstens <heiko.carstens@de.ibm.com> | 2009-01-14 08:15:18 -0500 |
commit | 6673e0c3fbeaed2cd08e2fd4a4aa97382d6fedb0 (patch) | |
tree | eb33a94f5e4b0e035001f7c96ef44cade0fbb489 /fs/sync.c | |
parent | ed6bb6194350dc6ae97a65dbf2d621a3dbe6bbe9 (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 'fs/sync.c')
-rw-r--r-- | fs/sync.c | 26 |
1 files changed, 22 insertions, 4 deletions
@@ -201,8 +201,8 @@ asmlinkage long sys_fdatasync(unsigned int fd) | |||
201 | * already-instantiated disk blocks, there are no guarantees here that the data | 201 | * already-instantiated disk blocks, there are no guarantees here that the data |
202 | * will be available after a crash. | 202 | * will be available after a crash. |
203 | */ | 203 | */ |
204 | asmlinkage long sys_sync_file_range(int fd, loff_t offset, loff_t nbytes, | 204 | SYSCALL_DEFINE(sync_file_range)(int fd, loff_t offset, loff_t nbytes, |
205 | unsigned int flags) | 205 | unsigned int flags) |
206 | { | 206 | { |
207 | int ret; | 207 | int ret; |
208 | struct file *file; | 208 | struct file *file; |
@@ -262,14 +262,32 @@ out_put: | |||
262 | out: | 262 | out: |
263 | return ret; | 263 | return ret; |
264 | } | 264 | } |
265 | #ifdef CONFIG_HAVE_SYSCALL_WRAPPERS | ||
266 | asmlinkage long SyS_sync_file_range(long fd, loff_t offset, loff_t nbytes, | ||
267 | long flags) | ||
268 | { | ||
269 | return SYSC_sync_file_range((int) fd, offset, nbytes, | ||
270 | (unsigned int) flags); | ||
271 | } | ||
272 | SYSCALL_ALIAS(sys_sync_file_range, SyS_sync_file_range); | ||
273 | #endif | ||
265 | 274 | ||
266 | /* It would be nice if people remember that not all the world's an i386 | 275 | /* It would be nice if people remember that not all the world's an i386 |
267 | when they introduce new system calls */ | 276 | when they introduce new system calls */ |
268 | asmlinkage long sys_sync_file_range2(int fd, unsigned int flags, | 277 | SYSCALL_DEFINE(sync_file_range2)(int fd, unsigned int flags, |
269 | loff_t offset, loff_t nbytes) | 278 | loff_t offset, loff_t nbytes) |
270 | { | 279 | { |
271 | return sys_sync_file_range(fd, offset, nbytes, flags); | 280 | return sys_sync_file_range(fd, offset, nbytes, flags); |
272 | } | 281 | } |
282 | #ifdef CONFIG_HAVE_SYSCALL_WRAPPERS | ||
283 | asmlinkage long SyS_sync_file_range2(long fd, long flags, | ||
284 | loff_t offset, loff_t nbytes) | ||
285 | { | ||
286 | return SYSC_sync_file_range2((int) fd, (unsigned int) flags, | ||
287 | offset, nbytes); | ||
288 | } | ||
289 | SYSCALL_ALIAS(sys_sync_file_range2, SyS_sync_file_range2); | ||
290 | #endif | ||
273 | 291 | ||
274 | /* | 292 | /* |
275 | * `endbyte' is inclusive | 293 | * `endbyte' is inclusive |