i40e: fix potential NULL pointer dereferencing of pf->vf i40e_sync_vsi_filters()
Subsystems (2)
PATCH v3 1/1 i40e: fix potential NULL pointer dereferencing of pf->vf i40e_sync_vsi_filters()
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.
---
v1 -> v2: Changed title and commit message.
v2 -> v3: Fixed mistakes in the commit message.
--- drivers/net/ethernet/intel/i40e/i40e_main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_main.c +3 -2
@@ -2609,7 +2609,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);
@@ -2782,7 +2782,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; }
Signature · 6 lines
2.25.1 _______________________________________________ Intel-wired-lan mailing list [email protected] https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
drivers/net/ethernet/intel/i40e/i40e_main.c
Quoted 30 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Andrii Staikov
Sent: piątek, 11 sierpnia 2023 11:28
To: [email protected]
Cc: Loktionov, Aleksandr <[email protected]>; Staikov, Andrii <[email protected]>
Subject: [Intel-wired-lan] [PATCH iwl-net v3] i40e: fix potential NULL pointer dereferencing ofpf->vfi40e_sync_vsi_filters()Add check for
pf->vfnot 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 c87c938f62d8 ("i40e: Add VF VLAN pruning")Signed-off-by Andrii Staikov <[email protected]>Signed-off-by Aleksandr Loktionov <[email protected]>---
v1 -> v2: Changed title and commit message.
v2 -> v3: Fixed mistakes in the commit message.--- drivers/net/ethernet/intel/i40e/i40e_main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)drivers/net/ethernet/intel/i40e/i40e_main.c +0
-0
_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan