Repository navigation
Commit 3456901
net/mlx5: Avoid double free in fs init error unwinding path
[ Upstream commit 9414277 ]
In below code flow, for ingress acl table root ns memory leads
to double free.
mlx5_init_fs
init_ingress_acls_root_ns()
init_ingress_acl_root_ns
kfree(steering->esw_ingress_root_ns);
/* steering->esw_ingress_root_ns is not marked NULL */
mlx5_cleanup_fs
cleanup_ingress_acls_root_ns
steering->esw_ingress_root_ns non NULL check passes.
kfree(steering->esw_ingress_root_ns);
/* double free */
Similar issue exist for other tables.
Hence zero out the pointers to not process the table again.
Fixes: 9b93ab9 ("net/mlx5: Separate ingress/egress namespaces for each vport")
Fixes: 40c3eebb49e51 ("net/mlx5: Add support in RDMA RX steering")
Signed-off-by: Parav Pandit <parav@mellanox.com>
Reviewed-by: Mark Bloch <markb@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>1 parent 7428c3f commit 3456901
1 file changed
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2429 | 2429 | | |
2430 | 2430 | | |
2431 | 2431 | | |
| 2432 | + | |
2432 | 2433 | | |
2433 | 2434 | | |
2434 | 2435 | | |
| |||
2443 | 2444 | | |
2444 | 2445 | | |
2445 | 2446 | | |
| 2447 | + | |
2446 | 2448 | | |
2447 | 2449 | | |
2448 | 2450 | | |
| |||
2611 | 2613 | | |
2612 | 2614 | | |
2613 | 2615 | | |
| 2616 | + | |
2614 | 2617 | | |
2615 | 2618 | | |
2616 | 2619 | | |
| |||
2638 | 2641 | | |
2639 | 2642 | | |
2640 | 2643 | | |
| 2644 | + | |
2641 | 2645 | | |
2642 | 2646 | | |
2643 | 2647 | | |
| |||
0 commit comments