android_kernel_oneplus_msm8998/drivers/infiniband/hw
Mike Marciniszyn 746d48934f RDMA/qib,hfi1: Fix MR reference count leak on write with immediate
commit 1feb40067cf04ae48d65f728d62ca255c9449178 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.

Cc: Stable <stable@vger.kernel.org> # 4.7+
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>
2017-06-14 13:16:27 +02:00
..
cxgb3 iw_cxgb3: Fix incorrectly returning error on success 2016-03-03 15:07:10 -08:00
cxgb4 RDMA/iw_cxgb4: Fix bar2 virt addr calculation for T4 chips 2016-05-11 11:21:09 +02:00
mlx4 IB/mlx4: Reduce SRIOV multicast cleanup warning message to debug level 2017-05-20 14:27:01 +02:00
mlx5 IB/mlx5: Wait for all async command completions to complete 2017-01-26 08:23:46 +01:00
mthca Merge branch 'wr-cleanup' into k.o/for-4.4 2015-10-28 22:23:34 -04:00
nes Initial 4.4 merge window submission 2015-11-07 13:33:07 -08:00
ocrdma RDMA/ocrdma: Depend on async link events from CNA 2015-12-28 11:45:54 -05:00
qib RDMA/qib,hfi1: Fix MR reference count leak on write with immediate 2017-06-14 13:16:27 +02:00
usnic usnic: correctly handle kzalloc return value 2015-10-21 16:41:19 -04:00
Makefile IB/ehca: Deprecate driver, move to staging, schedule deletion 2015-09-11 18:13:35 -04:00