linux/drivers/net/ethernet/intel/i40e
Xiaomeng Tong 3f95a7472d i40e: i40e_main: fix a missing check on list iterator
The bug is here:
	ret = i40e_add_macvlan_filter(hw, ch->seid, vdev->dev_addr, &aq_err);

The list iterator 'ch' will point to a bogus position containing
HEAD if the list is empty or no element is found. This case must
be checked before any use of the iterator, otherwise it will
lead to a invalid memory access.

To fix this bug, use a new variable 'iter' as the list iterator,
while use the origin variable 'ch' as a dedicated pointer to
point to the found element.

Cc: stable@vger.kernel.org
Fixes: 1d8d80b4e4 ("i40e: Add macvlan support on i40e")
Signed-off-by: Xiaomeng Tong <xiam0nd.tong@gmail.com>
Tested-by: Gurucharan <gurucharanx.g@intel.com> (A Contingent worker at Intel)
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Link: https://lore.kernel.org/r/20220510204846.2166999-1-anthony.l.nguyen@intel.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2022-05-11 15:19:28 -07:00
..
i40e_adminq_cmd.h
i40e_adminq.c i40e: Add new versions of send ASQ command functions 2022-02-03 13:13:50 -08:00
i40e_adminq.h
i40e_alloc.h
i40e_client.c
i40e_common.c i40e: Add new version of i40e_aq_add_macvlan function 2022-02-03 13:13:51 -08:00
i40e_dcb_nl.c
i40e_dcb.c
i40e_dcb.h
i40e_ddp.c
i40e_debugfs.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-03-10 17:16:56 -08:00
i40e_devids.h
i40e_diag.c
i40e_diag.h
i40e_ethtool.c i40e: Add a stat for tracking busy rx pages 2022-02-08 08:21:52 -08:00
i40e_hmc.c
i40e_hmc.h
i40e_lan_hmc.c
i40e_lan_hmc.h
i40e_main.c i40e: i40e_main: fix a missing check on list iterator 2022-05-11 15:19:28 -07:00
i40e_nvm.c i40e: little endian only valid checksums 2022-03-17 07:40:46 -07:00
i40e_osdep.h
i40e_prototype.h i40e: Add new version of i40e_aq_add_macvlan function 2022-02-03 13:13:51 -08:00
i40e_ptp.c
i40e_register.h i40e: Fix for failed to init adminq while VF reset 2022-01-20 10:25:40 -08:00
i40e_status.h
i40e_trace.h
i40e_txrx_common.h
i40e_txrx.c Merge https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next 2022-02-09 18:40:56 -08:00
i40e_txrx.h Merge https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next 2022-02-09 18:40:56 -08:00
i40e_type.h
i40e_virtchnl_pf.c i40e: stop disabling VFs due to PF error responses 2022-03-08 13:31:08 -08:00
i40e_virtchnl_pf.h i40e: stop disabling VFs due to PF error responses 2022-03-08 13:31:08 -08:00
i40e_xsk.c i40e: remove dead stores on XSK hotpath 2022-02-19 12:34:04 +00:00
i40e_xsk.h
i40e.h i40e: Add a stat for tracking busy rx pages 2022-02-08 08:21:52 -08:00
Makefile