提交 419f8367 编写于 作者: J Jens Axboe

pipe: change the privilege required for growing a pipe beyond system max

Change it to CAP_SYS_RESOURCE, as that more accurately models what
we want to control.
Suggested-by: NMichael Kerrisk <mtk.manpages@googlemail.com>
Signed-off-by: NJens Axboe <jaxboe@fusionio.com>
上级 6a6ca57d
......@@ -1178,7 +1178,7 @@ long pipe_fcntl(struct file *file, unsigned int cmd, unsigned long arg)
nr_pages = (arg + PAGE_SIZE - 1) >> PAGE_SHIFT;
nr_pages = roundup_pow_of_two(nr_pages);
if (!capable(CAP_SYS_ADMIN) && nr_pages > pipe_max_pages) {
if (!capable(CAP_SYS_RESOURCE) && nr_pages > pipe_max_pages) {
ret = -EPERM;
goto out;
} else if (nr_pages < 1) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册