]> git.baikalelectronics.ru Git - kernel.git/commit
RDMA/irdma: Fix a user-after-free in add_pble_prm
authorShiraz Saleem <shiraz.saleem@intel.com>
Tue, 7 Dec 2021 15:21:36 +0000 (09:21 -0600)
committerJason Gunthorpe <jgg@nvidia.com>
Tue, 7 Dec 2021 17:43:52 +0000 (13:43 -0400)
commitbd439ec6639b96d984ecdd7e1666404da4b09fa2
treed0ced435a66d347a53fb95f210093641a0164d48
parent09bf09b928bbdcd15521b11bb77f022c04674d37
RDMA/irdma: Fix a user-after-free in add_pble_prm

When irdma_hmc_sd_one fails, 'chunk' is freed while its still on the PBLE
info list.

Add the chunk entry to the PBLE info list only after successful setting of
the SD in irdma_hmc_sd_one.

Fixes: ca2d9c2dc1dd ("RDMA/irdma: Add PBLE resource manager")
Link: https://lore.kernel.org/r/20211207152135.2192-1-shiraz.saleem@intel.com
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/hw/irdma/pble.c