Skip to content

Commit

Permalink
ocfs2: Add missing permission checks
Browse files Browse the repository at this point in the history
Check that an online resize is being driven by a user with permission to
change system resource limits.

Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
  • Loading branch information
Mark Fasheh committed Jan 25, 2008
1 parent 7909f2b commit 0957f00
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions fs/ocfs2/ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,18 @@ int ocfs2_ioctl(struct inode * inode, struct file * filp,

return ocfs2_change_file_space(filp, cmd, &sr);
case OCFS2_IOC_GROUP_EXTEND:
if (!capable(CAP_SYS_RESOURCE))
return -EPERM;

if (get_user(new_clusters, (int __user *)arg))
return -EFAULT;

return ocfs2_group_extend(inode, new_clusters);
case OCFS2_IOC_GROUP_ADD:
case OCFS2_IOC_GROUP_ADD64:
if (!capable(CAP_SYS_RESOURCE))
return -EPERM;

if (copy_from_user(&input, (int __user *) arg, sizeof(input)))
return -EFAULT;

Expand Down

0 comments on commit 0957f00

Please sign in to comment.