linux/drivers/infiniband
Mike Marciniszyn d1cff22220 RDMA/qib,hfi1: Fix MR reference count leak on write with immediate
commit 1feb40067c upstream.

The handling of IB_RDMA_WRITE_ONLY_WITH_IMMEDIATE will leak a memory
reference when a buffer cannot be allocated for returning the immediate
data.

The issue is that the rkey validation has already occurred and the RNR
nak fails to release the reference that was fruitlessly gotten.  The
the peer will send the identical single packet request when its RNR
timer pops.

The fix is to release the held reference prior to the rnr nak exit.
This is the only sequence the requires both rkey validation and the
buffer allocation on the same packet.

Tested-by: Tadeusz Struk <tadeusz.struk@intel.com>
Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2017-06-07 12:07:49 +02:00
..
core infiniband: call ipv6 route lookup via the stub interface 2017-05-25 15:44:32 +02:00
hw RDMA/qib,hfi1: Fix MR reference count leak on write with immediate 2017-06-07 12:07:49 +02:00
sw IB/rxe: Fix mem_check_range integer overflow 2017-02-14 15:25:42 -08:00
ulp IB/IPoIB: ibX: failed to create mcg debug file 2017-05-20 14:28:38 +02:00
Kconfig qedr: Add RoCE driver framework 2016-10-14 15:00:10 -04:00
Makefile IB/rdmavt: Create module framework and handle driver registration 2016-03-10 20:37:04 -05:00