Skip to content

net/mlx5e: Fix crash unsetting rx-vlan-filter in switchdev mode

Amir Tzin requested to merge amirtz/centos-stream-9:2055536 into main

Bugzilla: https://bugzilla.redhat.com/2055536
Upstream-status: v6.2-rc8
Conflicts:

  • drivers/net/ethernet/mellanox/mlx5/core/en_fs.c
    Context diff due to missing commit:
    d494dd2bb70c ("net/mlx5e: Completely eliminate priv from fs.h")

commit 8974aa9638df557f4642acef707af15648a03555
Author: Amir Tzin amirtz@nvidia.com
Date: Sun Jan 8 15:54:46 2023 +0200

net/mlx5e: Fix crash unsetting rx-vlan-filter in switchdev mode  

Moving to switchdev mode with rx-vlan-filter on and then setting it off  
causes the kernel to crash since fs->vlan is freed during nic profile  
cleanup flow.  

RX VLAN filtering is not supported in switchdev mode so unset it when  
changing to switchdev and restore its value when switching back to  
legacy.  

trace:  
[] RIP: 0010:mlx5e_disable_cvlan_filter+0x43/0x70  
[] set_feature_cvlan_filter+0x37/0x40 [mlx5_core]  
[] mlx5e_handle_feature+0x3a/0x60 [mlx5_core]  
[] mlx5e_set_features+0x6d/0x160 [mlx5_core]  
[] __netdev_update_features+0x288/0xa70  
[] ethnl_set_features+0x309/0x380  
[] ? __nla_parse+0x21/0x30  
[] genl_family_rcv_msg_doit.isra.17+0x110/0x150  
[] genl_rcv_msg+0x112/0x260  
[] ? features_reply_size+0xe0/0xe0  
[] ? genl_family_rcv_msg_doit.isra.17+0x150/0x150  
[] netlink_rcv_skb+0x4e/0x100  
[] genl_rcv+0x24/0x40  
[] netlink_unicast+0x1ab/0x290  
[] netlink_sendmsg+0x257/0x4f0  
[] sock_sendmsg+0x5c/0x70  

Fixes: cb67b832921c ("net/mlx5e: Introduce SRIOV VF representors")  
Signed-off-by: Amir Tzin <amirtz@nvidia.com>  
Reviewed-by: Maor Dickman <maord@nvidia.com>  
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>  

Signed-off-by: Amir Tzin atzin@redhat.com

3e1db956 (Amir Tzin)
net/mlx5e: Fix crash unsetting rx-vlan-filter in switchdev mode

drivers/net/ethernet/mellanox/mlx5/core/en_fs.c | 2 +-
drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 4 ++++
2 files changed, 5 insertions(+), 1 deletion(-)

Merge request reports

Loading