public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: Leon Romanovsky <leon@kernel.org>
Cc: Doug Ledford <dledford@redhat.com>,
	Mark Zhang <markzhang@nvidia.com>,
	linux-rdma@vger.kernel.org
Subject: Re: [PATCH rdma-next 2/6] IB/cm: Remove "mad_agent" parameter of ib_cancel_mad
Date: Fri, 26 Mar 2021 17:24:07 -0300	[thread overview]
Message-ID: <20210326202407.GA938816@nvidia.com> (raw)
In-Reply-To: <20210318100309.670344-3-leon@kernel.org>

On Thu, Mar 18, 2021 at 12:03:05PM +0200, Leon Romanovsky wrote:

> +/**
> + * ib_cancel_mad - Cancels an outstanding send MAD operation.
> + * @send_buf: Indicates the MAD to cancel.
> + *
> + * MADs will be returned to the user through the corresponding
> + * ib_mad_send_handler.
> + */
> +static inline void ib_cancel_mad(struct ib_mad_send_buf *send_buf)
> +{
> +	ib_modify_mad(send_buf->mad_agent, send_buf, 0);

This needs to check for a NULL send_buf, most of the calls are just
blindly passing cm_priv_id->msg which can become NULL in a racey way
in a few places.

Jason

  reply	other threads:[~2021-03-26 20:25 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-18 10:03 [PATCH rdma-next 0/6] Fix memory corruption in CM Leon Romanovsky
2021-03-18 10:03 ` [PATCH rdma-next 1/6] Revert "IB/cm: Mark stale CM id's whenever the mad agent was unregistered" Leon Romanovsky
2021-03-18 10:03 ` [PATCH rdma-next 2/6] IB/cm: Remove "mad_agent" parameter of ib_cancel_mad Leon Romanovsky
2021-03-26 20:24   ` Jason Gunthorpe [this message]
2021-03-18 10:03 ` [PATCH rdma-next 3/6] IB/cm: Remove "mad_agent" parameter of ib_modify_mad Leon Romanovsky
2021-03-29 12:41   ` Jason Gunthorpe
2021-04-01  8:12     ` Leon Romanovsky
2021-03-18 10:03 ` [PATCH rdma-next 4/6] IB/cm: Clear all associated AV's ports when remove a cm device Leon Romanovsky
2021-03-18 10:03 ` [PATCH rdma-next 5/6] IB/cm: Add lock protection when access av/alt_av's port of a cm_id Leon Romanovsky
2021-03-18 10:03 ` [PATCH rdma-next 6/6] IB/cm: Initialize av before acquire the spin lock in cm_lap_handler Leon Romanovsky

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=20210326202407.GA938816@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=dledford@redhat.com \
    --cc=leon@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=markzhang@nvidia.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox