linux_dsm_epyc7002/drivers/infiniband/sw/siw
Jason Gunthorpe 6e051971b0 RDMA/siw: Fix potential siw_mem refcnt leak in siw_fastreg_mr()
siw_fastreg_mr() invokes siw_mem_id2obj(), which returns a local reference
of the siw_mem object to "mem" with increased refcnt.  When
siw_fastreg_mr() returns, "mem" becomes invalid, so the refcount should be
decreased to keep refcount balanced.

The issue happens in one error path of siw_fastreg_mr(). When "base_mr"
equals to NULL but "mem" is not NULL, the function forgets to decrease the
refcnt increased by siw_mem_id2obj() and causes a refcnt leak.

Reorganize the flow so that the goto unwind can be used as expected.

Fixes: b9be6f18cf ("rdma/siw: transmit path")
Link: https://lore.kernel.org/r/1586939949-69856-1-git-send-email-xiyuyang19@fudan.edu.cn
Reported-by: Xiyu Yang <xiyuyang19@fudan.edu.cn>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
2020-04-15 11:26:51 -03:00
..
iwarp.h
Kconfig RDMA/siw: Change CQ flags from 64->32 bits 2019-08-13 12:22:06 -04:00
Makefile
siw_cm.c RDMA/siw: Fix passive connection establishment 2020-03-04 14:22:46 -04:00
siw_cm.h
siw_cq.c RDMA/siw: Simplify QP representation 2020-01-03 15:54:09 -04:00
siw_main.c RDMA/siw: Fix failure handling during device creation 2020-03-04 14:26:23 -04:00
siw_mem.c mm, tree-wide: rename put_user_page*() to unpin_user_page*() 2020-01-31 10:30:38 -08:00
siw_mem.h RDMA/siw: Fix 64/32bit pointer inconsistency 2019-08-23 12:08:27 -04:00
siw_qp_rx.c RDMA/siw: Suppress uninitialized var warning 2020-03-23 22:22:37 -03:00
siw_qp_tx.c RDMA/siw: Fix potential siw_mem refcnt leak in siw_fastreg_mr() 2020-04-15 11:26:51 -03:00
siw_qp.c RDMA/siw: Simplify QP representation 2020-01-03 15:54:09 -04:00
siw_verbs.c RDMA/providers: Fix return value when QP type isn't supported 2020-03-04 12:13:42 -04:00
siw_verbs.h RDMA/siw: Use the common mmap_xa helpers 2019-11-06 13:08:01 -04:00
siw.h RDMA/siw: Simplify QP representation 2020-01-03 15:54:09 -04:00