path: root/net
diff options
authorKees Cook <>2021-06-17 10:09:53 -0700
committerDavid S. Miller <>2021-06-17 12:14:51 -0700
commit1c200f832e14420fa770193f9871f4ce2df00d07 (patch)
tree0b5d93829ca5b183a98b55933927a0d9a75569ce /net
parentc3b26fdf1b32f91c7a3bc743384b4a298ab53ad7 (diff)
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 <> Signed-off-by: David S. Miller <>
Diffstat (limited to 'net')
0 files changed, 0 insertions, 0 deletions