linux/drivers/infiniband/sw
Bob Pearson c4369575b2 RDMA/rxe: Fix bug in rxe_alloc()
A recent patch which added an 'unlocked' version of rxe_alloc introduced a
bug causing kzalloc(..., GFP_KERNEL) to be called while holding a spin
lock. This patch corrects that error.

rxe_alloc_nl() should always be called while holding the pool->pool_lock
so the 2nd argument to kzalloc there should be GFP_ATOMIC.

rxe_alloc() prior to the change only locked the code around checking that
pool->state is RXE_POOL_STATE_VALID to avoid races between working threads
and a thread shutting down the rxe driver. This patch reverts rxe_alloc()
to this behavior so the lock is not held when kzalloc() is called.

Link: https://lore.kernel.org/r/20210125211641.2694-2-rpearson@hpe.com
Reported-by: syzbot+ec2fd72374785d0e558e@syzkaller.appspotmail.com
Fixes: 3853c35e24 ("RDMA/rxe: Add unlocked versions of pool APIs")
Signed-off-by: Bob Pearson <rpearson@hpe.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
2021-01-28 15:29:55 -04:00
..
rdmavt RDMA/sw/rdmavt/qp: Fix a bunch of kernel-doc misdemeanours 2021-01-22 14:37:35 -04:00
rxe RDMA/rxe: Fix bug in rxe_alloc() 2021-01-28 15:29:55 -04:00
siw RDMA/siw: Fix handling of zero-sized Read and Receive Queues. 2021-01-08 16:29:18 -04:00
Makefile rdma/siw: addition to kernel build environment 2019-07-02 17:03:41 -03:00