i40e: fix potential NULL pointer dereferencing of pf->vf i40e_sync_vsi_filters()
[ Upstream commit 9525a3c38accd2e186f52443e35e633e296cc7f5 ]
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:
parent
581668893e
commit
136861956a
1 changed files with 3 additions and 2 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue