linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Dev Jain <dev.jain@arm.com>
To: syzbot+57bcc752f0df8bb1365c@syzkaller.appspotmail.com
Cc: akpm@linux-foundation.org, david@redhat.com, jgg@ziepe.ca,
	jhubbard@nvidia.com, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org, peterx@redhat.com,
	syzkaller-bugs@googlegroups.com
Subject: Re: [syzbot] [mm?] WARNING in follow_page_pte
Date: Wed, 6 Aug 2025 16:53:38 +0530	[thread overview]
Message-ID: <3a565e1a-6a40-4bd1-a6e0-7f64b745d00f@arm.com> (raw)
In-Reply-To: <20250806111922.669-1-dev.jain@arm.com>


On 06/08/25 4:49 pm, Dev Jain wrote:
> #syz test
>
> In commit_anon_folio_batch(), we iterate over all pages pointed to by the
> PTE batch. Therefore we need to know the first page of the batch;
> currently we derive that via folio_page(folio, 0), but, that takes us
> to the first (head) page of the folio instead - our PTE batch may lie
> in the middle of the folio, leading to incorrectness.
>
> Bite the bullet and throw away the micro-optimization of reusing the
> folio in favour of code simplicity. Derive the page and the folio in
> change_pte_range, and pass the page too to commit_anon_folio_batch to
> fix the aforementioned issue.
>
> Also, instead of directly adding to the stuct page *page pointer, use
> the nth_page() macro for safety.
>
> Fixes: cac1db8c3aad ("mm: optimize mprotect() by PTE batching")
> Signed-off-by: Dev Jain <dev.jain@arm.com>
> ---
>   mm/mprotect.c | 25 +++++++++++--------------
>   1 file changed, 11 insertions(+), 14 deletions(-)
>

Oops, this patch is based off mm-hotfixes-unstable, but I guess syzbot
will need it rebased on Torvalds' master?



  reply	other threads:[~2025-08-06 11:24 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-06  7:32 syzbot
2025-08-06  7:55 ` David Hildenbrand
2025-08-06  8:01   ` David Hildenbrand
2025-08-06 11:19 ` Dev Jain
2025-08-06 11:23   ` Dev Jain [this message]
2025-08-06 12:21   ` David Hildenbrand
2025-08-06 15:38   ` syzbot
2025-08-06 11:21 ` syzbot

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=3a565e1a-6a40-4bd1-a6e0-7f64b745d00f@arm.com \
    --to=dev.jain@arm.com \
    --cc=akpm@linux-foundation.org \
    --cc=david@redhat.com \
    --cc=jgg@ziepe.ca \
    --cc=jhubbard@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=peterx@redhat.com \
    --cc=syzbot+57bcc752f0df8bb1365c@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.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