All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: linux-kernel@vger.kernel.org
Cc: linux-mm@kvack.org,
	syzbot+bf2c35fa302ebe3c7471@syzkaller.appspotmail.com,
	Peter Xu <peterx@redhat.com>,
	"akpm@linux-foundation.org" <akpm@linux-foundation.org>
Subject: Re: [PATCH v1] mm/huge_memory: check pmd_special() only after pmd_present()
Date: Mon, 30 Sep 2024 22:35:58 +0200	[thread overview]
Message-ID: <db84157d-94bc-4334-9d2d-a7e43cbc0208@redhat.com> (raw)
In-Reply-To: <20240926154234.2247217-1-david@redhat.com>

On 26.09.24 17:42, David Hildenbrand wrote:
> We should only check for pmd_special() after we made sure that we
> have a present PMD. For example, if we have a migration PMD,
> pmd_special() might indicate that we have a special PMD although we
> really don't.
> 
> This fixes confusing migration entries as PFN mappings, and not
> doing what we are supposed to do in the "is_swap_pmd()" case further
> down in the function -- including messing up COW, page table handling
> and accounting.
> 
> Reported-by: syzbot+bf2c35fa302ebe3c7471@syzkaller.appspotmail.com
> Closes: https://lore.kernel.org/lkml/66f15c8d.050a0220.c23dd.000f.GAE@google.com/
> Fixes: bc02afbd4d73 ("mm/fork: accept huge pfnmap entries")
> Cc: Peter Xu <peterx@redhat.com>
> Signed-off-by: David Hildenbrand <david@redhat.com>
> ---
> 
> I yet have to do more testing, but sending this out already.

Testing looks good. Andrew please queue this, it's a rather unpleasent 
behavior if we fork() with a PMD migration entry that should be fixed 
upstream soonish :)

(no idea how I could have missed CCing Andrew once more)

-- 
Cheers,

David / dhildenb



      parent reply	other threads:[~2024-09-30 20:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-26 15:42 [PATCH v1] mm/huge_memory: check pmd_special() only after pmd_present() David Hildenbrand
2024-09-26 15:59 ` Peter Xu
2024-09-30 20:35 ` David Hildenbrand [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=db84157d-94bc-4334-9d2d-a7e43cbc0208@redhat.com \
    --to=david@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=peterx@redhat.com \
    --cc=syzbot+bf2c35fa302ebe3c7471@syzkaller.appspotmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.