All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sagi Grimberg <sagig@dev.mellanox.co.il>
To: linux-scsi@vger.kernel.org, Mike Christie <michaelc@cs.wisc.edu>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Subject: Re: [PATCH] iscsi: Fix iscsi endpoints leak
Date: Tue, 02 Jun 2015 18:21:54 +0300	[thread overview]
Message-ID: <556DCA12.3070903@dev.mellanox.co.il> (raw)
In-Reply-To: <1432114738-967-1-git-send-email-sagig@mellanox.com>

On 5/20/2015 12:38 PM, Sagi Grimberg wrote:
> When creating a new endpoint, we look for a free id
> for the new endpoint. We baisically loop on possible ids
> and use the first id that class_find_device() returns NULL.
> However, we are missing a reference put when class_find_device()
> does find an existing device for a given id.
>
> Reported-by: Alex Lyakas <alex@zadarastorage.com>
> Signed-off-by: Sagi Grimberg <sagig@mellanox.com>
> ---
>   drivers/scsi/scsi_transport_iscsi.c |    2 ++
>   1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c
> index 67d43e3..55647aa 100644
> --- a/drivers/scsi/scsi_transport_iscsi.c
> +++ b/drivers/scsi/scsi_transport_iscsi.c
> @@ -204,6 +204,8 @@ iscsi_create_endpoint(int dd_size)
>   					iscsi_match_epid);
>   		if (!dev)
>   			break;
> +		else
> +			put_device(dev);
>   	}
>   	if (id == ISCSI_MAX_EPID) {
>   		printk(KERN_ERR "Too many connections. Max supported %u\n",
>

ping?

Mike, can I get a review on this one?

I think this leak existed since this code was introduced
in 2.6.37, but I've only tested back to 3.10.

So I think this deserves a CC to stable 3.10+

  reply	other threads:[~2015-06-02 15:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-20  9:38 [PATCH] iscsi: Fix iscsi endpoints leak Sagi Grimberg
2015-06-02 15:21 ` Sagi Grimberg [this message]
2015-06-02 17:23 ` Mike Christie

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=556DCA12.3070903@dev.mellanox.co.il \
    --to=sagig@dev.mellanox.co.il \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=michaelc@cs.wisc.edu \
    /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.