Eric Biggers 96e99be40e pipe: reject F_SETPIPE_SZ with size over UINT_MAX
A pipe's size is represented as an 'unsigned int'.  As expected, writing a
value greater than UINT_MAX to /proc/sys/fs/pipe-max-size fails with
EINVAL.  However, the F_SETPIPE_SZ fcntl silently truncates such values to
32 bits, rather than failing with EINVAL as expected.  (It *does* fail
with EINVAL for values above (1 << 31) but <= UINT_MAX.)

Fix this by moving the check against UINT_MAX into round_pipe_size() which
is called in both cases.

Link: http://lkml.kernel.org/r/20180111052902.14409-6-ebiggers3@gmail.com
Signed-off-by: Eric Biggers <ebiggers@google.com>
Acked-by: Kees Cook <keescook@chromium.org>
Acked-by: Joe Lawrence <joe.lawrence@redhat.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: "Luis R . Rodriguez" <mcgrof@kernel.org>
Cc: Michael Kerrisk <mtk.manpages@gmail.com>
Cc: Mikulas Patocka <mpatocka@redhat.com>
Cc: Willy Tarreau <w@1wt.eu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2018-02-06 18:32:47 -08:00
..
2018-01-29 06:42:20 -05:00
2018-01-29 13:33:53 -08:00
2017-12-17 12:20:58 -08:00
2017-11-27 16:20:05 -05:00
2018-01-29 06:42:20 -05:00
2017-11-16 11:41:22 -08:00
2018-01-24 17:33:57 -05:00
2018-01-29 13:33:53 -08:00
2018-02-06 18:32:45 -08:00
2018-01-01 10:09:33 -05:00
2018-02-05 13:35:56 -08:00
2017-09-04 19:05:15 -04:00
2018-02-06 18:32:45 -08:00
2017-04-17 12:52:27 -04:00
2018-01-03 10:13:36 -08:00
2017-12-07 14:23:30 -05:00
2018-01-29 07:27:24 -08:00
2018-02-01 09:51:57 -08:00
2017-12-09 20:16:33 -05:00
2017-11-27 16:20:05 -05:00
2017-11-27 16:20:05 -05:00