linux-stable/drivers/infiniband
Zhu Yanjun db924bd848 RDMA/rxe: Fix error unwind in rxe_create_qp()
[ Upstream commit fd5382c580 ]

In the function rxe_create_qp(), rxe_qp_from_init() is called to
initialize qp, internally things like the spin locks are not setup until
rxe_qp_init_req().

If an error occures before this point then the unwind will call
rxe_cleanup() and eventually to rxe_qp_do_cleanup()/rxe_cleanup_task()
which will oops when trying to access the uninitialized spinlock.

Move the spinlock initializations earlier before any failures.

Fixes: 8700e3e7c4 ("Soft RoCE driver")
Link: https://lore.kernel.org/r/20220731063621.298405-1-yanjun.zhu@linux.dev
Reported-by: syzbot+833061116fa28df97f3b@syzkaller.appspotmail.com
Signed-off-by: Zhu Yanjun <yanjun.zhu@linux.dev>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-08-17 14:41:56 +02:00
..
core RDMA/cm: Fix memory leak in ib_cm_insert_listen 2022-07-07 17:54:49 +02:00
hw RDMA/mlx5: Add missing check for return value in get namespace flow 2022-08-17 14:41:56 +02:00
sw RDMA/rxe: Fix error unwind in rxe_create_qp() 2022-08-17 14:41:56 +02:00
ulp RDMA/srpt: Fix a use-after-free 2022-08-17 14:41:55 +02:00
Kconfig RDMA/irdma: Add irdma Kconfig/Makefile and remove i40iw 2021-06-02 20:06:36 -03:00
Makefile