From: Dan Williams <dan.j.williams@intel.com>
To: Eric Sandeen <sandeen@redhat.com>
Cc: fsdevel <linux-fsdevel@vger.kernel.org>, Jeff Moyer <jmoyer@redhat.com>
Subject: Re: [PATCH] dax: fix offset overflow in dax_io
Date: Sat, 25 Jun 2016 10:39:07 -0700 [thread overview]
Message-ID: <CAPcyv4j2VfpFQG4V=9jKq0o52JYNe1bv=fdNqZ4NdLuu=vqUkA@mail.gmail.com> (raw)
In-Reply-To: <82c44164-4ed6-0f5b-872d-f60fb685ca22@redhat.com>
On Thu, Jun 23, 2016 at 2:54 PM, Eric Sandeen <sandeen@redhat.com> wrote:
> This isn't functionally apparent for some reason, but
> when we test io at extreme offsets at the end of the loff_t
> rang, such as in fstests xfs/071, the calculation of
> "max" in dax_io() can be wrong due to pos + size overflowing.
>
> For example,
>
> # xfs_io -c "pwrite 9223372036854771712 512" /mnt/test/file
>
> enters dax_io with:
>
> start 0x7ffffffffffff000
> end 0x7ffffffffffff200
>
> and the rounded up "size" variable is 0x1000. This yields:
>
> pos + size 0x8000000000000000 (overflows loff_t)
> end 0x7ffffffffffff200
>
> Due to the overflow, the min() function picks the wrong
> value for the "max" variable, and when we send (max - pos)
> into i.e. copy_from_iter_pmem() it is also the wrong value.
>
> This somehow(tm) gets magically absorbed without incident,
> probably because iter->count is correct. But it seems best
> to fix it up properly by comparing the two values as
> unsigned.
So this is 4.8 material, or a user visible bug that we should take
into 4.7 and -stable?
next prev parent reply other threads:[~2016-06-25 17:39 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-23 21:54 [PATCH] dax: fix offset overflow in dax_io Eric Sandeen
2016-06-25 17:39 ` Dan Williams [this message]
2016-06-25 18:49 ` Eric Sandeen
2016-06-27 18:43 ` Dan Williams
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='CAPcyv4j2VfpFQG4V=9jKq0o52JYNe1bv=fdNqZ4NdLuu=vqUkA@mail.gmail.com' \
--to=dan.j.williams@intel.com \
--cc=jmoyer@redhat.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=sandeen@redhat.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;
as well as URLs for NNTP newsgroup(s).