]> 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)
commitabbc8f8f95e7d775431b58994f52b813d79013f2
tree78f5e39aff67d8d18ab430d69b20e281af673439
parent4aa933369eee11a3ed5f1b79a210438d49269527
RDMA/rdmavt: Catch use-after-free access of AH structures

Prior to commit 77d0dbcf55c9 ("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