Linux kernel -stable discussions
 help / color / mirror / Atom feed
From: "David Hildenbrand (Arm)" <david@kernel.org>
To: Hengyu Liang <hengyul@cs.unc.edu>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Baoquan He <baoquan.he@linux.dev>, Jason Gunthorpe <jgg@ziepe.ca>,
	John Hubbard <jhubbard@nvidia.com>, Peter Xu <peterx@redhat.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	stable@vger.kernel.org
Subject: Re: [PATCH] mm/gup: fault in ranges that start at address 0
Date: Mon, 30 Nov 2026 13:38:44 +0100	[thread overview]
Message-ID: <13a44eb3-66fc-4582-be57-a424da1d8d32@kernel.org> (raw)
In-Reply-To: <20261127100457.1388226-1-hengyul@cs.unc.edu>

On 11/27/26 11:04, Hengyu Liang wrote:
> Hi David,
> 
> On Wed, 25 Nov 2026 at 23:51, David Hildenbrand (Arm) <david@kernel.org> wrote:
>> Okay, but you did not actually run into this yourself, right?
> 
> No. I found it while comparing the behavior of different kernel
> versions, and I don't know of an application that hits it.
> 
>> Likely this is "nobody cares" and we don't need CC stable.
> 
> Agreed, I will drop the stable Cc.
> 
>>  	/* Stop once we overflow to 0. */
>> These comments are not really correct anymore. We don't stop once we overflow to
>> 0 anymore.
>>
>> Likely we want to be more careful when calcualting+handling end instead.
> 
> Something like this, in all three functions?
> 
> 	unsigned long end, cur;
> 	...
> 	/* Page-aligned end of the range, 0 if it reaches the top. */
> 	if (check_add_overflow(start, size, &end))
> 		end = 0;
> 	else
> 		end = PAGE_ALIGN(end);
> 
> 	for (cur = start; cur != end; cur = PAGE_ALIGN_DOWN(cur + PAGE_SIZE))
> 		...
> 
> A range at address 0 is then handled like any other, and the loop
> still stops at the top of the address space. This is close to what
> the code did before a7797e74bd39.
> 
> If that is what you had in mind, I will send a v2 like this.

Yes, looks good. Can you send a v2 and clarify in the description that using
NULL is uncommon today, and usually only root can do it etc?

-- 
Cheers,

David

      reply	other threads:[~2026-11-30 12:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-25 17:32 [PATCH] mm/gup: fault in ranges that start at address 0 Hengyu Liang
2026-11-25 22:51 ` David Hildenbrand (Arm)
2026-11-27 10:04   ` Hengyu Liang
2026-11-30 12:38     ` 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=13a44eb3-66fc-4582-be57-a424da1d8d32@kernel.org \
    --to=david@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=baoquan.he@linux.dev \
    --cc=hengyul@cs.unc.edu \
    --cc=jgg@ziepe.ca \
    --cc=jhubbard@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=peterx@redhat.com \
    --cc=stable@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox