From: David Chinner <dgc@sgi.com>
To: xfs@oss.sgi.com
Cc: t-nagano@ah.jp.nec.com, xfs-dev@sgi.com
Subject: [REVIEW 0 of 4] Fix xfs_iunpin use after free badness
Date: Tue, 24 Oct 2006 17:15:33 +1000 [thread overview]
Message-ID: <20061024071533.GQ11034@melbourne.sgi.com> (raw)
The following 4 patches fix the long standing issues with
xfs_iunpin accessing the linux inode after it has been freed.
The first patch cleans up the i_flags_lock handling and the
setting and clearing of the i_flags. This has
been posted before in a different context, and is simply a cleanup patch.
The second patch removes the need for grabbing the linux
inode in xfs_iunpin(). This causes deadlocks when the xfslogd
drops the final reference to an inode and needs to issue a transaction
when the log is full. We can do this by providing a guarantee
external to xfs_iunpin() that when either of the XFS_IRECLAIM
or XFS_IRECLAIMABLE flags are set on the xfs inode there is
no linux inode to look up.
The third patch fixes the xfs_iget_core() handling of the
XFS_IRECLAIMABLE flag so it doesn't violate the guarantee we
need to provide to xfs_iunpin() w.r.t. the existence of a
linux inode.
The last patch closes a race condition in xfs_iunpin()
as we need to guarantee the atomicity of the last unpin
and the checking of the XFS_IRECLAIM* flags otherwise
pre-emption or interrupt can cause us to race with
xfs_iget_core() which would now see the inode as unpinned
and hence clear the XFS_IRECLAIMABLE flag.
Many thanks go to Takenori Nagano for his help in getting to
the bottom of this issue and the testing that he has done.
Cheers,
Dave.
--
Dave Chinner
Principal Engineer
SGI Australian Software Group
reply other threads:[~2006-10-24 7:16 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20061024071533.GQ11034@melbourne.sgi.com \
--to=dgc@sgi.com \
--cc=t-nagano@ah.jp.nec.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