linux/drivers/infiniband/ulp
Nicholas Bellinger ce9a9fc20a iser-target: Fix REJECT CM event use-after-free OOPs
This patch fixes a bug in iser-target code where the REJECT CM event
handler code currently performs a isert_put_conn() for the final
isert_conn->kref put, while iscsi_np process context is still blocked
in isert_get_login_rx().

Once isert_get_login_rx() is awoking due to login timeout, iscsi_np
process context will attempt to invoke iscsi_target_login_sess_out()
to cleanup iscsi_conn as expected, and calls isert_wait_conn() +
isert_free_conn() which triggers the use-after-free OOPs.

To address this bug, move the kref_get_unless_zero() call from
isert_connected_handler() into isert_connect_request() immediately
preceeding isert_rdma_accept() to ensure the CM handler cleanup
paths and isert_free_conn() are always operating with two refs.

Cc: Sagi Grimberg <sagig@mellanox.com>
Cc: <stable@vger.kernel.org> # v3.10+
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2015-07-24 14:19:45 -07:00
..
ipoib IB/core: Change ib_create_cq to use struct ib_cq_init_attr 2015-06-12 14:49:10 -04:00
iser IB/core: Change ib_create_cq to use struct ib_cq_init_attr 2015-06-12 14:49:10 -04:00
isert iser-target: Fix REJECT CM event use-after-free OOPs 2015-07-24 14:19:45 -07:00
srp Minor merge needed, due to function move. 2015-07-01 10:49:25 -07:00
srpt Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending 2015-07-04 14:13:43 -07:00
Makefile IB: Allow build of hw/ and ulp/ subdirectories independently 2014-06-02 14:51:12 -07:00