All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stratos Psomadakis <psomas@gentoo.org>
To: JBottomley@parallels.com, matthew@wil.cx,
	James.Bottomley@HansenPartnership.com
Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
	stable@vger.kernel.org, Martin.vGagern@gmx.net,
	kernel@gentoo.org
Subject: Re: [PATCH] scsi/sym53c8xx_2: Fix NULL pointer dereference in slave_destroy
Date: Sat, 24 Dec 2011 03:20:12 +0200	[thread overview]
Message-ID: <4EF528CC.1020800@gentoo.org> (raw)
In-Reply-To: <1322958234-9749-1-git-send-email-psomas@gentoo.org>

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

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) {
resent (directly to the SCSI and sym53c8xx_2 maintainers)

-- 
Stratos Psomadakis
<psomas@gentoo.org>



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]

  parent reply	other threads:[~2011-12-24  1:20 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
2011-12-24  1:20 ` Stratos Psomadakis [this message]
  -- 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=4EF528CC.1020800@gentoo.org \
    --to=psomas@gentoo.org \
    --cc=JBottomley@parallels.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=Martin.vGagern@gmx.net \
    --cc=kernel@gentoo.org \
    --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 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.