OpenCloudOS-Kernel/drivers/infiniband/sw
Pavel Skripkin 84b01721e8 RDMA: Fix use-after-free in rxe_queue_cleanup
On error handling path in rxe_qp_from_init() qp->sq.queue is freed and
then rxe_create_qp() will drop last reference to this object. qp clean up
function will try to free this queue one time and it causes UAF bug.

Fix it by zeroing queue pointer after freeing queue in rxe_qp_from_init().

Fixes: 514aee660d ("RDMA: Globally allocate and release QP memory")
Link: https://lore.kernel.org/r/20211121202239.3129-1-paskripkin@gmail.com
Reported-by: syzbot+aab53008a5adf26abe91@syzkaller.appspotmail.com
Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
Reviewed-by: Zhu Yanjun <zyjzyj2000@gmail.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
2021-11-25 13:15:59 -04:00
..
rdmavt RDMA/rdmavt: Fix error code in rvt_create_qp() 2021-10-13 13:59:47 -03:00
rxe RDMA: Fix use-after-free in rxe_queue_cleanup 2021-11-25 13:15:59 -04:00
siw RDMA: Remove redundant 'flush_workqueue()' calls 2021-10-12 13:21:23 -03:00
Makefile rdma/siw: addition to kernel build environment 2019-07-02 17:03:41 -03:00