From: Oscar Salvador <osalvador@suse.de>
To: Matthew Wilcox <willy@infradead.org>
Cc: Vishal Moola <vishal.moola@gmail.com>,
syzbot <syzbot+ad1b592fc4483655438b@syzkaller.appspotmail.com>,
akpm@linux-foundation.org, linux-kernel@vger.kernel.org,
linux-mm@kvack.org, muchun.song@linux.dev,
syzkaller-bugs@googlegroups.com
Subject: Re: [syzbot] [mm?] KASAN: slab-use-after-free Read in __vma_reservation_common
Date: Tue, 16 Apr 2024 07:36:58 +0200 [thread overview]
Message-ID: <Zh4OemsI1Ant9rfg@localhost.localdomain> (raw)
In-Reply-To: <Zh4AJiHFQBkD1J_F@casper.infradead.org>
On Tue, Apr 16, 2024 at 05:35:50AM +0100, Matthew Wilcox wrote:
> Why does hugetlbfs use VM_MAYSHARE while regular faults use VM_SHARED?
It goes back to:
commit f83a275dbc5ca1721143698e844243fcadfabf6a
Author: Mel Gorman <mel@csn.ul.ie>
Date: Thu May 28 14:34:40 2009 -0700
mm: account for MAP_SHARED mappings using VM_MAYSHARE and not VM_SHARED in hugetlbfs
"hugetlbfs currently checks if a VMA is MAP_SHARED with the VM_SHARED flag
and not VM_MAYSHARE. For file-backed mappings, such as hugetlbfs,
VM_SHARED is set only if the mapping is MAP_SHARED and the file was opened
read-write. If a shared memory mapping was mapped shared-read-write for
populating of data and mapped shared-read-only by other processes, then
hugetlbfs would account for the mapping as if it was MAP_PRIVATE. This
causes processes to fail to map the file MAP_SHARED even though it should
succeed as the reservation is there."
--
Oscar Salvador
SUSE Labs
next prev parent reply other threads:[~2024-04-16 5:37 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-12 13:32 [syzbot] [mm?] KASAN: slab-use-after-free Read in __vma_reservation_common syzbot
2024-04-13 18:34 ` syzbot
2024-04-13 23:33 ` Hillf Danton
2024-04-14 2:39 ` syzbot
2024-04-14 3:31 ` Hillf Danton
2024-04-14 4:02 ` syzbot
2024-04-15 22:05 ` Vishal Moola
2024-04-15 22:15 ` Matthew Wilcox
2024-04-15 23:02 ` Vishal Moola
2024-04-16 4:35 ` Matthew Wilcox
2024-04-16 5:36 ` Oscar Salvador [this message]
2024-04-16 8:13 ` Oscar Salvador
2024-04-17 21:31 ` Andrew Morton
2024-04-16 7:28 ` syzbot
2024-04-18 18:40 ` Vishal Moola
2024-04-18 18:40 ` syzbot
2024-04-18 18:45 ` Vishal Moola
2024-04-19 5:01 ` 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=Zh4OemsI1Ant9rfg@localhost.localdomain \
--to=osalvador@suse.de \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=muchun.song@linux.dev \
--cc=syzbot+ad1b592fc4483655438b@syzkaller.appspotmail.com \
--cc=syzkaller-bugs@googlegroups.com \
--cc=vishal.moola@gmail.com \
--cc=willy@infradead.org \
/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.