All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Metzmacher <metze@samba.org>
To: Bernard Metzler <bmt@zurich.ibm.com>
Cc: linux-rdma@vger.kernel.org, Stefan Metzmacher <metze@samba.org>
Subject: [PATCH 00/31] rdma/siw: fix a lot of deadlocks and use after free bugs
Date: Fri,  7 May 2021 01:36:06 +0200	[thread overview]
Message-ID: <cover.1620343860.git.metze@samba.org> (raw)

Hi Bernard,

while testing with my smbdirect driver I hit a lot of
bugs in the siw.ko driver. They all cause problems where
the siw driver was not able to unload anymore and I had to
reboot the machine.

I implemented:
- a non blocking connect
- fixed a lot of bugs where siw_cep_put() was called too often.
- fixed bugs where siw_cm_upcall() confused the core IWCM logic

I have some more changes to follow, but I wanted to send them
finally out after having them one and a half year sitting in some
private branch...

Stefan Metzmacher (31):
  rdma/siw: fix warning in siw_proc_send()
  rdma/siw: call smp_mb() after mem->stag_valid = 0 in
    siw_invalidate_stag() too
  rdma/siw: remove superfluous siw_cep_put() from siw_connect() error
    path
  rdma/siw: let siw_accept() deferr RDMA_MODE until EVENT_ESTABLISHED
  rdma/siw: make use of kernel_{bind,connect,listen}()
  rdma/siw: make siw_cm_upcall() a noop without valid 'id'
  rdma/siw: split out a __siw_cep_terminate_upcall() function
  rdma/siw: use __siw_cep_terminate_upcall() for indirect
    SIW_CM_WORK_CLOSE_LLP
  rdma/siw: use __siw_cep_terminate_upcall() for SIW_CM_WORK_PEER_CLOSE
  rdma/siw: use __siw_cep_terminate_upcall() for SIW_CM_WORK_MPATIMEOUT
  rdma/siw: introduce SIW_EPSTATE_ACCEPTING/REJECTING for
    rdma_accept/rdma_reject
  rdma/siw: add some debugging of state and sk_state to the teardown
    process
  rdma/siw: handle SIW_EPSTATE_CONNECTING in
    __siw_cep_terminate_upcall()
  rdma/siw: let siw_connect() set AWAIT_MPAREP before
    siw_send_mpareqrep()
  rdma/siw: create a temporary copy of private data
  rdma/siw: use error and out logic at the end of siw_connect()
  rdma/siw: start mpa timer before calling siw_send_mpareqrep()
  rdma/siw: call the blocking kernel_bindconnect() just before
    siw_send_mpareqrep()
  rdma/siw: split out a __siw_cep_close() function
  rdma/siw: implement non-blocking connect.
  rdma/siw: let siw_listen_address() call siw_cep_alloc() first
  rdma/siw: let siw_listen_address() call siw_cep_set_inuse() early
  rdma/siw: make use of __siw_cep_close() in siw_accept()
  rdma/siw: do the full disassociation of cep and qp in
    siw_qp_llp_close()
  rdma/siw: fix double siw_cep_put() in siw_cm_work_handler()
  rdma/siw: make use of __siw_cep_close() in siw_cm_work_handler()
  rdma/siw: fix the "close" logic in siw_qp_cm_drop()
  rdma/siw: make use of __siw_cep_close() in siw_qp_cm_drop()
  rdma/siw: make use of __siw_cep_close() in siw_reject()
  rdma/siw: make use of __siw_cep_close() in siw_listen_address()
  rdma/siw: make use of __siw_cep_close() in siw_drop_listeners()

 drivers/infiniband/sw/siw/siw_cm.c    | 537 +++++++++++++++-----------
 drivers/infiniband/sw/siw/siw_cm.h    |   3 +
 drivers/infiniband/sw/siw/siw_mem.c   |   2 +
 drivers/infiniband/sw/siw/siw_qp.c    |   3 +
 drivers/infiniband/sw/siw/siw_qp_rx.c |   2 +-
 5 files changed, 316 insertions(+), 231 deletions(-)

