linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@suse.de>
To: Jens Axboe <jaxboe@fusionio.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	Alexey Dobriyan <adobriyan@gmail.com>,
	FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>,
	"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
	"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: 2.6.36-rc3: EIP is at scsi_init_io+...
Date: Thu, 09 Sep 2010 12:30:09 -0500	[thread overview]
Message-ID: <1284053409.20480.62.camel@mulgrave.site> (raw)
In-Reply-To: <4C88D841.3070100@fusionio.com>

On Thu, 2010-09-09 at 14:51 +0200, Jens Axboe wrote:
> On 2010-09-09 14:47, James Bottomley wrote:
> > On Wed, 2010-09-08 at 17:12 -0700, Linus Torvalds wrote:
> >> Hmm. No noise about this one.
> >>
> >> Jens, Fujita, James, any comments?
> >>
> >> On Mon, Aug 30, 2010 at 11:46 AM, Alexey Dobriyan <adobriyan@gmail.com> wrote:
> >>> Not much of a calltrace, it scrolled away because of hardlockup detector.
> >>> On the bright side, radeon KMS worked correctly and actually showed it.
> >>>
> >>> $ addr2line -e vmlinux ffffffff812d207b
> >>> drivers/scsi/scsi_lib.c:1015
> >>>
> >>>  1012  err_exit:
> >>>  1013          scsi_release_buffers(cmd);
> >>>  1014          scsi_put_command(cmd);
> >>>  1015  ===>    cmd->request->special = NULL; <===
> >>>  1016          return error;
> >>>  1017  }
> >>>  1018  EXPORT_SYMBOL(scsi_init_io);
> >>
> >> I do have to say that it looks rather wrong that it accesses "cmd"
> >> after it has done the "scsi_put_command(cmd)" on it.
> >>
> >> I also note that that was introduced pretty recently by commit
> >> 610a63498f7 ("scsi: fix discard page leak"), merged during this merge
> >> window. That does look suspicious to me.
> > 
> > It's a use after free:  The put actually frees the cmnd and then we use
> > it to get to the request.  Most of the time nothing notices, but if you
> > have poison on free enabled, we may see the problem.  The fix is just to
> > reverse the put and the set.
> 
> You are right, I misspoke in my original reply. It's clearing the
> request field, not the command field (which would be bogus of course).

Embarrassingly enough, Tejun spotted this a month ago, and I actually
created a patch and then forgot to apply it.  I've just pushed it out to
the rc-fixes branch:

http://marc.info/?l=linux-scsi&m=128197119525504

James




      reply	other threads:[~2010-09-09 17:30 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-30 18:46 2.6.36-rc3: EIP is at scsi_init_io+ Alexey Dobriyan
2010-09-09  0:12 ` Linus Torvalds
2010-09-09 11:00   ` Jens Axboe
2010-09-09 12:47   ` James Bottomley
2010-09-09 12:51     ` Jens Axboe
2010-09-09 17:30       ` James Bottomley [this message]

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=1284053409.20480.62.camel@mulgrave.site \
    --to=james.bottomley@suse.de \
    --cc=adobriyan@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=fujita.tomonori@lab.ntt.co.jp \
    --cc=jaxboe@fusionio.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=torvalds@linux-foundation.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).