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>

authored by Heiko Carstens and committed by Linus Torvalds 7779d7be 29f12ca3

+2 -2
+2 -2
fs/compat_ioctl.c
··· 1800 /* just account for different alignment */ 1801 static int compat_ioctl_preallocate(struct file *file, unsigned long arg) 1802 { 1803 - struct space_resv_32 __user *p32 = (void __user *)arg; 1804 struct space_resv __user *p = compat_alloc_user_space(sizeof(*p)); 1805 1806 if (copy_in_user(&p->l_type, &p32->l_type, sizeof(s16)) || ··· 2802 #else 2803 case FS_IOC_RESVSP: 2804 case FS_IOC_RESVSP64: 2805 - error = ioctl_preallocate(filp, (void __user *)arg); 2806 goto out_fput; 2807 #endif 2808
··· 1800 /* just account for different alignment */ 1801 static int compat_ioctl_preallocate(struct file *file, unsigned long arg) 1802 { 1803 + struct space_resv_32 __user *p32 = compat_ptr(arg); 1804 struct space_resv __user *p = compat_alloc_user_space(sizeof(*p)); 1805 1806 if (copy_in_user(&p->l_type, &p32->l_type, sizeof(s16)) || ··· 2802 #else 2803 case FS_IOC_RESVSP: 2804 case FS_IOC_RESVSP64: 2805 + error = ioctl_preallocate(filp, compat_ptr(arg)); 2806 goto out_fput; 2807 #endif 2808