-- 
2.25.1


             reply	other threads:[~2021-05-06 23:37 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-06 23:36 Stefan Metzmacher [this message]
2021-05-06 23:36 ` [PATCH 01/31] rdma/siw: fix warning in siw_proc_send() Stefan Metzmacher
2021-05-06 23:36 ` [PATCH 02/31] rdma/siw: call smp_mb() after mem->stag_valid = 0 in siw_invalidate_stag() too Stefan Metzmacher
2021-05-06 23:36 ` [PATCH 03/31] rdma/siw: remove superfluous siw_cep_put() from siw_connect() error path Stefan Metzmacher
2021-05-06 23:36 ` [PATCH 04/31] rdma/siw: let siw_accept() deferr RDMA_MODE until EVENT_ESTABLISHED Stefan Metzmacher
2021-05-06 23:36 ` [PATCH 05/31] rdma/siw: make use of kernel_{bind,connect,listen}() Stefan Metzmacher
2021-05-06 23:36 ` [PATCH 06/31] rdma/siw: make siw_cm_upcall() a noop without valid 'id' Stefan Metzmacher
2021-05-06 23:36 ` [PATCH 07/31] rdma/siw: split out a __siw_cep_terminate_upcall() function Stefan Metzmacher
2021-05-06 23:36 ` [PATCH 08/31] rdma/siw: use __siw_cep_terminate_upcall() for indirect SIW_CM_WORK_CLOSE_LLP Stefan Metzmacher
2021-05-06 23:36 ` [PATCH 09/31] rdma/siw: use __siw_cep_terminate_upcall() for SIW_CM_WORK_PEER_CLOSE Stefan Metzmacher
2021-05-06 23:36 ` [PATCH 10/31] rdma/siw: use __siw_cep_terminate_upcall() for SIW_CM_WORK_MPATIMEOUT Stefan Metzmacher
2021-05-06 23:36 ` [PATCH 11/31] rdma/siw: introduce SIW_EPSTATE_ACCEPTING/REJECTING for rdma_accept/rdma_reject Stefan Metzmacher
2021-05-06 23:36 ` [PATCH 12/31] rdma/siw: add some debugging of state and sk_state to the teardown process Stefan Metzmacher
2021-05-06 23:36 ` [PATCH 13/31] rdma/siw: handle SIW_EPSTATE_CONNECTING in __siw_cep_terminate_upcall() Stefan Metzmacher
2021-05-06 23:36 ` [PATCH 14/31] rdma/siw: let siw_connect() set AWAIT_MPAREP before siw_send_mpareqrep() Stefan Metzmacher
2021-05-06 23:36 ` [PATCH 15/31] rdma/siw: create a temporary copy of private data Stefan Metzmacher
2021-05-06 23:36 ` [PATCH 16/31] rdma/siw: use error and out logic at the end of siw_connect() Stefan Metzmacher
2021-05-06 23:36 ` [PATCH 17/31] rdma/siw: start mpa timer before calling siw_send_mpareqrep() Stefan Metzmacher
2021-05-06 23:36 ` [PATCH 18/31] rdma/siw: call the blocking kernel_bindconnect() just before siw_send_mpareqrep() Stefan Metzmacher
2021-05-06 23:36 ` [PATCH 19/31] rdma/siw: split out a __siw_cep_close() function Stefan Metzmacher
2021-05-06 23:36 ` [PATCH 20/31] rdma/siw: implement non-blocking connect Stefan Metzmacher
2021-05-06 23:36 ` [PATCH 21/31] rdma/siw: let siw_listen_address() call siw_cep_alloc() first Stefan Metzmacher
2021-05-06 23:36 ` [PATCH 22/31] rdma/siw: let siw_listen_address() call siw_cep_set_inuse() early Stefan Metzmacher
2021-05-06 23:36 ` [PATCH 23/31] rdma/siw: make use of __siw_cep_close() in siw_accept() Stefan Metzmacher
2021-05-06 23:36 ` [PATCH 24/31] rdma/siw: do the full disassociation of cep and qp in siw_qp_llp_close() Stefan Metzmacher
2021-05-06 23:36 ` [PATCH 25/31] rdma/siw: fix double siw_cep_put() in siw_cm_work_handler() Stefan Metzmacher
2021-05-06 23:36 ` [PATCH 26/31] rdma/siw: make use of __siw_cep_close() " Stefan Metzmacher
2021-05-06 23:36 ` [PATCH 27/31] rdma/siw: fix the "close" logic in siw_qp_cm_drop() Stefan Metzmacher
2021-05-06 23:36 ` [PATCH 28/31] rdma/siw: make use of __siw_cep_close() " Stefan Metzmacher
2021-05-06 23:36 ` [PATCH 29/31] rdma/siw: make use of __siw_cep_close() in siw_reject() Stefan Metzmacher
2021-05-06 23:36 ` [PATCH 30/31] rdma/siw: make use of __siw_cep_close() in siw_listen_address() Stefan Metzmacher
2021-05-06 23:36 ` [PATCH 31/31] rdma/siw: make use of __siw_cep_close() in siw_drop_listeners() Stefan Metzmacher
2021-05-07 12:08 ` [PATCH 00/31] rdma/siw: fix a lot of deadlocks and use after free bugs Bernard Metzler
2021-05-26 15:43   ` Stefan Metzmacher
2021-05-28 14:35   ` Bernard Metzler
2021-05-07 12:15 ` [PATCH 01/31] rdma/siw: fix warning in siw_proc_send() Bernard Metzler
2021-05-07 13:52 ` [PATCH 03/31] rdma/siw: remove superfluous siw_cep_put() from siw_connect() error path Bernard Metzler
2021-05-11 11:31 ` [PATCH 02/31] rdma/siw: call smp_mb() after mem->stag_valid = 0 in siw_invalidate_stag() too Bernard Metzler
2021-05-11 11:36 ` [PATCH 05/31] rdma/siw: make use of kernel_{bind,connect,listen}() Bernard Metzler
2021-05-11 11:38 ` [PATCH 04/31] rdma/siw: let siw_accept() deferr RDMA_MODE until EVENT_ESTABLISHED Bernard Metzler
2021-05-11 11:42 ` [PATCH 06/31] rdma/siw: make siw_cm_upcall() a noop without valid 'id' Bernard Metzler
2021-05-11 11:55 ` [PATCH 07/31] rdma/siw: split out a __siw_cep_terminate_upcall() function Bernard Metzler
2021-05-11 11:56 ` [PATCH 08/31] rdma/siw: use __siw_cep_terminate_upcall() for indirect SIW_CM_WORK_CLOSE_LLP Bernard Metzler
2021-05-11 12:00 ` [PATCH 09/31] rdma/siw: use __siw_cep_terminate_upcall() for SIW_CM_WORK_PEER_CLOSE Bernard Metzler
2021-05-11 12:01 ` [PATCH 10/31] rdma/siw: use __siw_cep_terminate_upcall() for SIW_CM_WORK_MPATIMEOUT Bernard Metzler
2021-05-11 12:03 ` [PATCH 11/31] rdma/siw: introduce SIW_EPSTATE_ACCEPTING/REJECTING for rdma_accept/rdma_reject Bernard Metzler
2021-05-11 12:07 ` [PATCH 12/31] rdma/siw: add some debugging of state and sk_state to the teardown process Bernard Metzler
2021-05-11 12:15 ` [PATCH 15/31] rdma/siw: create a temporary copy of private data Bernard Metzler
2021-05-11 12:18 ` [PATCH 16/31] rdma/siw: use error and out logic at the end of siw_connect() Bernard Metzler
2021-05-11 12:20 ` [PATCH 17/31] rdma/siw: start mpa timer before calling siw_send_mpareqrep() Bernard Metzler
2021-05-11 12:25 ` [PATCH 19/31] rdma/siw: split out a __siw_cep_close() function Bernard Metzler
2021-05-11 12:31 ` [PATCH 20/31] rdma/siw: implement non-blocking connect Bernard Metzler
2021-05-11 12:42 ` [PATCH 22/31] rdma/siw: let siw_listen_address() call siw_cep_set_inuse() early Bernard Metzler
2021-05-11 12:43 ` [PATCH 23/31] rdma/siw: make use of __siw_cep_close() in siw_accept() Bernard Metzler
2021-05-11 12:47 ` [PATCH 24/31] rdma/siw: do the full disassociation of cep and qp in siw_qp_llp_close() Bernard Metzler
2021-05-11 12:58 ` [PATCH 25/31] rdma/siw: fix double siw_cep_put() in siw_cm_work_handler() Bernard Metzler
2021-05-11 13:02 ` [PATCH 27/31] rdma/siw: fix the "close" logic in siw_qp_cm_drop() Bernard Metzler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1620343860.git.metze@samba.org \
    --to=metze@samba.org \
    --cc=bmt@zurich.ibm.com \
    --cc=linux-rdma@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.