linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Christian Brauner <brauner@kernel.org>
To: David Howells <dhowells@redhat.com>
Cc: kernel test robot <oliver.sang@intel.com>,
	oe-lkp@lists.linux.dev,  lkp@intel.com,
	Linux Memory Management List <linux-mm@kvack.org>,
	 Jeff Layton <jlayton@kernel.org>,
	netfs@lists.linux.dev, linux-fsdevel@vger.kernel.org
Subject: Re: [linux-next:master] [netfs] a05b682d49: BUG:KASAN:slab-use-after-free_in_copy_from_iter
Date: Fri, 13 Sep 2024 10:11:25 +0200	[thread overview]
Message-ID: <20240913-felsen-nervig-7ea082a2702c@brauner> (raw)
In-Reply-To: <1263138.1726214359@warthog.procyon.org.uk>

On Fri, Sep 13, 2024 at 08:59:19AM GMT, David Howells wrote:
> Can you try with the attached change?  It'll get folded into Christian's
> vfs.netfs branch at some point.

The fix you pasted below is already applied and folded into vfs.netfs.
But what the kernel test robot tested was an old version of that branch.

The commit hash that kernel test robot tested was:

commit: a05b682d498a81ca12f1dd964f06f3aec48af595 ("netfs: Use new folio_queue data type and iterator instead of xarray iter")
https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git master

but in vfs.netfs we have:
cd0277ed0c188dd40e7744e89299af7b78831ca4  ("netfs: Use new folio_queue data type and iterator instead of xarray iter")

and the diff between the two is:

diff --git a/lib/iov_iter.c b/lib/iov_iter.c
index 84a517a0189d..97003155bfac 100644
--- a/lib/iov_iter.c
+++ b/lib/iov_iter.c
@@ -1026,7 +1026,7 @@ static ssize_t iter_folioq_get_pages(struct iov_iter *iter,
                iov_offset += part;
                extracted += part;

-               *pages = folio_page(folio, offset % PAGE_SIZE);
+               *pages = folio_page(folio, offset / PAGE_SIZE);
                get_page(*pages);
                pages++;
                maxpages--;

So this is a bug report for an old version of vfs.netfs.

> 
> David
> ---
> diff --git a/lib/iov_iter.c b/lib/iov_iter.c
> index 84a517a0189d..97003155bfac 100644
> --- a/lib/iov_iter.c
> +++ b/lib/iov_iter.c
> @@ -1026,7 +1026,7 @@ static ssize_t iter_folioq_get_pages(struct iov_iter *iter,
>  		iov_offset += part;
>  		extracted += part;
>  
> -		*pages = folio_page(folio, offset % PAGE_SIZE);
> +		*pages = folio_page(folio, offset / PAGE_SIZE);
>  		get_page(*pages);
>  		pages++;
>  		maxpages--;
> 


  reply	other threads:[~2024-09-13  8:11 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-13  7:24 kernel test robot
2024-09-13  7:59 ` David Howells
2024-09-13  8:11   ` Christian Brauner [this message]
2024-09-18  2:24     ` Oliver Sang
2024-09-18 10:34     ` David Howells
2024-09-18 11:27     ` David Howells
2024-09-19  2:23       ` Oliver Sang
2024-09-19  7:14       ` David Howells
2024-09-20  6:36         ` Oliver Sang
2024-09-20  7:55         ` David Howells
2024-09-18 14:03 ` David Howells
2024-09-19  2:50   ` Oliver Sang
2024-09-24 21:47 ` David Howells
2024-09-24 23:19   ` Steve French
2024-09-26  2:20   ` Oliver Sang

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=20240913-felsen-nervig-7ea082a2702c@brauner \
    --to=brauner@kernel.org \
    --cc=dhowells@redhat.com \
    --cc=jlayton@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lkp@intel.com \
    --cc=netfs@lists.linux.dev \
    --cc=oe-lkp@lists.linux.dev \
    --cc=oliver.sang@intel.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