Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

do_vfs_ioctl(): use saner types

casting to pointer to int, only to pass that to function that
takes pointer to void and uses it as pointer to structure is
really asking for trouble.

"Some pointer, I'm not sure what to" is spelled "void *",
not "int *"; use that.

And declare the functions we are passing that pointer to
as taking the pointer to what they really want to access.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>

authored by

Al Viro and committed by
Arnd Bergmann
34d3d0e6 bf0a199b

+8 -8
+8 -8
fs/ioctl.c
··· 175 175 return 0; 176 176 } 177 177 178 - static int ioctl_fiemap(struct file *filp, unsigned long arg) 178 + static int ioctl_fiemap(struct file *filp, struct fiemap __user *ufiemap) 179 179 { 180 180 struct fiemap fiemap; 181 - struct fiemap __user *ufiemap = (struct fiemap __user *) arg; 182 181 struct fiemap_extent_info fieinfo = { 0, }; 183 182 struct inode *inode = file_inode(filp); 184 183 struct super_block *sb = inode->i_sb; ··· 244 245 return ret; 245 246 } 246 247 247 - static long ioctl_file_clone_range(struct file *file, void __user *argp) 248 + static long ioctl_file_clone_range(struct file *file, 249 + struct file_clone_range __user *argp) 248 250 { 249 251 struct file_clone_range args; 250 252 ··· 585 585 return thaw_super(sb); 586 586 } 587 587 588 - static int ioctl_file_dedupe_range(struct file *file, void __user *arg) 588 + static int ioctl_file_dedupe_range(struct file *file, 589 + struct file_dedupe_range __user *argp) 589 590 { 590 - struct file_dedupe_range __user *argp = arg; 591 591 struct file_dedupe_range *same = NULL; 592 592 int ret; 593 593 unsigned long size; ··· 636 636 unsigned long arg) 637 637 { 638 638 int error = 0; 639 - int __user *argp = (int __user *)arg; 639 + void __user *argp = (void __user *)arg; 640 640 struct inode *inode = file_inode(filp); 641 641 642 642 switch (cmd) { ··· 675 675 break; 676 676 677 677 case FS_IOC_FIEMAP: 678 - return ioctl_fiemap(filp, arg); 678 + return ioctl_fiemap(filp, argp); 679 679 680 680 case FIGETBSZ: 681 681 /* anon_bdev filesystems may not have a block size */ 682 682 if (!inode->i_sb->s_blocksize) 683 683 return -EINVAL; 684 - return put_user(inode->i_sb->s_blocksize, argp); 684 + return put_user(inode->i_sb->s_blocksize, (int __user *)argp); 685 685 686 686 case FICLONE: 687 687 return ioctl_file_clone(filp, arg, 0, 0, 0);