From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Dave Chinner <david@fromorbit.com>
Cc: xfs <linux-xfs@vger.kernel.org>, Brian Foster <bfoster@redhat.com>
Subject: Re: [PATCH] xfs: verify inline directory data forks
Date: Mon, 27 Mar 2017 10:10:06 -0700 [thread overview]
Message-ID: <20170327171006.GF5738@birch.djwong.org> (raw)
In-Reply-To: <20170316211255.GU17542@dastard>
On Fri, Mar 17, 2017 at 08:12:56AM +1100, Dave Chinner wrote:
> On Wed, Mar 15, 2017 at 12:28:55AM -0700, Darrick J. Wong wrote:
> > When we're reading or writing the data fork of an inline directory,
> > check the contents to make sure we're not overflowing buffers or eating
> > garbage data. xfs/348 corrupts an inline symlink into an inline
> > directory, triggering a buffer overflow bug.
>
> I think the check is fine, but from a structural point of view they
> are in the wrong place. i.e. the functions xfs_iformat_local() and
> xfs_iflush_fork() should not be doing any content specific checks
> and verification. All they do is marshall the fork data to and from
> in-memory and on-disk formats - the contents of the forks should be
> opaque to them.
>
> IOWs, incoming fork contents validity should be checked in
> xfs_iformat_fork() after we call xfs_iformat_local(), outgoing fork
> validity is checked in xfs_iflush_int() before calling
> xfs_iflush_fork().
Sorry for pushing the button prematurely. I just sent out a patch to
clean this up and address a few other issues.
--D
>
> Cheers,
>
> Dave.
> --
> Dave Chinner
> david@fromorbit.com
prev parent reply other threads:[~2017-03-27 17:10 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-15 7:28 [PATCH] xfs: verify inline directory data forks Darrick J. Wong
2017-03-15 15:00 ` Brian Foster
2017-03-15 17:45 ` Darrick J. Wong
2017-03-16 21:12 ` Dave Chinner
2017-03-27 17:10 ` Darrick J. Wong [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=20170327171006.GF5738@birch.djwong.org \
--to=darrick.wong@oracle.com \
--cc=bfoster@redhat.com \
--cc=david@fromorbit.com \
--cc=linux-xfs@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 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).