• Saeed Mahameed's avatar
    net/mlx5: FPGA, tls, idr remove on flow delete · df3a8344
    Saeed Mahameed authored
    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: ab412e1d ("net/mlx5: Accel, add TLS rx offload routines")
    Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
    df3a8344
tls.c 16.3 KB