diff options
| author | Heiko Carstens <heiko.carstens@de.ibm.com> | 2014-03-04 10:07:52 -0500 |
|---|---|---|
| committer | Heiko Carstens <heiko.carstens@de.ibm.com> | 2014-03-06 10:30:44 -0500 |
| commit | 932602e238329da99f8482c1b721549531fbfe7f (patch) | |
| tree | e32b5562a688ad853783adc1c8c14475be00c681 /include/linux | |
| parent | 5d70a59637911e84687b421afeb4c111a579fb2b (diff) | |
fs/compat: convert to COMPAT_SYSCALL_DEFINE with changing parameter types
Some fs compat system calls have unsigned long parameters instead of
compat_ulong_t.
In order to allow the COMPAT_SYSCALL_DEFINE macro generate code that
performs proper zero and sign extension convert all 64 bit parameters
their corresponding 32 bit counterparts.
compat_sys_io_getevents() is a bit different: the non-compat version
has signed parameters for the "min_nr" and "nr" parameters while the
compat version has unsigned parameters.
So change this as well. For all practical purposes this shouldn't make
any difference (doesn't fix a real bug).
Also introduce a generic compat_aio_context_t type which can be used
everywhere.
The access_ok() check within compat_sys_io_getevents() got also removed
since the non-compat sys_io_getevents() should be able to handle
everything anyway.
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/compat.h | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/include/linux/compat.h b/include/linux/compat.h index 1c457428ec0a..fea8ee9afe22 100644 --- a/include/linux/compat.h +++ b/include/linux/compat.h | |||
| @@ -71,6 +71,8 @@ typedef struct compat_sigaltstack { | |||
| 71 | typedef __compat_uid32_t compat_uid_t; | 71 | typedef __compat_uid32_t compat_uid_t; |
| 72 | typedef __compat_gid32_t compat_gid_t; | 72 | typedef __compat_gid32_t compat_gid_t; |
| 73 | 73 | ||
| 74 | typedef compat_ulong_t compat_aio_context_t; | ||
| 75 | |||
| 74 | struct compat_sel_arg_struct; | 76 | struct compat_sel_arg_struct; |
| 75 | struct rusage; | 77 | struct rusage; |
| 76 | 78 | ||
| @@ -497,20 +499,20 @@ asmlinkage long compat_sys_statfs64(const char __user *pathname, | |||
| 497 | asmlinkage long compat_sys_fstatfs64(unsigned int fd, compat_size_t sz, | 499 | asmlinkage long compat_sys_fstatfs64(unsigned int fd, compat_size_t sz, |
| 498 | struct compat_statfs64 __user *buf); | 500 | struct compat_statfs64 __user *buf); |
| 499 | asmlinkage long compat_sys_fcntl64(unsigned int fd, unsigned int cmd, | 501 | asmlinkage long compat_sys_fcntl64(unsigned int fd, unsigned int cmd, |
| 500 | unsigned long arg); | 502 | compat_ulong_t arg); |
| 501 | asmlinkage long compat_sys_fcntl(unsigned int fd, unsigned int cmd, | 503 | asmlinkage long compat_sys_fcntl(unsigned int fd, unsigned int cmd, |
| 502 | unsigned long arg); | 504 | compat_ulong_t arg); |
| 503 | asmlinkage long compat_sys_io_setup(unsigned nr_reqs, u32 __user *ctx32p); | 505 | asmlinkage long compat_sys_io_setup(unsigned nr_reqs, u32 __user *ctx32p); |
| 504 | asmlinkage long compat_sys_io_getevents(aio_context_t ctx_id, | 506 | asmlinkage long compat_sys_io_getevents(compat_aio_context_t ctx_id, |
| 505 | unsigned long min_nr, | 507 | compat_long_t min_nr, |
| 506 | unsigned long nr, | 508 | compat_long_t nr, |
| 507 | struct io_event __user *events, | 509 | struct io_event __user *events, |
| 508 | struct compat_timespec __user *timeout); | 510 | struct compat_timespec __user *timeout); |
| 509 | asmlinkage long compat_sys_io_submit(aio_context_t ctx_id, int nr, | 511 | asmlinkage long compat_sys_io_submit(compat_aio_context_t ctx_id, int nr, |
| 510 | u32 __user *iocb); | 512 | u32 __user *iocb); |
| 511 | asmlinkage long compat_sys_mount(const char __user *dev_name, | 513 | asmlinkage long compat_sys_mount(const char __user *dev_name, |
| 512 | const char __user *dir_name, | 514 | const char __user *dir_name, |
| 513 | const char __user *type, unsigned long flags, | 515 | const char __user *type, compat_ulong_t flags, |
| 514 | const void __user *data); | 516 | const void __user *data); |
| 515 | asmlinkage long compat_sys_old_readdir(unsigned int fd, | 517 | asmlinkage long compat_sys_old_readdir(unsigned int fd, |
| 516 | struct compat_old_linux_dirent __user *, | 518 | struct compat_old_linux_dirent __user *, |
| @@ -633,7 +635,7 @@ asmlinkage long compat_sys_rt_sigqueueinfo(compat_pid_t pid, int sig, | |||
| 633 | struct compat_siginfo __user *uinfo); | 635 | struct compat_siginfo __user *uinfo); |
| 634 | asmlinkage long compat_sys_sysinfo(struct compat_sysinfo __user *info); | 636 | asmlinkage long compat_sys_sysinfo(struct compat_sysinfo __user *info); |
| 635 | asmlinkage long compat_sys_ioctl(unsigned int fd, unsigned int cmd, | 637 | asmlinkage long compat_sys_ioctl(unsigned int fd, unsigned int cmd, |
| 636 | unsigned long arg); | 638 | compat_ulong_t arg); |
| 637 | asmlinkage long compat_sys_futex(u32 __user *uaddr, int op, u32 val, | 639 | asmlinkage long compat_sys_futex(u32 __user *uaddr, int op, u32 val, |
| 638 | struct compat_timespec __user *utime, u32 __user *uaddr2, | 640 | struct compat_timespec __user *utime, u32 __user *uaddr2, |
| 639 | u32 val3); | 641 | u32 val3); |
