Kees Cook
1c200f832e
net: qed: Fix memcpy() overflow of qed_dcbx_params()
...
The source (&dcbx_info->operational.params) and dest
(&p_hwfn->p_dcbx_info->set.config.params) are both struct qed_dcbx_params
(560 bytes), not struct qed_dcbx_admin_params (564 bytes), which is used
as the memcpy() size.
However it seems that struct qed_dcbx_operational_params
(dcbx_info->operational)'s layout matches struct qed_dcbx_admin_params
(p_hwfn->p_dcbx_info->set.config)'s 4 byte difference (3 padding, 1 byte
for "valid").
On the assumption that the size is wrong (rather than the source structure
type), adjust the memcpy() size argument to be 4 bytes smaller and add
a BUILD_BUG_ON() to validate any changes to the structure sizes.
Signed-off-by: Kees Cook <keescook@chromium.org >
Signed-off-by: David S. Miller <davem@davemloft.net >
2021-06-17 12:14:51 -07:00
..
2021-04-26 11:20:10 -07:00
2021-05-15 08:32:51 -07:00
2021-05-13 20:35:26 +02:00
2021-05-05 13:24:11 -07:00
2021-05-07 16:01:08 -07:00
2021-05-07 00:26:34 -07:00
2021-05-16 10:13:14 -07:00
2021-05-15 08:52:30 -07:00
2021-06-03 14:02:17 -07:00
2021-04-26 12:11:52 -07:00
2021-05-13 18:58:44 +02:00
2021-05-20 06:31:52 -10:00
2021-05-11 08:47:25 +02:00
2021-05-14 14:55:13 +02:00
2021-05-15 10:24:48 -07:00
2021-05-13 17:23:05 +02:00
2021-05-13 18:32:29 +02:00
2021-05-20 14:02:27 +02:00
2021-05-10 07:51:38 +02:00
2021-04-28 15:59:13 -07:00
2021-04-26 09:43:16 -07:00
2021-05-20 14:46:26 -10:00
2021-04-26 12:11:52 -07:00
2021-05-12 13:56:43 +02:00
2021-05-20 20:15:43 -10:00
2021-04-29 21:47:22 +02:00
2021-04-27 18:09:44 -07:00
2021-05-20 06:31:52 -10:00
2021-05-01 10:14:08 -07:00
2021-04-30 13:01:02 -07:00
2021-04-24 22:21:01 +02:00
2021-05-10 14:01:48 +01:00
2021-05-26 17:44:49 -10:00
2021-05-06 23:37:55 -07:00
2021-04-27 10:16:46 -07:00
2021-05-05 13:24:11 -07:00
2021-05-16 13:07:18 +01:00
2021-05-26 17:44:49 -10:00
2021-05-13 17:30:15 +02:00
2021-04-28 16:10:33 -07:00
2021-05-13 14:53:49 -04:00
2021-05-13 18:58:32 +02:00
2021-05-02 00:43:35 +09:00
2021-04-26 11:08:23 +02:00
2021-04-28 15:59:13 -07:00
2021-05-20 06:40:20 -10:00
2021-05-10 14:39:06 +02:00
2021-04-26 11:14:21 -07:00
2021-05-10 18:34:30 +02:00
2021-06-17 12:14:51 -07:00
2021-05-23 17:26:38 -07:00
2021-05-06 19:24:11 -07:00
2021-05-19 08:40:24 +02:00
2021-05-03 13:57:56 -05:00
2021-05-07 00:26:34 -07:00
2021-05-06 14:39:50 -07:00
2021-05-01 10:14:08 -07:00
2021-04-29 11:57:23 -07:00
2021-05-09 00:29:45 +09:00
2021-05-20 14:11:03 +02:00
2021-04-28 15:43:58 -07:00
2021-04-26 11:20:10 -07:00
2021-06-15 10:59:46 -07:00
2021-05-05 12:53:16 -07:00
2021-05-13 18:32:19 +02:00
2021-04-28 15:59:13 -07:00
2021-05-04 11:13:33 -07:00
2021-05-05 13:24:11 -07:00
2021-05-03 12:15:21 -07:00
2021-05-07 11:35:12 -07:00
2021-05-20 14:41:35 -10:00
2021-04-26 09:43:16 -07:00
2021-05-01 09:33:00 -07:00
2021-05-21 13:13:33 +01:00
2021-05-31 21:27:15 +02:00
2021-05-08 10:44:36 -07:00
2021-05-17 16:06:02 +02:00
2021-05-05 12:46:48 -07:00
2021-05-20 06:31:52 -10:00
2021-05-14 13:26:04 +02:00
2021-05-16 10:13:14 -07:00
2021-05-18 23:01:48 -07:00
2021-05-01 09:33:00 -07:00
2021-05-05 13:31:39 -07:00
2021-05-20 06:31:52 -10:00
2021-04-29 19:06:49 +02:00
2021-05-04 04:19:59 -04:00
2021-04-28 15:59:13 -07:00
2021-05-21 09:55:16 +02:00
2021-05-05 13:31:39 -07:00