diff options
author | Mark Fasheh <mark.fasheh@oracle.com> | 2007-12-18 18:58:18 -0800 |
---|---|---|
committer | Mark Fasheh <mark.fasheh@oracle.com> | 2008-01-25 15:05:19 -0800 |
commit | 0957f00796157564281ea6ff2cea7ef4f897775a (patch) | |
tree | b7db05ed93642d3f5769816b57633673f9ec81f9 /fs/ocfs2 | |
parent | 7909f2bf835376a20d6dbf853eb459a27566eba2 (diff) | |
download | kernel_samsung_smdk4412-0957f00796157564281ea6ff2cea7ef4f897775a.zip kernel_samsung_smdk4412-0957f00796157564281ea6ff2cea7ef4f897775a.tar.gz kernel_samsung_smdk4412-0957f00796157564281ea6ff2cea7ef4f897775a.tar.bz2 |
ocfs2: Add missing permission checks
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>
Diffstat (limited to 'fs/ocfs2')
-rw-r--r-- | fs/ocfs2/ioctl.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/ocfs2/ioctl.c b/fs/ocfs2/ioctl.c index 7003d58..5177fba 100644 --- a/fs/ocfs2/ioctl.c +++ b/fs/ocfs2/ioctl.c @@ -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; |