From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Eryu Guan <eguan@redhat.com>
Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org
Subject: Re: [PATCH v2 7/7] xfs/ext4: check negative inode size
Date: Mon, 9 Jan 2017 20:52:29 -0800 [thread overview]
Message-ID: <20170110045229.GD3732@birch.djwong.org> (raw)
In-Reply-To: <20170110044023.GK1859@eguan.usersys.redhat.com>
On Tue, Jan 10, 2017 at 12:40:23PM +0800, Eryu Guan wrote:
> On Mon, Jan 09, 2017 at 12:55:18PM -0800, Darrick J. Wong wrote:
> > Craft a malicious filesystem image with a negative inode size,
> > then try to trigger a kernel DoS by appending data to the file.
> > Ideally this should trigger verifier errors instead of hanging.
> >
> > Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> > ---
> > v2: use $DEBUGFS_PROG instead of debugfs; improve documentation
>
> Thanks for all the updated patches! I fixed a minor typo locally and
> committed.
>
> > diff --git a/tests/shared/401 b/tests/shared/401
> > new file mode 100755
> > index 0000000..7b61cbb
> > --- /dev/null
> > +++ b/tests/shared/401
> > @@ -0,0 +1,77 @@
> > +#! /bin/bash
> > +# FSQA Test No. 401
> > +#
> > +# Since loff_t is a signed type, it is invalid for a filesystem to load
> > +# an inode with i_size = -1ULL. Unfortunately, nobody checks this,
> > +# which means that we can trivially DoS the VFS by creating such a file
> > +# and appending to it. This causes an integer overflow in the routines
> > +# underlying writeback, which results in the kernel locking up.
> > +#
> > +# So, create this malformed inode and try a buffered dio append to make
> ^^^^^^^^
> I removed the "buffered" here and from xfs/401.
D'oh!!! Thanks for fixing that.
--D
>
> Thanks,
> Eryu
prev parent reply other threads:[~2017-01-10 4:52 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-05 1:04 [PATCH 0/7] xfstests: misc reflink test fixes Darrick J. Wong
2017-01-05 1:04 ` [PATCH 1/7] ocfs2: test reflinking to inline data files Darrick J. Wong
2017-01-05 1:04 ` [PATCH 2/7] common: add leading underscore to get_block_size Darrick J. Wong
2017-01-09 10:20 ` Eryu Guan
2017-01-09 21:32 ` Darrick J. Wong
2017-01-05 1:04 ` [PATCH 3/7] ocfs2/reflink: fix file block size reporting Darrick J. Wong
2017-01-05 1:05 ` [PATCH 4/7] reflink: fix quota tests to work properly Darrick J. Wong
2017-01-09 8:55 ` Eryu Guan
2017-01-09 19:30 ` Darrick J. Wong
2017-01-09 20:53 ` [PATCH v2 " Darrick J. Wong
2017-01-05 1:05 ` [PATCH 5/7] reflink: make error reporting consistent when simulating EIO Darrick J. Wong
2017-01-05 1:05 ` [PATCH 6/7] dedupe: fix consistent error message prefixes for dedupe tests Darrick J. Wong
2017-01-09 9:26 ` Eryu Guan
2017-01-09 20:36 ` Darrick J. Wong
2017-01-09 20:54 ` [PATCH v2 " Darrick J. Wong
2017-01-05 1:05 ` [PATCH 7/7] xfs/ext4: check negative inode size Darrick J. Wong
2017-01-09 9:36 ` Eryu Guan
2017-01-09 20:36 ` Darrick J. Wong
2017-01-09 20:55 ` [PATCH v2 " Darrick J. Wong
2017-01-10 4:40 ` Eryu Guan
2017-01-10 4:52 ` 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=20170110045229.GD3732@birch.djwong.org \
--to=darrick.wong@oracle.com \
--cc=eguan@redhat.com \
--cc=fstests@vger.kernel.org \
--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