All of lore.kernel.org
 help / color / mirror / Atom feed
From: Saravanan Vajravel <saravanan.vajravel@broadcom.com>
To: Sagi Grimberg <sagi@grimberg.me>,
	Selvin Xavier <selvin.xavier@broadcom.com>,
	jgg@ziepe.ca, leon@kernel.org
Cc: linux-rdma@vger.kernel.org
Subject: RE: [PATCH for-rc 2/3] IB/isert: Fix possible list corruption in CMA handler
Date: Tue, 6 Jun 2023 15:59:18 +0530	[thread overview]
Message-ID: <e466ac917c2a949c93fee9a8d147cefb@mail.gmail.com> (raw)
In-Reply-To: <150253ed-5fd5-9404-7792-bc14f210cdd3@grimberg.me>

[-- Attachment #1: Type: text/plain, Size: 1269 bytes --]

> > When ib_isert module receives connection error event, it is releasing
> > the isert session and removes corresponding list node but it doesn't
> > take appropriate mutex lock to remove the list node.  This can lead to
> > linked  list corruption
> >
> > Signed-off-by: Saravanan Vajravel <saravanan.vajravel@broadcom.com>
> > Signed-off-by: Selvin Xavier <selvin.xavier@broadcom.com>
> > ---
> >   drivers/infiniband/ulp/isert/ib_isert.c | 4 ++++
> >   1 file changed, 4 insertions(+)
> >
> diff --git a/drivers/infiniband/ulp/isert/ib_isert.c
> b/drivers/infiniband/ulp/isert/ib_isert.c
> index b3471ac82c1a..64af8d966adf 100644
> --- a/drivers/infiniband/ulp/isert/ib_isert.c
> +++ b/drivers/infiniband/ulp/isert/ib_isert.c
> @@ -657,11 +657,15 @@ static int
>   isert_connect_error(struct rdma_cm_id *cma_id)
>   {
>   	struct isert_conn *isert_conn = cma_id->qp->qp_context;
> +	struct isert_np *isert_np = cma_id->context;
>
>   	ib_drain_qp(isert_conn->qp);
> +
> +	mutex_lock(&isert_np->mutex);
>   	list_del_init(&isert_conn->node);
>   	isert_conn->cm_id = NULL;
>   	isert_put_conn(isert_conn);
> +	mutex_unlock(&isert_np->mutex);

> I'd place the mutex on the list_del_init only, it does not protect the
> rest.

Addressed this comment and sent v3 patch

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4227 bytes --]

  reply	other threads:[~2023-06-06 10:29 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-01  9:42 [PATCH for-rc 0/3] IB/isert Bug fixes in ib_isert Saravanan Vajravel
2023-06-01  9:42 ` [PATCH for-rc 1/3] IB/isert: Fix dead lock " Saravanan Vajravel
2023-06-02  2:38   ` kernel test robot
2023-06-05 22:46     ` Sagi Grimberg
2023-06-02  3:09   ` kernel test robot
2023-06-05 22:45   ` Sagi Grimberg
2023-06-01  9:42 ` [PATCH for-rc 2/3] IB/isert: Fix possible list corruption in CMA handler Saravanan Vajravel
2023-06-05 22:48   ` Sagi Grimberg
2023-06-06 10:29     ` Saravanan Vajravel [this message]
2023-06-01  9:42 ` [PATCH for-rc 3/3] IB/isert: Fix incorrect release of isert connextion Saravanan Vajravel
2023-06-05 22:51   ` Sagi Grimberg
2023-06-01 17:36 ` [PATCH for-rc 0/3] IB/isert Bug fixes in ib_isert Jason Gunthorpe
2023-06-02 11:01   ` Saravanan Vajravel
2023-06-05 22:53     ` Sagi Grimberg
2023-06-05 22:54       ` Sagi Grimberg

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=e466ac917c2a949c93fee9a8d147cefb@mail.gmail.com \
    --to=saravanan.vajravel@broadcom.com \
    --cc=jgg@ziepe.ca \
    --cc=leon@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=sagi@grimberg.me \
    --cc=selvin.xavier@broadcom.com \
    /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.