mbox series

[v3,net,0/2] fix crash issue when setting MQPRIO for VFs

Message ID 20241125090719.2159124-1-wei.fang@nxp.com (mailing list archive)
Headers show
Series fix crash issue when setting MQPRIO for VFs | expand

Message

Wei Fang Nov. 25, 2024, 9:07 a.m. UTC
There is a crash issue when setting MQPRIO for ENETC VFs, the root casue
is that ENETC VFs don't like ENETC PFs, they don't have port registers,
so hw->port of VFs is NULL. However, this NULL pointer will be accessed
without any checks in enetc_mm_commit_preemptible_tcs() when configuring
MQPRIO for VFs. Therefore, two patches are added to fix this issue. The
first patch sets ENETC_SI_F_QBU flag only for SIs that support 802.1Qbu.
The second patch adds a check in enetc_change_preemptible_tcs() to ensure
that SIs that do not support 802.1Qbu do not configure preemptible TCs.

---
v1 Link: https://lore.kernel.org/imx/20241030082117.1172634-1-wei.fang@nxp.com/
v2 Link: https://lore.kernel.org/imx/20241104054309.1388433-1-wei.fang@nxp.com/
---

Vladimir Oltean (1):
  net: enetc: read TSN capabilities from port register, not SI

Wei Fang (1):
  net: enetc: Do not configure preemptible TCs if SIs do not support

 drivers/net/ethernet/freescale/enetc/enetc.c  | 12 +++---------
 .../net/ethernet/freescale/enetc/enetc_hw.h   |  6 +++---
 .../net/ethernet/freescale/enetc/enetc_pf.c   | 19 +++++++++++++++++++
 3 files changed, 25 insertions(+), 12 deletions(-)

Comments

patchwork-bot+netdevbpf@kernel.org Nov. 29, 2024, 1 p.m. UTC | #1
Hello:

This series was applied to netdev/net.git (main)
by David S. Miller <davem@davemloft.net>:

On Mon, 25 Nov 2024 17:07:17 +0800 you wrote:
> There is a crash issue when setting MQPRIO for ENETC VFs, the root casue
> is that ENETC VFs don't like ENETC PFs, they don't have port registers,
> so hw->port of VFs is NULL. However, this NULL pointer will be accessed
> without any checks in enetc_mm_commit_preemptible_tcs() when configuring
> MQPRIO for VFs. Therefore, two patches are added to fix this issue. The
> first patch sets ENETC_SI_F_QBU flag only for SIs that support 802.1Qbu.
> The second patch adds a check in enetc_change_preemptible_tcs() to ensure
> that SIs that do not support 802.1Qbu do not configure preemptible TCs.
> 
> [...]

Here is the summary with links:
  - [v3,net,1/2] net: enetc: read TSN capabilities from port register, not SI
    https://git.kernel.org/netdev/net/c/8e00072c31e2
  - [v3,net,2/2] net: enetc: Do not configure preemptible TCs if SIs do not support
    https://git.kernel.org/netdev/net/c/b2420b8c81ec

You are awesome, thank you!