Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

pipe: F_SETPIPE_SZ should return -EPERM for non-root

If the passed in size is larger than what has been set as the
system wide limit and the user is not root, we want to return
permission denied (not invalid value).

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>

+1 -1
+1 -1
fs/pipe.c
··· 1170 1170 switch (cmd) { 1171 1171 case F_SETPIPE_SZ: 1172 1172 if (!capable(CAP_SYS_ADMIN) && arg > pipe_max_pages) 1173 - return -EINVAL; 1173 + return -EPERM; 1174 1174 /* 1175 1175 * The pipe needs to be at least 2 pages large to 1176 1176 * guarantee POSIX behaviour.