From: "David Hildenbrand (Arm)" <david@kernel.org>
To: Elkin Cruz <elkin@google.com>
Cc: Zi Yan <ziy@nvidia.com>,
Andrew Morton <akpm@linux-foundation.org>,
Baolin Wang <baolin.wang@linux.alibaba.com>,
"Liam R. Howlett" <liam@infradead.org>,
Nico Pache <nico.pache@linux.dev>,
Ryan Roberts <ryan.roberts@arm.com>, Dev Jain <dev.jain@arm.com>,
Barry Song <baohua@kernel.org>, Lance Yang <lance.yang@linux.dev>,
Usama Arif <usama.arif@linux.dev>,
Kiryl Shutsemau <kas@kernel.org>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
llvm@lists.linux.dev, irogers@google.com, stable@vger.kernel.org
Subject: Re: [PATCH] mm/huge_memory: check VMA end bounds in insert_pmd() and insert_pud()
Date: Wed, 2 Dec 2026 14:34:26 +0100 [thread overview]
Message-ID: <6fccf0ce-e686-44e1-955d-965c53d32b4c@kernel.org> (raw)
In-Reply-To: <CAC_6Yku6CwKcKVzCskXKVtbzLf1nA8-f+OFZEobyBAriugfa9g@mail.gmail.com>
On 12/2/26 02:52, Elkin Cruz wrote:
> On Thu, Nov 26, 2026 at 3:23 AM David Hildenbrand (Arm)
> <david@kernel.org> wrote:
>> For the code here, couldn't we do something like
>>
>> if (addr < vma->vm_start ||
>> addr + HPAGE_PMD_SIZE >= vma->vm_end )
>>
>> ... not sure if we'd have to care about overflows.
>
> Sorry for the belated reply.
>
> I have checked with help of an AI agent and they argue that
> vma->vm_end is exclusive
> (addr + HPAGE_PMD_SIZE == vma->vm_end). Thus ">= would reject the
> last PMD/PUD of every aligned VMA with VM_FAULT_SIGBUS", so it has
> to be >.
>
> I can send a new v2 if you want with:
>
> if (addr < vma->vm_start ||
> addr + HPAGE_PMD_SIZE > vma->vm_end )
Yeah that's what I meant.
--
Cheers,
David
prev parent reply other threads:[~2026-12-02 13:34 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-25 22:19 [PATCH] mm/huge_memory: check VMA end bounds in insert_pmd() and insert_pud() Elkin Cruz
2026-11-25 22:40 ` David Hildenbrand (Arm)
2026-11-25 22:57 ` Elkin Cruz
2026-11-26 11:23 ` David Hildenbrand (Arm)
2026-12-02 1:52 ` Elkin Cruz
2026-12-02 13:34 ` David Hildenbrand (Arm) [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=6fccf0ce-e686-44e1-955d-965c53d32b4c@kernel.org \
--to=david@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=baohua@kernel.org \
--cc=baolin.wang@linux.alibaba.com \
--cc=dev.jain@arm.com \
--cc=elkin@google.com \
--cc=irogers@google.com \
--cc=kas@kernel.org \
--cc=lance.yang@linux.dev \
--cc=liam@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=llvm@lists.linux.dev \
--cc=nico.pache@linux.dev \
--cc=ryan.roberts@arm.com \
--cc=stable@vger.kernel.org \
--cc=usama.arif@linux.dev \
--cc=ziy@nvidia.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.