mirror of
https://github.com/hardkernel/linux.git
synced 2026-03-24 19:40:21 +09:00
i40e: fix potential NULL pointer dereferencing of pf->vf i40e_sync_vsi_filters()
[ Upstream commit9525a3c38a] Add check for pf->vf not being NULL before dereferencing pf->vf[vsi->vf_id] in updating VSI filter sync. Add a similar check before dereferencing !pf->vf[vsi->vf_id].trusted in the condition for clearing promisc mode bit. Fixes:c87c938f62("i40e: Add VF VLAN pruning") Signed-off-by: Andrii Staikov <andrii.staikov@intel.com> Signed-off-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com> Tested-by: Rafal Romanowski <rafal.romanowski@intel.com> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
581668893e
commit
136861956a
@@ -2615,7 +2615,7 @@ int i40e_sync_vsi_filters(struct i40e_vsi *vsi)
|
||||
retval = i40e_correct_mac_vlan_filters
|
||||
(vsi, &tmp_add_list, &tmp_del_list,
|
||||
vlan_filters);
|
||||
else
|
||||
else if (pf->vf)
|
||||
retval = i40e_correct_vf_mac_vlan_filters
|
||||
(vsi, &tmp_add_list, &tmp_del_list,
|
||||
vlan_filters, pf->vf[vsi->vf_id].trusted);
|
||||
@@ -2788,7 +2788,8 @@ int i40e_sync_vsi_filters(struct i40e_vsi *vsi)
|
||||
}
|
||||
|
||||
/* if the VF is not trusted do not do promisc */
|
||||
if ((vsi->type == I40E_VSI_SRIOV) && !pf->vf[vsi->vf_id].trusted) {
|
||||
if (vsi->type == I40E_VSI_SRIOV && pf->vf &&
|
||||
!pf->vf[vsi->vf_id].trusted) {
|
||||
clear_bit(__I40E_VSI_OVERFLOW_PROMISC, vsi->state);
|
||||
goto out;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user