diff options
| author | Heiko Carstens <heiko.carstens@de.ibm.com> | 2009-11-11 17:26:34 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-11-12 10:25:57 -0500 |
| commit | 7779d7bed950a7fb1af4f540c2f82a6b81b65901 (patch) | |
| tree | ca8e8d16a3f50d670f95b3b51c1aaad81a0e05f8 | |
| parent | 29f12ca32122db98481150be09d35bd72b68045e (diff) | |
fs: add missing compat_ptr handling for FS_IOC_RESVSP ioctl
For FS_IOC_RESVSP and FS_IOC_RESVSP64 compat_sys_ioctl() uses its
arg argument as a pointer to userspace. However it is missing a
a call to compat_ptr() which will do a proper pointer conversion.
This was introduced with 3e63cbb1 "fs: Add new pre-allocation ioctls
to vfs for compatibility with legacy xfs ioctls".
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Ankit Jain <me@ankitjain.org>
Acked-by: Christoph Hellwig <hch@lst.de>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Acked-by: Arnd Bergmann <arndbergmann@googlemail.com>
Acked-by: David S. Miller <davem@davemloft.net>
Cc: <stable@kernel.org> [2.6.31.x]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
| -rw-r--r-- | fs/compat_ioctl.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/compat_ioctl.c b/fs/compat_ioctl.c index f91fd51b32e3..d84e7058c298 100644 --- a/fs/compat_ioctl.c +++ b/fs/compat_ioctl.c | |||
| @@ -1800,7 +1800,7 @@ struct space_resv_32 { | |||
| 1800 | /* just account for different alignment */ | 1800 | /* just account for different alignment */ |
| 1801 | static int compat_ioctl_preallocate(struct file *file, unsigned long arg) | 1801 | static int compat_ioctl_preallocate(struct file *file, unsigned long arg) |
| 1802 | { | 1802 | { |
| 1803 | struct space_resv_32 __user *p32 = (void __user *)arg; | 1803 | struct space_resv_32 __user *p32 = compat_ptr(arg); |
| 1804 | struct space_resv __user *p = compat_alloc_user_space(sizeof(*p)); | 1804 | struct space_resv __user *p = compat_alloc_user_space(sizeof(*p)); |
| 1805 | 1805 | ||
| 1806 | if (copy_in_user(&p->l_type, &p32->l_type, sizeof(s16)) || | 1806 | if (copy_in_user(&p->l_type, &p32->l_type, sizeof(s16)) || |
| @@ -2802,7 +2802,7 @@ asmlinkage long compat_sys_ioctl(unsigned int fd, unsigned int cmd, | |||
| 2802 | #else | 2802 | #else |
| 2803 | case FS_IOC_RESVSP: | 2803 | case FS_IOC_RESVSP: |
| 2804 | case FS_IOC_RESVSP64: | 2804 | case FS_IOC_RESVSP64: |
| 2805 | error = ioctl_preallocate(filp, (void __user *)arg); | 2805 | error = ioctl_preallocate(filp, compat_ptr(arg)); |
| 2806 | goto out_fput; | 2806 | goto out_fput; |
| 2807 | #endif | 2807 | #endif |
| 2808 | 2808 | ||
