]> git.baikalelectronics.ru Git - kernel.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)
commitbb369783fcc96612e0b3fcb15547168b2a481884
treecb0651e664c37def8385d8ebf9fee536116309ab
parent85e0352bf171dfa66ee93c7737be527e0c835e7b
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: 2dce8a77dbd0 ("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