iser-target: Fix possible use-after-free in connection establishment error
authorSagi Grimberg <sagi@grimberg.me>
Sun, 26 Nov 2017 13:31:04 +0000 (15:31 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 23 Jan 2018 18:58:12 +0000 (19:58 +0100)
commit9ace222b5db287645bbe6c5531201750d3fbe493
tree9751a9c1d8061d70638f8d6c131ef3f60a3476d2
parent754705d8e0e12c05310117dd42ff3eb2681365fd
iser-target: Fix possible use-after-free in connection establishment error

commit cd52cb26e7ead5093635e98e07e221e4df482d34 upstream.

In case we fail to establish the connection we must drain our pre-posted
login recieve work request before continuing safely with connection
teardown.

Fixes: a060b5629ab0 ("IB/core: generic RDMA READ/WRITE API")
Reported-by: Amrani, Ram <Ram.Amrani@cavium.com>
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/infiniband/ulp/isert/ib_isert.c