RDMA/rxe: Fix memory allocation while locked
Subsystems (2)
PATCH 1/1 RDMA/rxe: Fix memory allocation while locked
rxe_mcast_add_grp_elem() in rxe_mcast.c calls rxe_alloc() while holding spinlocks which in turn calls kzalloc(size, GFP_KERNEL) which is incorrect. This patch replaces rxe_alloc() by rxe_alloc_locked() which uses GFP_ATOMIC. This bug was caused by the below mentioned commit and failing to handle the need for the atomic allocate.
Fixes 4276fd0dddc9 ("Remove RXE_POOL_ATOMIC")
Reported-by Dan Carpenter <[email protected]>
Signed-off-by Bob Pearson <[email protected]>
--- drivers/infiniband/sw/rxe/rxe_mcast.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/sw/rxe/rxe_mcast.c +1 -1
@@ -85,7 +85,7 @@ int rxe_mcast_add_grp_elem(struct rxe_dev *rxe, struct rxe_qp *qp, goto out; } - elem =rxe_alloc (&rxe->mc_elem_pool); + elem =rxe_alloc_locked (&rxe->mc_elem_pool);if (!elem) { err = -ENOMEM ; goto out;
Signature · 1 line
2.30.2
Quoted 6 lines · Bob Pearson
rxe_mcast_add_grp_elem()inrxe_mcast.ccallsrxe_alloc()while holding spinlocks which in turn callskzalloc(size, GFP_KERNEL)which is incorrect. This patch replacesrxe_alloc()byrxe_alloc_locked()which usesGFP_ATOMIC. This bug was caused by the below mentioned commit and failing to handle the need for the atomic allocate.
Quoted 6 lines
Fixes 4276fd0dddc9 ("Remove RXE_POOL_ATOMIC")Reported-by Dan Carpenter <[email protected]>Signed-off-by Bob Pearson <[email protected]>--- drivers/infiniband/sw/rxe/rxe_mcast.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Applied to for-rc, thanks
Jason