The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Paul Walmsley <pjw@kernel.org>
To: Austin Kim <austindh.kim@gmail.com>
Cc: Paul Walmsley <pjw@kernel.org>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	 Alexandre Ghiti <alex@ghiti.fr>,
	linux-riscv@lists.infradead.org,  linux-kernel@vger.kernel.org
Subject: Re: [PATCH] riscv: check leaf entry alignment in pageattr_pxd_entry()
Date: Fri, 22 May 2026 17:34:41 -0600 (MDT)	[thread overview]
Message-ID: <1d3c3d6a-dbd2-b56e-5a44-e9aded173d33@kernel.org> (raw)
In-Reply-To: <aeWyuC3nXrP9McNy@adminpc-PowerEdge-R7525>

Hi Austin,

On Mon, 20 Apr 2026, Austin Kim wrote:

> During page table walking, ensure the range being processed matches
> the expected size of a leaf entry (P4D, PUD, or PMD). While pxd_addr_end() 
> functions handle boundary checks, they do not inherently validate whether 
> the entry is a leaf node of the expected size.
> 
> Add WARN_ON_ONCE() to detect misalignments or partial updates of huge 
> pages. If a mismatch is detected, return -EINVAL to prevent potential
> corruption of page table entries.
> 
> Signed-off-by: Austin Kim <austindh.kim@gmail.com>

Is this in response to a failure mode that you've seen?  Or is it simply 
prophylactic?

Seems like a better place for this might be in common code, so other 
architectures could benefit as well?


- Paul

  reply	other threads:[~2026-05-22 23:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-20  4:59 [PATCH] riscv: check leaf entry alignment in pageattr_pxd_entry() Austin Kim
2026-05-22 23:34 ` Paul Walmsley [this message]
2026-05-25 13:22   ` Austin Kim

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=1d3c3d6a-dbd2-b56e-5a44-e9aded173d33@kernel.org \
    --to=pjw@kernel.org \
    --cc=alex@ghiti.fr \
    --cc=austindh.kim@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=palmer@dabbelt.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox