提交 0957f007 编写于 作者: M Mark Fasheh

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: NMark Fasheh <mark.fasheh@oracle.com>
上级 7909f2bf
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册