Commit ebf392cd authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] sparse: ext2 __user annotation (ioctl)

parent d608b1b2
...@@ -25,7 +25,7 @@ int ext2_ioctl (struct inode * inode, struct file * filp, unsigned int cmd, ...@@ -25,7 +25,7 @@ int ext2_ioctl (struct inode * inode, struct file * filp, unsigned int cmd,
switch (cmd) { switch (cmd) {
case EXT2_IOC_GETFLAGS: case EXT2_IOC_GETFLAGS:
flags = ei->i_flags & EXT2_FL_USER_VISIBLE; flags = ei->i_flags & EXT2_FL_USER_VISIBLE;
return put_user(flags, (int *) arg); return put_user(flags, (int __user *) arg);
case EXT2_IOC_SETFLAGS: { case EXT2_IOC_SETFLAGS: {
unsigned int oldflags; unsigned int oldflags;
...@@ -35,7 +35,7 @@ int ext2_ioctl (struct inode * inode, struct file * filp, unsigned int cmd, ...@@ -35,7 +35,7 @@ int ext2_ioctl (struct inode * inode, struct file * filp, unsigned int cmd,
if ((current->fsuid != inode->i_uid) && !capable(CAP_FOWNER)) if ((current->fsuid != inode->i_uid) && !capable(CAP_FOWNER))
return -EACCES; return -EACCES;
if (get_user(flags, (int *) arg)) if (get_user(flags, (int __user *) arg))
return -EFAULT; return -EFAULT;
if (!S_ISDIR(inode->i_mode)) if (!S_ISDIR(inode->i_mode))
...@@ -64,13 +64,13 @@ int ext2_ioctl (struct inode * inode, struct file * filp, unsigned int cmd, ...@@ -64,13 +64,13 @@ int ext2_ioctl (struct inode * inode, struct file * filp, unsigned int cmd,
return 0; return 0;
} }
case EXT2_IOC_GETVERSION: case EXT2_IOC_GETVERSION:
return put_user(inode->i_generation, (int *) arg); return put_user(inode->i_generation, (int __user *) arg);
case EXT2_IOC_SETVERSION: case EXT2_IOC_SETVERSION:
if ((current->fsuid != inode->i_uid) && !capable(CAP_FOWNER)) if ((current->fsuid != inode->i_uid) && !capable(CAP_FOWNER))
return -EPERM; return -EPERM;
if (IS_RDONLY(inode)) if (IS_RDONLY(inode))
return -EROFS; return -EROFS;
if (get_user(inode->i_generation, (int *) arg)) if (get_user(inode->i_generation, (int __user *) arg))
return -EFAULT; return -EFAULT;
inode->i_ctime = CURRENT_TIME; inode->i_ctime = CURRENT_TIME;
mark_inode_dirty(inode); mark_inode_dirty(inode);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment