mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hengyu Liang <hengyul@cs.unc.edu>
To: David Hildenbrand <david@kernel.org>
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: Fri, 27 Nov 2026 05:04:57 -0500	[thread overview]
Message-ID: <20261127100457.1388226-1-hengyul@cs.unc.edu> (raw)
In-Reply-To: <f5ff8f43-c75c-4b19-b683-fdff0c6dd7ae@kernel.org>

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.

Thanks,
Hengyu

  reply	other threads:[~2026-11-27 10:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-25 17:32 Hengyu Liang
2026-11-25 22:51 ` David Hildenbrand (Arm)
2026-11-27 10:04   ` Hengyu Liang [this message]
2026-11-30 12:38     ` David Hildenbrand (Arm)

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=20261127100457.1388226-1-hengyul@cs.unc.edu \
    --to=hengyul@cs.unc.edu \
    --cc=akpm@linux-foundation.org \
    --cc=baoquan.he@linux.dev \
    --cc=david@kernel.org \
    --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

all inboxes | Powered by JetHome®