From: Eduard Zingerman <eddyz87@gmail.com>
To: Omar Sandoval <osandov@osandov.com>,
linux-fsdevel@vger.kernel.org, Al Viro <viro@zeniv.linux.org.uk>,
Christian Brauner <brauner@kernel.org>
Cc: kernel-team@fb.com, v9fs@lists.linux.dev,
David Howells <dhowells@redhat.com>,
Manu Bretelle <chantr4@gmail.com>,
Leon Romanovsky <leon@kernel.org>
Subject: Re: [PATCH] iov_iter: fix advancing slot in iter_folioq_get_pages()
Date: Mon, 30 Sep 2024 12:27:15 -0700 [thread overview]
Message-ID: <88f034c09850004f6468f8b31a9fc31058d36981.camel@gmail.com> (raw)
In-Reply-To: <cbaf141ba6c0e2e209717d02746584072844841a.1727722269.git.osandov@fb.com>
On Mon, 2024-09-30 at 11:55 -0700, Omar Sandoval wrote:
> From: Omar Sandoval <osandov@fb.com>
>
> iter_folioq_get_pages() decides to advance to the next folioq slot when
> it has reached the end of the current folio. However, it is checking
> offset, which is the beginning of the current part, instead of
> iov_offset, which is adjusted to the end of the current part, so it
> doesn't advance the slot when it's supposed to. As a result, on the next
> iteration, we'll use the same folio with an out-of-bounds offset and
> return an unrelated page.
>
> This manifested as various crashes and other failures in 9pfs in drgn's
> VM testing setup and BPF CI.
>
> Fixes: db0aa2e9566f ("mm: Define struct folio_queue and ITER_FOLIOQ to handle a sequence of folios")
> Link: https://lore.kernel.org/linux-fsdevel/20240923183432.1876750-1-chantr4@gmail.com/
> Tested-by: Manu Bretelle <chantr4@gmail.com>
> Signed-off-by: Omar Sandoval <osandov@fb.com>
> ---
Tried this on top of the following commit from net-fs-fixes branch:
e1b0d67c7ae0 ("9p: Don't revert the I/O iterator after reading")
The boot issue is gone, thank you!
Tested-by: Eduard Zingerman <eddyz87@gmail.com>
[...]
next prev parent reply other threads:[~2024-09-30 19:27 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-30 18:55 [PATCH] iov_iter: fix advancing slot in iter_folioq_get_pages() Omar Sandoval
2024-09-30 19:27 ` Eduard Zingerman [this message]
2024-09-30 20:10 ` David Howells
2024-10-01 5:52 ` Leon Romanovsky
2024-10-01 9:47 ` Joey Gouly
2024-10-01 9:50 ` Christian Brauner
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=88f034c09850004f6468f8b31a9fc31058d36981.camel@gmail.com \
--to=eddyz87@gmail.com \
--cc=brauner@kernel.org \
--cc=chantr4@gmail.com \
--cc=dhowells@redhat.com \
--cc=kernel-team@fb.com \
--cc=leon@kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=osandov@osandov.com \
--cc=v9fs@lists.linux.dev \
--cc=viro@zeniv.linux.org.uk \
/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).