]> asedeno.scripts.mit.edu Git - linux.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)
commit3a4ef2e2b5cf9a34bcc66c0d33f7eba180a14535
tree78f5e39aff67d8d18ab430d69b20e281af673439
parent943bd984b108b3bb778790c2da4ae8d186b547e6
RDMA/rdmavt: Catch use-after-free access of AH structures

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