linux/drivers/infiniband/hw/ocrdma
Tom Rix f2bc3af635 RDMA/ocrdma: Fix use after free in ocrdma_dealloc_ucontext_pd()
In ocrdma_dealloc_ucontext_pd() uctx->cntxt_pd is assigned to the variable
pd and then after uctx->cntxt_pd is freed, the variable pd is passed to
function _ocrdma_dealloc_pd() which dereferences pd directly or through
its call to ocrdma_mbx_dealloc_pd().

Reorder the free using the variable pd.

Cc: stable@vger.kernel.org
Fixes: 21a428a019 ("RDMA: Handle PD allocations by IB/core")
Link: https://lore.kernel.org/r/20201230024653.1516495-1-trix@redhat.com
Signed-off-by: Tom Rix <trix@redhat.com>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
2021-01-07 16:37:11 -04:00
..
Kconfig
Makefile
ocrdma.h
ocrdma_ah.c
ocrdma_ah.h
ocrdma_hw.c
ocrdma_hw.h
ocrdma_main.c RDMA: Convert sysfs device * show functions to use sysfs_emit() 2020-10-26 19:53:21 -03:00
ocrdma_sli.h
ocrdma_stats.c
ocrdma_stats.h
ocrdma_verbs.c RDMA/ocrdma: Fix use after free in ocrdma_dealloc_ucontext_pd() 2021-01-07 16:37:11 -04:00
ocrdma_verbs.h