mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-08 04:42:04 -04:00
net/mlx4: prevent potential use after free in mlx4_en_do_uc_filter()
[ Upstream commit 4f0d91ba72811fd5dd577bcdccd7fed649aae62c ]
Print "entry->mac" before freeing "entry". The "entry" pointer is
freed with kfree_rcu() so it's unlikely that we would trigger this
in real life, but it's safer to re-order it.
Fixes: cc5387f734 ("net/mlx4_en: Add unicast MAC filtering")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/aNvMHX4g8RksFFvV@stanley.mountain
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
a6f68f219d
commit
2357cf8954
1 changed files with 1 additions and 1 deletions
|
|
@ -1175,9 +1175,9 @@ static void mlx4_en_do_uc_filter(struct mlx4_en_priv *priv,
|
|||
mlx4_unregister_mac(mdev->dev, priv->port, mac);
|
||||
|
||||
hlist_del_rcu(&entry->hlist);
|
||||
kfree_rcu(entry, rcu);
|
||||
en_dbg(DRV, priv, "Removed MAC %pM on port:%d\n",
|
||||
entry->mac, priv->port);
|
||||
kfree_rcu(entry, rcu);
|
||||
++removed;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue