]> git.itanic.dy.fi Git - linux-stable/commit
net/mlx5: FPGA, tls, idr remove on flow delete
authorSaeed Mahameed <saeedm@mellanox.com>
Tue, 19 Mar 2019 08:05:41 +0000 (01:05 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 27 Apr 2019 07:37:34 +0000 (09:37 +0200)
commit6ad8c35a70ccead9118f4431320a228de4c6af66
treea4eb6b6f3c8cfeebe4042dea938f21be9d8f6530
parentd3697f88a2711638cf2b93c5fd3f7e3adeeaf690
net/mlx5: FPGA, tls, idr remove on flow delete

[ Upstream commit df3a8344d404a810b4aadbf19b08c8232fbaa715 ]

Flow is kfreed on mlx5_fpga_tls_del_flow but kept in the idr data
structure, this is risky and can cause use-after-free, since the
idr_remove is delayed until tls_send_teardown_cmd completion.

Instead of delaying idr_remove, in this patch we do it on
mlx5_fpga_tls_del_flow, before actually kfree(flow).

Added synchronize_rcu before kfree(flow)

Fixes: ab412e1dd7db ("net/mlx5: Accel, add TLS rx offload routines")
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/mellanox/mlx5/core/fpga/tls.c