Loading
net/mlx5e: Skip restore TC rules for vport rep without loaded flag
stable inclusion from stable-v6.6.70 commit 3e45dd1622a2c1a83c11bf42fdd8c1810123d6c0 category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/IBID2C CVE: CVE-2024-57801 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=3e45dd1622a2c1a83c11bf42fdd8c1810123d6c0 -------------------------------- [ Upstream commit 5a03b368562a7ff5f5f1f63b5adf8309cbdbd5be ] During driver unload, unregister_netdev is called after unloading vport rep. So, the mlx5e_rep_priv is already freed while trying to get rpriv->netdev, or walk rpriv->tc_ht, which results in use-after-free. So add the checking to make sure access the data of vport rep which is still loaded. Fixes: d1569537 ("net/mlx5e: Modify and restore TC rules for IPSec TX rules") Signed-off-by:Jianbo Liu <jianbol@nvidia.com> Reviewed-by:
Saeed Mahameed <saeedm@nvidia.com> Signed-off-by:
Tariq Toukan <tariqt@nvidia.com> Link: https://patch.msgid.link/20241220081505.1286093-4-tariqt@nvidia.com Signed-off-by:
Jakub Kicinski <kuba@kernel.org> Signed-off-by:
Sasha Levin <sashal@kernel.org> Signed-off-by:
Dong Chenchen <dongchenchen2@huawei.com>