From: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
To: David Hildenbrand <david@redhat.com>
Cc: Yuntao Liu <liuyuntao12@huawei.com>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org,
mhocko@suse.com, surenb@google.com, rppt@kernel.org,
vbabka@suse.cz, Liam.Howlett@oracle.com,
akpm@linux-foundation.org
Subject: Re: [PATCH -next] mm/memory: fix null pointer dereference in fault_dirty_shared_page
Date: Mon, 7 Jul 2025 13:32:10 +0100 [thread overview]
Message-ID: <0bc11a6c-6535-441d-ab55-b4affeb8aef8@lucifer.local> (raw)
In-Reply-To: <ea66f8a5-de20-4f6e-afcc-2eda84709958@redhat.com>
On Mon, Jul 07, 2025 at 02:27:01PM +0200, David Hildenbrand wrote:
> IIRC, MAP_ANON |MAP_SHARED would have done a shmem_zero_setup().
>
> mm/mmap.c still has the comment "mmap_region() will call shmem_zero_setup()
> to create a file".
Correct.
>
> I think this was moved to __mmap_new_vma().
>
> Is there any (error) path where we could not call that by accident?
No.
Shared means there's a file.
This also would mean we've been kernel NULL pointer dereferencing since
2019 btw when this change was made. I don't recall the reports... :>)
I think people get confused because MAP_SHARED | MAP_ANON makes people
think there won't be a file.
Our terminology sucks...
>
> --
> Cheers,
>
> David / dhildenb
>
prev parent reply other threads:[~2025-07-07 12:32 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-07 10:51 Yuntao Liu
2025-07-07 11:14 ` Lorenzo Stoakes
2025-07-07 12:27 ` David Hildenbrand
2025-07-07 12:32 ` Lorenzo Stoakes [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=0bc11a6c-6535-441d-ab55-b4affeb8aef8@lucifer.local \
--to=lorenzo.stoakes@oracle.com \
--cc=Liam.Howlett@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=david@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=liuyuntao12@huawei.com \
--cc=mhocko@suse.com \
--cc=rppt@kernel.org \
--cc=surenb@google.com \
--cc=vbabka@suse.cz \
/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