From: James Bottomley <James.Bottomley@suse.de>
To: Jeff Garzik <jeff@garzik.org>
Cc: linux-scsi <linux-scsi@vger.kernel.org>,
linux-ide <linux-ide@vger.kernel.org>
Subject: Re: [PATCH] libsas: fix ata list corruption issue
Date: Fri, 11 Mar 2011 11:19:25 -0600 [thread overview]
Message-ID: <1299863968.1970.0.camel@localhost.localdomain> (raw)
In-Reply-To: <4D797AC3.2050202@garzik.org>
On Thu, 2011-03-10 at 20:28 -0500, Jeff Garzik wrote:
> On 03/10/2011 06:13 PM, James Bottomley wrote:
> > I think this stems from a misunderstanding of how the ata error handler
> > works. ata_scsi_cmd_error_handler() gets called with a passed in list
> > of commands to handle. However, that list may still not be empty when
> > it exits. The command ata_scsi_port_error_handler() must be called
> > (which takes no list) before the list will be completely emptied. This
> > bites the sas error handler because the two are called from different
> > functions and the original list has gone out of scope before
> > ata_scsi_port_error_handler() is called. leading to some commands
> > dangling on bare stack, which is a potential memory corruption issue.
> > Fix this by manually deleting all outstanding commands from the on-stack
> > list before it goes out of scope.
>
> Good catch...
I cannot tell a lie: it was the list debugger code that told me
something was wrong ... I just looked at it to see what the problem was.
James
prev parent reply other threads:[~2011-03-11 17:19 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-10 23:13 [PATCH] libsas: fix ata list corruption issue James Bottomley
2011-03-11 1:28 ` Jeff Garzik
2011-03-11 17:19 ` 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=1299863968.1970.0.camel@localhost.localdomain \
--to=james.bottomley@suse.de \
--cc=jeff@garzik.org \
--cc=linux-ide@vger.kernel.org \
--cc=linux-scsi@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.