All of lore.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>,
	Maor Gottlieb <maorg@nvidia.com>,
	Bart Van Assche <bvanassche@acm.org>,
	<linux-rdma@vger.kernel.org>,
	"Nicholas A. Bellinger" <nab@risingtidesystems.com>,
	<target-devel@vger.kernel.org>
Subject: Re: [PATCH rdma-next v2] IB/srpt: Fix memory leak in srpt_add_one
Date: Mon, 2 Nov 2020 15:25:21 -0400	[thread overview]
Message-ID: <20201102192521.GA3710231@nvidia.com> (raw)
In-Reply-To: <20201028065051.112430-1-leon@kernel.org>

On Wed, Oct 28, 2020 at 08:50:51AM +0200, Leon Romanovsky wrote:
> From: Maor Gottlieb <maorg@nvidia.com>
> 
> Failure in srpt_refresh_port() for the second port will leave MAD
> registered for the first one, however, the srpt_add_one() will be
> marked as "failed" and SRPT will leak resources for that registered
> but not used and released first port.
> 
> Unregister the MAD agent for all ports in case of failure.
> 
> Fixes: a42d985bd5b2 ("ib_srpt: Initial SRP Target merge for v3.3-rc1")
> Signed-off-by: Maor Gottlieb <maorg@nvidia.com>
> Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
> Reviewed-by: Bart Van Assche <bvanassche@acm.org>
> ---
> Changelog:
> v2:
>  * Added an extra parameter to srpt_unregister_mad_agent() to eliminate
>    an extra obfuscation call.
> v1:
> https://lore.kernel.org/linux-rdma/20201027055920.1760663-1-leon@kernel.org
>  * Fixed and updated commit message.
>  * Remove port_cnt check from __srpt_unregister_mad_agent().
> v0:
> https://lore.kernel.org/linux-rdma/20201026132737.1338171-1-leon@kernel.org
> ---
>  drivers/infiniband/ulp/srpt/ib_srpt.c | 13 ++++++++-----
>  1 file changed, 8 insertions(+), 5 deletions(-)

Applied to for-rc, thanks

Jason

WARNING: multiple messages have this Message-ID (diff)
From: Jason Gunthorpe <jgg@nvidia.com>
To: Leon Romanovsky <leon@kernel.org>
Cc: Doug Ledford <dledford@redhat.com>,
	Maor Gottlieb <maorg@nvidia.com>,
	Bart Van Assche <bvanassche@acm.org>,
	linux-rdma@vger.kernel.org,
	"Nicholas A. Bellinger" <nab@risingtidesystems.com>,
	target-devel@vger.kernel.org
Subject: Re: [PATCH rdma-next v2] IB/srpt: Fix memory leak in srpt_add_one
Date: Mon, 02 Nov 2020 19:25:21 +0000	[thread overview]
Message-ID: <20201102192521.GA3710231@nvidia.com> (raw)
In-Reply-To: <20201028065051.112430-1-leon@kernel.org>

On Wed, Oct 28, 2020 at 08:50:51AM +0200, Leon Romanovsky wrote:
> From: Maor Gottlieb <maorg@nvidia.com>
> 
> Failure in srpt_refresh_port() for the second port will leave MAD
> registered for the first one, however, the srpt_add_one() will be
> marked as "failed" and SRPT will leak resources for that registered
> but not used and released first port.
> 
> Unregister the MAD agent for all ports in case of failure.
> 
> Fixes: a42d985bd5b2 ("ib_srpt: Initial SRP Target merge for v3.3-rc1")
> Signed-off-by: Maor Gottlieb <maorg@nvidia.com>
> Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
> Reviewed-by: Bart Van Assche <bvanassche@acm.org>
> ---
> Changelog:
> v2:
>  * Added an extra parameter to srpt_unregister_mad_agent() to eliminate
>    an extra obfuscation call.
> v1:
> https://lore.kernel.org/linux-rdma/20201027055920.1760663-1-leon@kernel.org
>  * Fixed and updated commit message.
>  * Remove port_cnt check from __srpt_unregister_mad_agent().
> v0:
> https://lore.kernel.org/linux-rdma/20201026132737.1338171-1-leon@kernel.org
> ---
>  drivers/infiniband/ulp/srpt/ib_srpt.c | 13 ++++++++-----
>  1 file changed, 8 insertions(+), 5 deletions(-)

Applied to for-rc, thanks

Jason

  parent reply	other threads:[~2020-11-02 19:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-28  6:50 [PATCH rdma-next v2] IB/srpt: Fix memory leak in srpt_add_one Leon Romanovsky
2020-10-28  6:50 ` Leon Romanovsky
2020-10-29  3:31 ` Bart Van Assche
2020-10-29  3:31   ` Bart Van Assche
2020-11-02 19:25 ` Jason Gunthorpe [this message]
2020-11-02 19:25   ` Jason Gunthorpe

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=20201102192521.GA3710231@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=bvanassche@acm.org \
    --cc=dledford@redhat.com \
    --cc=leon@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=maorg@nvidia.com \
    --cc=nab@risingtidesystems.com \
    --cc=target-devel@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.