Skip to content

Commit

Permalink
pipe: change the privilege required for growing a pipe beyond system max
Browse files Browse the repository at this point in the history
Change it to CAP_SYS_RESOURCE, as that more accurately models what
we want to control.

Suggested-by: Michael Kerrisk <mtk.manpages@googlemail.com>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
  • Loading branch information
Jens Axboe committed Jun 3, 2010
1 parent 6a6ca57 commit 419f836
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/pipe.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 419f836

Please sign in to comment.