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-01 12:45:37 -07:00
2017-11-27 13:05:09 -08:00
2018-01-29 06:42:20 -05:00
2018-01-29 13:33:53 -08:00
2018-01-30 14:43:12 -08:00
2018-01-15 12:07:54 -08:00
2017-11-02 11:10:55 +01:00
2018-01-31 19:25:25 -08:00
2017-11-27 16:20:05 -05:00
2018-01-31 19:25:25 -08:00
2018-02-03 16:25:42 -08:00
2018-01-30 17:58:07 -08:00
2017-10-19 16:15:16 +02:00
2017-12-17 12:20:58 -08:00
2018-02-01 10:51:18 -05:00
2017-11-27 16:20:05 -05:00
2018-01-31 08:48:37 -08:00
2018-01-30 18:59:03 -08:00
2018-01-30 17:58:07 -08:00
2017-07-11 06:09:21 -04:00
2017-11-27 13:05:09 -08:00
2018-02-03 16:25:42 -08:00
2017-03-03 11:38:56 -08:00
2018-02-03 16:25:42 -08:00
2018-02-04 10:43:12 -08:00
2018-02-04 10:43:12 -08:00
2018-01-29 06:42:20 -05:00
2018-01-15 12:07:57 -08:00
2017-11-16 11:41:22 -08:00
2018-01-30 17:58:07 -08:00
2018-02-01 11:27:11 -07:00
2017-11-27 13:05:09 -08:00
2018-02-06 18:32:45 -08:00
2017-11-02 11:10:55 +01:00
2017-12-10 12:58:18 -08:00
2018-01-31 17:18:39 -08:00
2017-11-27 13:05:09 -08:00
2018-01-10 00:27:29 -05:00
2018-01-31 19:25:25 -08:00
2018-02-03 16:25:42 -08:00
2018-01-30 17:58:07 -08:00
2018-01-24 17:33:57 -05:00
2017-11-27 13:05:09 -08:00
2018-01-31 09:25:20 -08:00
2017-11-27 16:45:11 -05:00
2018-01-29 13:33:53 -08:00
2018-02-06 18:32:45 -08:00
2017-11-02 11:10:55 +01:00
2018-01-30 17:58:07 -08:00
2018-01-01 10:09:33 -05:00
2018-01-31 17:18:35 -08:00
2017-11-02 11:10:55 +01:00
2017-11-27 13:05:09 -08:00
2018-02-03 16:25:42 -08:00
2018-02-05 09:50:29 +01:00
2018-02-06 18:32:44 -08:00
2017-11-28 16:39:09 -08:00
2017-11-27 13:05:09 -08:00
2017-11-27 13:05:09 -08:00
2017-11-29 16:46:48 +01:00
2017-09-06 17:27:26 -07:00
2018-01-01 12:45:37 -07:00
2017-11-27 13:05:09 -08:00
2017-11-27 13:05:09 -08:00
2018-02-01 13:36:15 -08:00
2017-11-27 13:05:09 -08:00
2017-07-06 03:31:46 -04:00
2018-02-04 10:43:12 -08:00
2017-11-27 13:05:09 -08:00
2018-02-03 16:25:42 -08:00
2018-02-05 13:35:56 -08:00
2017-11-17 11:54:55 -08:00
2016-12-24 11:46:01 -08:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-09-04 19:05:15 -04:00
2017-11-17 12:54:01 -08:00
2018-02-06 18:32:45 -08:00
2017-11-02 11:10:55 +01:00
2017-10-13 16:18:33 -07:00
2017-10-03 17:54:25 -07:00
2017-11-14 15:32:19 -08:00
2018-01-31 09:25:20 -08:00
2017-11-02 11:10:55 +01:00
2017-02-01 09:13:51 +01:00
2017-11-17 12:54:01 -08:00
2017-04-17 12:52:27 -04:00
2017-11-17 11:54:55 -08:00
2018-02-03 13:49:22 -08:00
2018-02-05 13:05:20 -08:00
2016-12-24 11:46:01 -08:00
2018-01-08 10:41:39 -08:00
2017-11-02 11:10:55 +01:00
2018-01-31 09:25:20 -08:00
2017-11-28 19:56:15 -05:00
2018-01-03 10:13:36 -08:00
2018-01-31 17:18:39 -08:00
2018-01-15 12:07:51 -08:00
2017-12-07 14:23:30 -05:00
2018-01-31 09:25:20 -08:00
2017-11-02 11:10:55 +01:00
2017-11-07 10:32:44 +01:00
2017-03-02 08:42:35 +01:00
2018-01-06 09:18:00 -07:00
2018-02-06 18:32:47 -08:00
2017-11-10 08:48:46 -05:00
2017-11-02 11:10:55 +01:00
2018-01-29 07:27:24 -08:00
2018-02-01 09:51:57 -08:00
2017-09-10 19:31:46 -04:00
2017-11-27 13:05:09 -08:00
2017-11-27 13:05:09 -08:00
2017-11-28 13:55:01 +01:00
2018-01-09 23:57:52 -05:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2018-01-31 09:25:20 -08:00
2017-12-09 20:16:33 -05:00
2017-12-31 16:12:23 +01:00
2017-09-05 12:53:12 +02:00
2018-02-06 18:32:47 -08:00
2017-05-23 08:41:17 -05:00
2017-02-04 00:01:06 +13:00
2018-01-02 19:27:28 -08:00
2018-01-30 17:58:07 -08:00
2017-11-17 12:08:18 -08:00
2017-11-07 10:32:44 +01:00
2017-11-29 19:00:41 -05:00
2017-11-02 11:10:55 +01:00
2017-11-27 16:20:05 -05:00
2017-10-25 11:01:08 +02:00
2017-11-02 11:10:55 +01:00
2017-11-27 13:05:09 -08:00
2018-01-31 09:25:20 -08:00
2017-11-14 15:32:19 -08:00
2017-11-27 16:20:05 -05:00
2018-01-31 17:18:39 -08:00
2017-11-02 11:10:55 +01:00
2017-10-04 18:03:15 +11:00