]> git.baikalelectronics.ru Git - kernel.git/commit
RDMA/rdmavt: Catch use-after-free access of AH structures
authorLeon Romanovsky <leonro@mellanox.com>
Tue, 16 Apr 2019 12:13:10 +0000 (15:13 +0300)
committerJason Gunthorpe <jgg@mellanox.com>
Mon, 6 May 2019 15:06:54 +0000 (12:06 -0300)
commit07574715fd11b686b0159410f0c989e68fb0294a
tree78f5e39aff67d8d18ab430d69b20e281af673439
parent41095d2d2b53b9fe4faba98bc7618d3afe7084fc
RDMA/rdmavt: Catch use-after-free access of AH structures

Prior to commit dc30a87ccbb8 ("RDMA: Handle AH allocations by IB/core"),
AH destroy path is rdmavt returned -EBUSY warning to application and
caused to potential leakage of kernel memory of AH structure.

After that commit, the AH structure is always freed but such early return
in driver code can potentially cause to use-after-free error.

Add warning to catch such situation to help driver developers to fix AH
release path.

Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/sw/rdmavt/ah.c