From: Lachlan McIlroy <lachlan@sgi.com>
To: Lachlan McIlroy <lachlan@sgi.com>, xfs-dev <xfs-dev@sgi.com>,
xfs-oss <xfs@oss.sgi.com>
Subject: Re: [PATCH] Fix use-after-free with log and quotas
Date: Tue, 16 Sep 2008 16:36:41 +1000 [thread overview]
Message-ID: <48CF53F9.7060102@sgi.com> (raw)
In-Reply-To: <20080916040825.GO5811@disturbed>
Dave Chinner wrote:
> On Mon, Sep 15, 2008 at 12:40:04PM +1000, Lachlan McIlroy wrote:
>> Dave Chinner wrote:
>>> On Fri, Sep 12, 2008 at 06:41:07PM +1000, Lachlan McIlroy wrote:
>>>> Destroying the quota stuff on unmount can access the log - ie XFS_QM_DONE()
>>>> ends up in xfs_dqunlock() which calls xfs_trans_unlocked_item() and then
>>>> xfs_log_move_tail(). By this time the log has already been destroyed.
>>>> Just move the cleanup of the quota code earlier in xfs_unmountfs() before
>>>> the call to xfs_log_unmount(). Moving XFS_QM_DONE() up near
>>>> XFS_QM_DQPURGEALL() seems like a good spot.
>>> FWIW, has this been actually seen in the real world?
>> Yes. And easy to reproduce too.
>
> Care to provide details about the test case, then? I can't help if
> you keep me in the dark....
XFSQA test 083 hits this almost every run when quotas are enabled.
>
>>> torn down the AIL and there should be no log items in the system
>>> that are in the AIL....
>> That should be the case but clearly not happening. Pete is investigating
>> an issue right now where a dquot is not getting removed from the AIL when
>> it should. Until we've got to the bottom of that problem I'd prefer to at
>> least avoid this use after free issue.
>
> No point in putting a bandaid in if you're already in the process of
> trying to find the real cause....
It's not a band-aid - it's a perfectly valid change to make. We don't
know if this other problem is related nor do we know if it will fix this
use-after-free either. There's no reason to let other people hit this
panic if we can avoid it.
prev parent reply other threads:[~2008-09-16 6:26 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-12 8:41 [PATCH] Fix use-after-free with log and quotas Lachlan McIlroy
2008-09-12 8:43 ` Christoph Hellwig
2008-09-13 4:02 ` Dave Chinner
2008-09-15 2:40 ` Lachlan McIlroy
2008-09-16 4:08 ` Dave Chinner
2008-09-16 6:36 ` Lachlan McIlroy [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=48CF53F9.7060102@sgi.com \
--to=lachlan@sgi.com \
--cc=xfs-dev@sgi.com \
--cc=xfs@oss.sgi.com \
/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