iavf: Fix ping is lost after untrusted VF had tried to change MAC
Subsystems (2)
PATCH v2 1/1 iavf: Fix ping is lost after untrusted VF had tried to change MAC
From: Sylwester Dziedziuch <[email protected]>
Make changes to MAC address dependent on the response of PF. Disallow changes to hw mac address and mac filter from untrusted VF, thanks to that ping is not lost if VF tries to change MAC. Add a new field in iavf_mac_filter, to indicate whether there was response from PF for given filter. Based on this field pass or discard the filter.
If untrusted VF tried to change it's address, it's not changed. Still filter was changed, because of that ping couldn't go through.
---
v2: Fixed function names in comments
--- drivers/net/ethernet/intel/iavf/iavf.h | 1 + drivers/net/ethernet/intel/iavf/iavf_main.c | 1 + .../net/ethernet/intel/iavf/iavf_virtchnl.c | 47 ++++++++++++++++++- 3 files changed, 47 insertions(+), 2 deletions(-)
drivers/net/ethernet/intel/iavf/iavf.h +1 -0
@@ -137,6 +137,7 @@ struct iavf_q_vector {struct iavf_mac_filter {struct list_head list;u8 macaddr[ETH_ALEN ]; +bool is_new_mac;/* filter is new, wait for PF decision */ bool remove;/* filter needs to be removed */ bool add;/* filter needs to be added */ };
drivers/net/ethernet/intel/iavf/iavf_main.c +1 -0
@@ -797,6 +797,7 @@ struct iavf_mac_filter *iavf_add_filter(struct iavf_adapter *adapter,list_add_tail (&f->list, &adapter->mac_filter_list); f->add = true; + f->is_new_mac = true; adapter->aq_required |=IAVF_FLAG_AQ_ADD_MAC_FILTER ; }else { f->remove = false;
drivers/net/ethernet/intel/iavf/iavf_virtchnl.c +45 -2
67 lines not on this page · raw message
Signature · 1 line
2.17.1
A message that is not in the archive (sent off-list or not yet received): BN6PR11MB392398056E8C2C4942BEC4038C189@BN6PR11MB3923.namprd11.prod.outlook.com
A message that is not in the archive (sent off-list or not yet received): BYAPR11MB33678799BFFC6AEEEE9EDDCCFC139@BYAPR11MB3367.namprd11.prod.outlook.com
A message that is not in the archive (sent off-list or not yet received): BYAPR11MB336713E82D26AEEA08B4A2FAFC139@BYAPR11MB3367.namprd11.prod.outlook.com
A message that is not in the archive (sent off-list or not yet received): BYAPR11MB3367955F8C5E5474683E46F7FCE49@BYAPR11MB3367.namprd11.prod.outlook.com
A message that is not in the archive (sent off-list or not yet received): BYAPR11MB3367A5CD95A08A740B0D3843FCE49@BYAPR11MB3367.namprd11.prod.outlook.com
A message that is not in the archive (sent off-list or not yet received): BYAPR11MB3367EF5CEE54FC6415541454FCE49@BYAPR11MB3367.namprd11.prod.outlook.com
G
PATCH v2 1/1 iavf: Fix ping is lost after untrusted VF had tried to change MAC
Quoted 11 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Mateusz Palczewski
Sent: Monday, June 28, 2021 5:41 PM
To: intel-wired-lan at lists.osuosl.org
Cc: Dziedziuch, SylwesterX <[email protected]>; Patynowski, PrzemyslawX <[email protected]>; Palczewski, Mateusz <[email protected]>
Subject: [Intel-wired-lan] [PATCH net v2] iavf: Fix ping is lost after untrusted VF had tried to change MAC
Quoted 8 lines
From: Sylwester Dziedziuch <[email protected]>
Make changes to MAC address dependent on the response of PF. Disallow changes to hw mac address and mac filter from untrusted VF, thanks to that ping is not lost if VF tries to change MAC. Add a new field in
iavf_mac_filter, to indicate whether there was response from PF for given filter. Based on this field pass or discard the
filter.
Quoted 10 lines
If untrusted VF tried to change it's address, it's not changed. Still filter was changed, because of that ping couldn't go through.
Fixes c5c922b3e09b ("iavf: fix MAC address setting for VFs whenfilter is
rejected")
Signed-off-by: Przemyslaw Patynowski
<[email protected]>Signed-off-by Sylwester Dziedziuch <[email protected]>Signed-off-by Mateusz Palczewski <[email protected]>
Quoted 8 lines
---
v2: Fixed function names in comments--- drivers/net/ethernet/intel/iavf/iavf.h | 1 + drivers/net/ethernet/intel/iavf/iavf_main.c | 1 + .../net/ethernet/intel/iavf/iavf_virtchnl.c | 47 ++++++++++++++++++- 3 files changed, 47 insertions(+), 2 deletions(-)
Quoted 1 line
at Intel