linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stratos Psomadakis <psomas@gentoo.org>
To: linux-scsi@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org,
	JBottomley@parallels.com, matthew@wil.cx, Martin.vGagern@gmx.net
Subject: Re: [PATCH] scsi/sym53c8xx_2: Fix NULL pointer dereference in slave_destroy
Date: Thu, 08 Dec 2011 23:15:14 +0200	[thread overview]
Message-ID: <4EE128E2.9050305@gentoo.org> (raw)
In-Reply-To: <1322958234-9749-1-git-send-email-psomas@gentoo.org>

On 12/04/2011 02:23 AM, psomas@gentoo.org wrote:
> From: Stratos Psomadakis <psomas@gentoo.org>
>
> sym53c8xx_slave_destroy unconditionally assumes that sym53c8xx_slave_alloc has
> succesesfully allocated a sym_lcb. This can lead to a NULL pointer dereference
> (exposed by commit 4e6c82b).
>
> Signed-off-by: Stratos Psomadakis <psomas@gentoo.org>
> Cc: stable@vger.kernel.org
> ---
>
>  drivers/scsi/sym53c8xx_2/sym_glue.c |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/scsi/sym53c8xx_2/sym_glue.c b/drivers/scsi/sym53c8xx_2/sym_glue.c
> index b4543f5..76432f8 100644
> --- a/drivers/scsi/sym53c8xx_2/sym_glue.c
> +++ b/drivers/scsi/sym53c8xx_2/sym_glue.c
> @@ -839,6 +839,10 @@ static void sym53c8xx_slave_destroy(struct scsi_device *sdev)
>  	struct sym_lcb *lp = sym_lp(tp, sdev->lun);
>  	unsigned long flags;
>  
> +	/* if slave_alloc returned before allocating a sym_lcb, return */
> +	if (!lp)
> +		return;
> +
>  	spin_lock_irqsave(np->s.host->host_lock, flags);
>  
>  	if (lp->busy_itlq || lp->busy_itl) {
Any comments/ack/nack on the patch?

Thanks,

-- 
Stratos Psomadakis
<psomas@gentoo.org>

  parent reply	other threads:[~2011-12-08 21:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-04  0:23 [PATCH] scsi/sym53c8xx_2: Fix NULL pointer dereference in slave_destroy psomas
2011-12-04 17:38 ` Stratos Psomadakis
2011-12-08 21:15 ` Stratos Psomadakis [this message]
2011-12-24  1:20 ` Stratos Psomadakis
  -- strict thread matches above, loose matches on Subject: below --
2011-12-19 22:57 Chris Pitzel

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=4EE128E2.9050305@gentoo.org \
    --to=psomas@gentoo.org \
    --cc=JBottomley@parallels.com \
    --cc=Martin.vGagern@gmx.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=matthew@wil.cx \
    --cc=stable@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).