From: Al Viro <viro@ZenIV.linux.org.uk>
To: Shaohua Li <shli@fb.com>
Cc: linux-kernel@vger.kernel.org, akpm@linux-foundation.org,
Kernel-team@fb.com
Subject: Re: [PATCH] FS: fix stack-out-of-bounds wanning
Date: Tue, 9 May 2017 01:26:35 +0100 [thread overview]
Message-ID: <20170509002634.GU29622@ZenIV.linux.org.uk> (raw)
In-Reply-To: <ca4d1f9be1b01f6c161cc8f3cbdc3d2d100d0cd6.1494286835.git.shli@fb.com>
On Mon, May 08, 2017 at 04:42:50PM -0700, Shaohua Li wrote:
> I'm seeing below with lastet upstream. Commit
> 5ecda13(generic_file_read_iter(): make use of iov_iter_revert())
> directly pass iter to ->direct_IO(), ->direct_io already advances count
> bytes but return -EIOCBQUEUED. In this case, count is bigger than
> iov_iter_count(iter). We really want to revert count -
> iov_iter_count(iter) instead of the opposite.
Already discussed; the patch in my tree is that braino fix + sanity check
in iov_iter_revert(), to prevent anything similar in the future.
The reason it wasn't caught in tests (without KASAN, that is) is that
to get really obvious breakage out of that, you need a short read from
->direct_IO() *and* fallback to cached read after it. -EIOCBQUEUED
obviously excludes the latter, so the bug is almost certain to remain quiet.
There is a non-zero chance of actually running into unmapped memory while
doing that iov_iter_revert(), but it's fairly low. Unfortunately, since
that allowed the damn thing to remain unnoticed...
Will be in tonight's pull request.
prev parent reply other threads:[~2017-05-09 0:26 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-08 23:42 [PATCH] FS: fix stack-out-of-bounds wanning Shaohua Li
2017-05-09 0:26 ` Al Viro [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=20170509002634.GU29622@ZenIV.linux.org.uk \
--to=viro@zeniv.linux.org.uk \
--cc=Kernel-team@fb.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=shli@fb.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