]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx5e: kTLS, Fix napi sync and possible use-after-free
authorTariq Toukan <tariqt@mellanox.com>
Mon, 10 Aug 2020 12:59:41 +0000 (15:59 +0300)
committerSaeed Mahameed <saeedm@nvidia.com>
Tue, 22 Sep 2020 00:22:24 +0000 (17:22 -0700)
commit83d5df397eb7471b757ed3032b09d657f0eebfef
tree8215fad91a509cd45e1a3c9a0ea2cc94112b9e99
parenta947e32ff19cd2b8fc0bf1693c5a1b0c7775b0a8
net/mlx5e: kTLS, Fix napi sync and possible use-after-free

Using synchronize_rcu() is sufficient to wait until running NAPI quits.

See similar upstream fix with detailed explanation:
("net/mlx5e: Use synchronize_rcu to sync with NAPI")

This change also fixes a possible use-after-free as the NAPI
might be already released at this stage.

Fixes: d92bf3a50da0 ("net/mlx5e: kTLS, Add kTLS RX resync support")
Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
Reviewed-by: Maxim Mikityanskiy <maximmi@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls_rx.c