Commit 0191f8697bbdfefcd36e7b8dc3eeddfe82893e4b
1 parent
e36f724b4a
Exists in
master
and in
7 other branches
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>
Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff
fs/pipe.c
... | ... | @@ -1170,7 +1170,7 @@ |
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. |