Dan Carpenter
dbc834e5db
NFSD: harden svcxdr_dupstr() and svcxdr_tmpalloc() against integer overflows
...
These lengths come from xdr_stream_decode_u32() and so we should be a
bit careful with them. Use size_add() and struct_size() to avoid
integer overflows. Saving size_add()/struct_size() results to a u32 is
unsafe because it truncates away the high bits.
Also generally storing sizes in longs is safer. Most systems these days
use 64 bit CPUs. It's harder for an addition to overflow 64 bits than
it is to overflow 32 bits. Also functions like vmalloc() can
successfully allocate UINT_MAX bytes, but nothing can allocate ULONG_MAX
bytes.
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2024-07-08 14:10:01 -04:00
..
2024-05-29 09:25:15 -07:00
2024-03-12 20:32:19 -07:00
2024-02-26 11:36:28 +01:00
2024-07-02 21:23:00 +02:00
2024-01-11 20:11:35 -08:00
2024-06-25 20:51:14 -04:00
2024-03-12 20:32:19 -07:00
2024-03-12 20:32:19 -07:00
2024-07-04 10:27:37 -07:00
2024-06-03 15:39:17 +02:00
2024-05-25 14:23:58 -07:00
2024-03-12 20:32:19 -07:00
2024-05-03 02:36:51 -04:00
2024-05-19 09:21:03 -07:00
2024-05-28 14:32:42 +02:00
2023-12-28 04:57:57 -08:00
2024-04-23 16:08:55 -05:00
2024-05-13 14:14:05 -07:00
2024-04-13 10:33:02 +02:00
2024-02-27 11:21:33 +01:00
2024-06-30 10:54:28 +08:00
2024-04-25 21:59:59 +09:00
2024-01-23 10:58:56 -05:00
2024-05-03 11:50:28 +02:00
2024-05-21 09:51:42 -07:00
2024-05-20 13:23:43 -07:00
2024-04-25 21:07:02 -07:00
2024-03-26 09:04:53 +01:00
2024-05-23 12:04:36 -07:00
2024-05-21 09:51:42 -07:00
2023-12-29 11:58:34 -08:00
2024-04-24 16:55:28 -07:00
2023-12-21 12:51:00 -05:00
2024-03-12 20:32:19 -07:00
2024-05-19 09:21:03 -07:00
2024-06-05 17:27:03 +02:00
2024-05-09 18:09:57 +02:00
2024-05-21 09:51:42 -07:00
2024-05-25 13:23:42 -07:00
2024-06-04 18:09:03 +02:00
2024-05-04 19:02:39 +02:00
2024-05-06 09:07:20 -04:00
2024-03-26 09:04:55 +01:00
2024-06-26 14:19:08 +02:00
2024-06-24 20:52:11 -07:00
2024-07-08 14:10:01 -04:00
2024-07-03 12:29:25 -07:00
2024-05-20 12:43:58 -07:00
2024-05-25 14:19:01 -07:00
2024-06-24 20:52:10 -07:00
2024-03-26 09:04:54 +01:00
2024-05-14 17:44:14 -07:00
2024-06-14 10:30:40 +02:00
2024-06-24 20:52:09 -07:00
2024-03-09 12:33:22 -08:00
2024-03-12 20:32:19 -07:00
2024-03-26 09:04:53 +01:00
2024-04-12 14:52:29 +02:00
2024-04-25 20:56:25 -07:00
2024-05-21 08:34:51 -07:00
2024-03-27 13:17:15 +01:00
2024-07-02 21:23:41 -05:00
2024-05-19 14:02:03 -07:00
2024-04-23 13:27:43 +02:00
2024-02-27 11:21:31 +01:00
2024-05-23 09:31:50 -04:00
2024-03-21 15:09:29 -07:00
2024-04-23 15:37:02 +02:00
2024-03-12 20:32:19 -07:00
2024-05-10 04:34:52 +09:00
2024-04-03 16:06:39 +02:00
2024-05-03 08:30:58 -07:00
2024-06-26 14:29:25 +05:30
2024-04-10 07:23:47 +09:00
2024-05-21 13:11:44 -07:00
2024-04-26 10:33:05 +02:00
2024-03-12 20:03:34 -07:00
2024-05-02 20:35:57 +02:00
2024-04-24 15:55:28 -07:00
2024-05-19 14:02:03 -07:00
2023-10-30 19:28:19 -10:00
2024-05-21 09:51:42 -07:00
2023-11-02 20:53:31 -10:00
2024-05-23 12:04:36 -07:00
2024-04-25 20:56:20 -07:00
2024-07-02 21:18:32 +02:00
2024-04-11 10:21:24 +02:00
2024-02-08 10:12:26 +01:00
2024-05-05 14:00:48 -07:00
2024-05-19 09:21:03 -07:00
2024-05-10 08:26:31 +02:00
2024-04-05 15:53:47 +02:00
2024-03-12 20:03:34 -07:00
2024-05-30 09:11:47 +02:00
2024-02-02 13:11:50 +01:00
2024-04-05 15:53:45 +02:00
2024-03-15 09:00:09 -07:00
2024-05-02 20:35:57 +02:00
2024-05-13 06:58:35 +02:00
2024-03-14 17:43:30 -07:00
2024-04-17 13:49:44 +02:00
2024-07-02 20:48:14 +02:00
2024-03-11 10:21:06 -07:00
2024-02-27 11:21:31 +01:00
2024-02-08 10:12:37 +01:00
2023-11-18 14:56:16 +01:00
2024-02-06 14:31:05 +01:00
2024-06-18 16:26:09 +02:00
2024-02-07 21:16:29 +01:00
2024-03-13 12:53:53 -07:00
2024-07-01 09:22:08 -07:00
2024-05-21 08:08:00 -07:00
2024-02-02 13:11:49 +01:00
2023-11-18 14:56:16 +01:00
2024-03-12 20:03:34 -07:00
2023-11-18 14:56:16 +01:00
2024-05-21 13:11:44 -07:00
2023-12-12 16:20:02 +01:00
2024-04-15 14:54:13 -07:00
2024-02-20 09:23:52 +01:00
2024-05-02 16:28:20 +02:00
2024-05-24 13:34:07 +02:00
2024-04-15 16:03:25 -04:00
2024-03-26 09:01:18 +01:00
2024-06-18 16:20:47 +02:00
2023-12-28 04:57:57 -08:00
2024-04-10 16:23:02 -06:00
2024-05-19 09:21:03 -07:00
2024-02-15 23:43:47 -05:00