linux-brain/drivers/net/ethernet/qlogic/qed
Kees Cook 7086619922 net: qed: Fix memcpy() overflow of qed_dcbx_params()
[ Upstream commit 1c200f832e14420fa770193f9871f4ce2df00d07 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-06-30 08:47:49 -04:00
..
Makefile
qed.h
qed_cxt.c qed: suppress "don't support RoCE & iWARP" flooding on HW init 2020-07-29 10:18:33 +02:00
qed_cxt.h
qed_dcbx.c net: qed: Fix memcpy() overflow of qed_dcbx_params() 2021-06-30 08:47:49 -04:00
qed_dcbx.h
qed_debug.c qed: Populate nvm-file attributes while reading nvm config partition. 2020-07-16 08:16:40 +02:00
qed_debug.h
qed_dev.c net: qed: Disable aRFS for NPAR and 100G 2020-10-01 13:18:18 +02:00
qed_dev_api.h
qed_fcoe.c
qed_fcoe.h
qed_hsi.h qed: Add APIs for configuring grc dump config flags. 2019-08-31 13:32:30 -07:00
qed_hw.c
qed_hw.h
qed_init_fw_funcs.c
qed_init_ops.c
qed_init_ops.h
qed_int.c qed: Disable "MFW indication via attention" SPAM every 5 minutes 2020-08-05 09:59:50 +02:00
qed_int.h qed: suppress false-positives interrupt error messages on HW init 2020-07-29 10:18:34 +02:00
qed_iscsi.c
qed_iscsi.h
qed_iwarp.c qed: fix error return code in qed_iwarp_ll2_start() 2020-11-24 13:28:59 +01:00
qed_iwarp.h
qed_l2.c net: qed: Disable aRFS for NPAR and 100G 2020-10-01 13:18:18 +02:00
qed_l2.h
qed_ll2.c
qed_ll2.h
qed_main.c net: qed: Disable aRFS for NPAR and 100G 2020-10-01 13:18:18 +02:00
qed_mcp.c qed: Populate nvm-file attributes while reading nvm config partition. 2020-07-16 08:16:40 +02:00
qed_mcp.h qed: Populate nvm-file attributes while reading nvm config partition. 2020-07-16 08:16:40 +02:00
qed_mng_tlv.c
qed_ooo.c
qed_ooo.h
qed_ptp.c qed: Fix timestamping issue for L2 unicast ptp packets. 2020-02-11 04:35:51 -08:00
qed_rdma.c
qed_rdma.h
qed_reg_addr.h
qed_roce.c net: qed: fix async event callbacks unregistering 2020-06-30 15:36:58 -04:00
qed_roce.h
qed_selftest.c
qed_selftest.h
qed_sp.h
qed_sp_commands.c
qed_spq.c
qed_sriov.c net: qed: RDMA personality shouldn't fail VF load 2020-10-01 13:18:18 +02:00
qed_sriov.h
qed_vf.c net: qed: fix NVMe login fails over VFs 2020-06-30 15:36:59 -04:00
qed_vf.h