Linux KVM/arm64 development list
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Suzuki K Poulose" <suzuki.poulose@arm.com>
Cc: "Marc Zyngier" <maz@kernel.org>,
	"Oliver Upton" <oupton@kernel.org>,
	kvmarm@lists.linux.dev
Subject: Re: [PATCH v17 1/1] arm64: mm: Handle Granule Protection Faults (GPFs)
Date: Mon, 07 Sep 2026 16:32:12 +0000	[thread overview]
Message-ID: <20260907163213.018E31F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260907162204.1479401-2-suzuki.poulose@arm.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Missing untagged_addr() in do_gpf_ptw() causes show_pte() to fail for tagged user addresses.
--

commit 33ff4ae42e692cd124830f34b7d3c5368fce252f
Author: Steven Price <steven.price@arm.com>

arm64: mm: Handle Granule Protection Faults (GPFs)

This commit introduces handlers for Granule Protection Faults (GPFs) which
occur when accessing memory delegated to a realm. It issues a kernel oops
for GPFs on page walks via do_gpf_ptw(), and sends a SIGBUS for non-page
walk faults. It also handles fixups for spurious kernel GPFs.

> diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c
> --- a/arch/arm64/mm/fault.c
> +++ b/arch/arm64/mm/fault.c
> @@ -910,6 +910,22 @@ static int do_tag_check_fault(unsigned long far, unsigned long esr,
>  	return 0;
>  }
>  
> +static int do_gpf_ptw(unsigned long far, unsigned long esr, struct pt_regs *regs)
> +{
> +	const struct fault_info *inf = esr_to_fault_info(esr);
> +
> +	die_kernel_fault(inf->name, far, esr, regs);

[Severity: Medium]
Does this code miss untagging the address before passing it to the oops
handler?

If a GPF on a page table walk is triggered by a tagged user pointer, passing
the raw, tagged far value to die_kernel_fault() will prevent the page
table dump from showing up in the panic output.

In die_kernel_fault(), the address is passed to show_pte(addr). When
show_pte() checks is_ttbr0_addr(addr), the lingering memory tag in the
upper byte will cause the address to exceed TASK_SIZE. This makes
show_pte() abort with "address between user and kernel address ranges"
and return without dumping the PTE.

> +	return 0;
> +}

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260907162204.1479401-2-suzuki.poulose@arm.com?part=1

  reply	other threads:[~2026-09-07 16:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-07 16:22 [PATCH v17 0/1] arm64: mm: Handle Granule Protection Faults (GPFs) Suzuki K Poulose
2026-09-07 16:22 ` [PATCH v17 1/1] " Suzuki K Poulose
2026-09-07 16:32   ` sashiko-bot [this message]
2026-09-10 18:03     ` Catalin Marinas
2026-09-10 17:45   ` Catalin Marinas
2026-09-10 18:52     ` Suzuki K Poulose
2026-09-11 13:02 ` [PATCH v17 0/1] " Will Deacon
2026-09-11 16:09   ` Suzuki K Poulose

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=20260907163213.018E31F00A3A@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=kvmarm@lists.linux.dev \
    --cc=maz@kernel.org \
    --cc=oupton@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=suzuki.poulose@arm.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