From: Pasha Tatashin <pasha.tatashin@soleen.com>
To: David CARLIER <devnexen@gmail.com>
Cc: Pasha Tatashin <pasha.tatashin@soleen.com>,
akpm@linux-foundation.org, pratyush@kernel.org,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] mm/memfd_luo: reject memfds whose page count exceeds UINT_MAX
Date: Fri, 1 May 2026 19:38:34 +0000 [thread overview]
Message-ID: <afUApNZQumxPQ3wu@plex> (raw)
In-Reply-To: <CA+XhMqws+mudAQo4ibaLb9MJv7pKDfLUAH8CcHSAkLNdPtijeA@mail.gmail.com>
On 05-01 20:26, David CARLIER wrote:
> On 2026-05-01 18:59, Pasha Tatashin wrote:
> > I think, the fix should be first done at memfd_pin_folios() to
> change
> > max_folios to 'long' or 'unsigned long', and then just updated
> > memfd_luo.c to match.
>
> Even with memfd_pin_folios() widened, memfd_luo_preserve_folios()
> still
> kvmalloc_objs()s the folios array up front -- at UINT_MAX entries
> that's
> already ~32 GiB of pointer array, which won't realistically succeed.
> So
> the guard here still makes sense, just on allocation grounds rather than
> interface truncation.
>
> Happy to widen memfd_pin_folios() as a separate patch, but I'd keep
> the
> -EFBIG check regardless. Or did you have a different shape in mind?
Ah, Good point about kvmalloc_objs(), I am not against this, even though
it is a very theoretical issue.
Reviewed-by: Pasha Tatashin <pasha.tatashin@soleen.com>
next prev parent reply other threads:[~2026-05-01 19:38 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-23 12:56 [PATCH 1/2] mm/memfd_luo: reject memfds whose page count exceeds UINT_MAX David Carlier
2026-04-23 12:56 ` [PATCH 2/2] mm/memfd_luo: document preservation of file seals David Carlier
2026-05-01 19:41 ` Pasha Tatashin
2026-05-04 8:07 ` Pratyush Yadav
2026-05-01 18:59 ` [PATCH 1/2] mm/memfd_luo: reject memfds whose page count exceeds UINT_MAX Pasha Tatashin
2026-05-01 19:26 ` David CARLIER
2026-05-01 19:38 ` Pasha Tatashin [this message]
2026-05-04 8:05 ` Pratyush Yadav
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=afUApNZQumxPQ3wu@plex \
--to=pasha.tatashin@soleen.com \
--cc=akpm@linux-foundation.org \
--cc=devnexen@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=pratyush@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