]> git.ipfire.org Git - thirdparty/linux.git/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)
committerSaeed Mahameed <saeedm@mellanox.com>
Tue, 9 Apr 2019 19:33:50 +0000 (12:33 -0700)
commitdf3a8344d404a810b4aadbf19b08c8232fbaa715
treecb0651e664c37def8385d8ebf9fee536116309ab
parent31634bf5dcc418b5b2cacd954394c0c4620db6a2
net/mlx5: FPGA, tls, idr remove on flow delete

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>
drivers/net/ethernet/mellanox/mlx5/core/fpga/tls.c