* [PATCH net 0/3][pull request] Intel Wired LAN Driver Updates 2025-05-19 (ice, idpf)
@ 2025-05-19 21:05 Tony Nguyen
2025-05-19 21:05 ` [PATCH net 1/3] ice: fix vf->num_mac count with port representors Tony Nguyen
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Tony Nguyen @ 2025-05-19 21:05 UTC (permalink / raw)
To: davem, kuba, pabeni, edumazet, andrew+netdev, netdev; +Cc: Tony Nguyen
For ice:
Jake removes incorrect incrementing of MAC filter count.
Dave adds check for, prerequisite, switchdev mode before setting up LAG.
For idpf:
Pavan stores max_tx_hdr_size to prevent NULL pointer dereference during
reset.
The following are changes since commit 239af1970bcb039a1551d2c438d113df0010c149:
llc: fix data loss when reading from a socket in llc_ui_recvmsg()
and are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue 100GbE
Dave Ertman (1):
ice: Fix LACP bonds without SRIOV environment
Jacob Keller (1):
ice: fix vf->num_mac count with port representors
Pavan Kumar Linga (1):
idpf: fix null-ptr-deref in idpf_features_check
drivers/net/ethernet/intel/ice/ice_lag.c | 6 ++++++
drivers/net/ethernet/intel/ice/ice_virtchnl.c | 1 -
drivers/net/ethernet/intel/idpf/idpf.h | 2 ++
drivers/net/ethernet/intel/idpf/idpf_lib.c | 10 ++++++----
4 files changed, 14 insertions(+), 5 deletions(-)
--
2.47.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH net 1/3] ice: fix vf->num_mac count with port representors
2025-05-19 21:05 [PATCH net 0/3][pull request] Intel Wired LAN Driver Updates 2025-05-19 (ice, idpf) Tony Nguyen
@ 2025-05-19 21:05 ` Tony Nguyen
2025-05-19 21:05 ` [PATCH net 2/3] ice: Fix LACP bonds without SRIOV environment Tony Nguyen
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Tony Nguyen @ 2025-05-19 21:05 UTC (permalink / raw)
To: davem, kuba, pabeni, edumazet, andrew+netdev, netdev
Cc: Jacob Keller, anthony.l.nguyen, Michal Swiatkowski, Simon Horman,
Sujai Buvaneswaran
From: Jacob Keller <jacob.e.keller@intel.com>
The ice_vc_repr_add_mac() function indicates that it does not store the MAC
address filters in the firmware. However, it still increments vf->num_mac.
This is incorrect, as vf->num_mac should represent the number of MAC
filters currently programmed to firmware.
Indeed, we only perform this increment if the requested filter is a unicast
address that doesn't match the existing vf->hw_lan_addr. In addition,
ice_vc_repr_del_mac() does not decrement the vf->num_mac counter. This
results in the counter becoming out of sync with the actual count.
As it turns out, vf->num_mac is currently only used in legacy made without
port representors. The single place where the value is checked is for
enforcing a filter limit on untrusted VFs.
Upcoming patches to support VF Live Migration will use this value when
determining the size of the TLV for MAC address filters. Fix the
representor mode function to stop incrementing the counter incorrectly.
Fixes: ac19e03ef780 ("ice: allow process VF opcodes in different ways")
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Tested-by: Sujai Buvaneswaran <sujai.buvaneswaran@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
drivers/net/ethernet/intel/ice/ice_virtchnl.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/net/ethernet/intel/ice/ice_virtchnl.c b/drivers/net/ethernet/intel/ice/ice_virtchnl.c
index 7c3006eb68dd..6446d0fcc052 100644
--- a/drivers/net/ethernet/intel/ice/ice_virtchnl.c
+++ b/drivers/net/ethernet/intel/ice/ice_virtchnl.c
@@ -4275,7 +4275,6 @@ static int ice_vc_repr_add_mac(struct ice_vf *vf, u8 *msg)
}
ice_vfhw_mac_add(vf, &al->list[i]);
- vf->num_mac++;
break;
}
--
2.47.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH net 2/3] ice: Fix LACP bonds without SRIOV environment
2025-05-19 21:05 [PATCH net 0/3][pull request] Intel Wired LAN Driver Updates 2025-05-19 (ice, idpf) Tony Nguyen
2025-05-19 21:05 ` [PATCH net 1/3] ice: fix vf->num_mac count with port representors Tony Nguyen
@ 2025-05-19 21:05 ` Tony Nguyen
2025-05-19 21:05 ` [PATCH net 3/3] idpf: fix null-ptr-deref in idpf_features_check Tony Nguyen
2025-05-21 1:40 ` [PATCH net 0/3][pull request] Intel Wired LAN Driver Updates 2025-05-19 (ice, idpf) patchwork-bot+netdevbpf
3 siblings, 0 replies; 5+ messages in thread
From: Tony Nguyen @ 2025-05-19 21:05 UTC (permalink / raw)
To: davem, kuba, pabeni, edumazet, andrew+netdev, netdev
Cc: Dave Ertman, anthony.l.nguyen, daniel.machon, Aleksandr Loktionov,
Sujai Buvaneswaran
From: Dave Ertman <david.m.ertman@intel.com>
If an aggregate has the following conditions:
- The SRIOV LAG DDP package has been enabled
- The bond is in 802.3ad LACP mode
- The bond is disqualified from supporting SRIOV VF LAG
- Both interfaces were added simultaneously to the bond (same command)
Then there is a chance that the two interfaces will be assigned different
LACP Aggregator ID's. This will cause a failure of the LACP control over
the bond.
To fix this, we can detect if the primary interface for the bond (as
defined by the driver) is not in switchdev mode, and exit the setup flow
if so.
Reproduction steps:
%> ip link add bond0 type bond mode 802.3ad miimon 100
%> ip link set bond0 up
%> ifenslave bond0 eth0 eth1
%> cat /proc/net/bonding/bond0 | grep Agg
Check for Aggregator IDs that differ.
Fixes: ec5a6c5f79ed ("ice: process events created by lag netdev event handler")
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Signed-off-by: Dave Ertman <david.m.ertman@intel.com>
Tested-by: Sujai Buvaneswaran <sujai.buvaneswaran@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
drivers/net/ethernet/intel/ice/ice_lag.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/net/ethernet/intel/ice/ice_lag.c b/drivers/net/ethernet/intel/ice/ice_lag.c
index 22371011c249..2410aee59fb2 100644
--- a/drivers/net/ethernet/intel/ice/ice_lag.c
+++ b/drivers/net/ethernet/intel/ice/ice_lag.c
@@ -1321,12 +1321,18 @@ static void ice_lag_changeupper_event(struct ice_lag *lag, void *ptr)
*/
if (!primary_lag) {
lag->primary = true;
+ if (!ice_is_switchdev_running(lag->pf))
+ return;
+
/* Configure primary's SWID to be shared */
ice_lag_primary_swid(lag, true);
primary_lag = lag;
} else {
u16 swid;
+ if (!ice_is_switchdev_running(primary_lag->pf))
+ return;
+
swid = primary_lag->pf->hw.port_info->sw_id;
ice_lag_set_swid(swid, lag, true);
ice_lag_add_prune_list(primary_lag, lag->pf);
--
2.47.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH net 3/3] idpf: fix null-ptr-deref in idpf_features_check
2025-05-19 21:05 [PATCH net 0/3][pull request] Intel Wired LAN Driver Updates 2025-05-19 (ice, idpf) Tony Nguyen
2025-05-19 21:05 ` [PATCH net 1/3] ice: fix vf->num_mac count with port representors Tony Nguyen
2025-05-19 21:05 ` [PATCH net 2/3] ice: Fix LACP bonds without SRIOV environment Tony Nguyen
@ 2025-05-19 21:05 ` Tony Nguyen
2025-05-21 1:40 ` [PATCH net 0/3][pull request] Intel Wired LAN Driver Updates 2025-05-19 (ice, idpf) patchwork-bot+netdevbpf
3 siblings, 0 replies; 5+ messages in thread
From: Tony Nguyen @ 2025-05-19 21:05 UTC (permalink / raw)
To: davem, kuba, pabeni, edumazet, andrew+netdev, netdev
Cc: Pavan Kumar Linga, anthony.l.nguyen, Madhu Chititm, Simon Horman,
Samuel Salin
From: Pavan Kumar Linga <pavan.kumar.linga@intel.com>
idpf_features_check is used to validate the TX packet. skb header
length is compared with the hardware supported value received from
the device control plane. The value is stored in the adapter structure
and to access it, vport pointer is used. During reset all the vports
are released and the vport pointer that the netdev private structure
points to is NULL.
To avoid null-ptr-deref, store the max header length value in netdev
private structure. This also helps to cache the value and avoid
accessing adapter pointer in hot path.
BUG: kernel NULL pointer dereference, address: 0000000000000068
...
RIP: 0010:idpf_features_check+0x6d/0xe0 [idpf]
Call Trace:
<TASK>
? __die+0x23/0x70
? page_fault_oops+0x154/0x520
? exc_page_fault+0x76/0x190
? asm_exc_page_fault+0x26/0x30
? idpf_features_check+0x6d/0xe0 [idpf]
netif_skb_features+0x88/0x310
validate_xmit_skb+0x2a/0x2b0
validate_xmit_skb_list+0x4c/0x70
sch_direct_xmit+0x19d/0x3a0
__dev_queue_xmit+0xb74/0xe70
...
Fixes: a251eee62133 ("idpf: add SRIOV support and other ndo_ops")
Reviewed-by: Madhu Chititm <madhu.chittim@intel.com>
Signed-off-by: Pavan Kumar Linga <pavan.kumar.linga@intel.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Tested-by: Samuel Salin <Samuel.salin@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
drivers/net/ethernet/intel/idpf/idpf.h | 2 ++
drivers/net/ethernet/intel/idpf/idpf_lib.c | 10 ++++++----
2 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/intel/idpf/idpf.h b/drivers/net/ethernet/intel/idpf/idpf.h
index aef0e9775a33..70dbf80f3bb7 100644
--- a/drivers/net/ethernet/intel/idpf/idpf.h
+++ b/drivers/net/ethernet/intel/idpf/idpf.h
@@ -143,6 +143,7 @@ enum idpf_vport_state {
* @vport_id: Vport identifier
* @link_speed_mbps: Link speed in mbps
* @vport_idx: Relative vport index
+ * @max_tx_hdr_size: Max header length hardware can support
* @state: See enum idpf_vport_state
* @netstats: Packet and byte stats
* @stats_lock: Lock to protect stats update
@@ -153,6 +154,7 @@ struct idpf_netdev_priv {
u32 vport_id;
u32 link_speed_mbps;
u16 vport_idx;
+ u16 max_tx_hdr_size;
enum idpf_vport_state state;
struct rtnl_link_stats64 netstats;
spinlock_t stats_lock;
diff --git a/drivers/net/ethernet/intel/idpf/idpf_lib.c b/drivers/net/ethernet/intel/idpf/idpf_lib.c
index 82f09b4030bc..3a033ce19cda 100644
--- a/drivers/net/ethernet/intel/idpf/idpf_lib.c
+++ b/drivers/net/ethernet/intel/idpf/idpf_lib.c
@@ -723,6 +723,7 @@ static int idpf_cfg_netdev(struct idpf_vport *vport)
np->vport = vport;
np->vport_idx = vport->idx;
np->vport_id = vport->vport_id;
+ np->max_tx_hdr_size = idpf_get_max_tx_hdr_size(adapter);
vport->netdev = netdev;
return idpf_init_mac_addr(vport, netdev);
@@ -740,6 +741,7 @@ static int idpf_cfg_netdev(struct idpf_vport *vport)
np->adapter = adapter;
np->vport_idx = vport->idx;
np->vport_id = vport->vport_id;
+ np->max_tx_hdr_size = idpf_get_max_tx_hdr_size(adapter);
spin_lock_init(&np->stats_lock);
@@ -2203,8 +2205,8 @@ static netdev_features_t idpf_features_check(struct sk_buff *skb,
struct net_device *netdev,
netdev_features_t features)
{
- struct idpf_vport *vport = idpf_netdev_to_vport(netdev);
- struct idpf_adapter *adapter = vport->adapter;
+ struct idpf_netdev_priv *np = netdev_priv(netdev);
+ u16 max_tx_hdr_size = np->max_tx_hdr_size;
size_t len;
/* No point in doing any of this if neither checksum nor GSO are
@@ -2227,7 +2229,7 @@ static netdev_features_t idpf_features_check(struct sk_buff *skb,
goto unsupported;
len = skb_network_header_len(skb);
- if (unlikely(len > idpf_get_max_tx_hdr_size(adapter)))
+ if (unlikely(len > max_tx_hdr_size))
goto unsupported;
if (!skb->encapsulation)
@@ -2240,7 +2242,7 @@ static netdev_features_t idpf_features_check(struct sk_buff *skb,
/* IPLEN can support at most 127 dwords */
len = skb_inner_network_header_len(skb);
- if (unlikely(len > idpf_get_max_tx_hdr_size(adapter)))
+ if (unlikely(len > max_tx_hdr_size))
goto unsupported;
/* No need to validate L4LEN as TCP is the only protocol with a
--
2.47.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH net 0/3][pull request] Intel Wired LAN Driver Updates 2025-05-19 (ice, idpf)
2025-05-19 21:05 [PATCH net 0/3][pull request] Intel Wired LAN Driver Updates 2025-05-19 (ice, idpf) Tony Nguyen
` (2 preceding siblings ...)
2025-05-19 21:05 ` [PATCH net 3/3] idpf: fix null-ptr-deref in idpf_features_check Tony Nguyen
@ 2025-05-21 1:40 ` patchwork-bot+netdevbpf
3 siblings, 0 replies; 5+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-05-21 1:40 UTC (permalink / raw)
To: Tony Nguyen; +Cc: davem, kuba, pabeni, edumazet, andrew+netdev, netdev
Hello:
This series was applied to netdev/net.git (main)
by Tony Nguyen <anthony.l.nguyen@intel.com>:
On Mon, 19 May 2025 14:05:17 -0700 you wrote:
> For ice:
> Jake removes incorrect incrementing of MAC filter count.
>
> Dave adds check for, prerequisite, switchdev mode before setting up LAG.
>
> For idpf:
> Pavan stores max_tx_hdr_size to prevent NULL pointer dereference during
> reset.
>
> [...]
Here is the summary with links:
- [net,1/3] ice: fix vf->num_mac count with port representors
https://git.kernel.org/netdev/net/c/bbd95160a03d
- [net,2/3] ice: Fix LACP bonds without SRIOV environment
https://git.kernel.org/netdev/net/c/6c778f1b839b
- [net,3/3] idpf: fix null-ptr-deref in idpf_features_check
https://git.kernel.org/netdev/net/c/2dabe349f788
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2025-05-21 1:39 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-19 21:05 [PATCH net 0/3][pull request] Intel Wired LAN Driver Updates 2025-05-19 (ice, idpf) Tony Nguyen
2025-05-19 21:05 ` [PATCH net 1/3] ice: fix vf->num_mac count with port representors Tony Nguyen
2025-05-19 21:05 ` [PATCH net 2/3] ice: Fix LACP bonds without SRIOV environment Tony Nguyen
2025-05-19 21:05 ` [PATCH net 3/3] idpf: fix null-ptr-deref in idpf_features_check Tony Nguyen
2025-05-21 1:40 ` [PATCH net 0/3][pull request] Intel Wired LAN Driver Updates 2025-05-19 (ice, idpf) patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).