mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dan Carpenter <dan@cryspen.com>
To: Marc Zyngier <maz@kernel.org>
Cc: "Eric Auger" <eric.auger@redhat.com>,
	"Oliver Upton" <oupton@kernel.org>,
	"Fuad Tabba" <fuad.tabba@linux.dev>,
	"Joey Gouly" <joey.gouly@arm.com>,
	"Steffen Eiden" <seiden@linux.ibm.com>,
	"Suzuki K Poulose" <suzuki.poulose@arm.com>,
	"Zenghui Yu" <yuzenghui@huawei.com>,
	"Catalin Marinas" <catalin.marinas@arm.com>,
	"Will Deacon" <will@kernel.org>,
	"Mark Rutland" <mark.rutland@arm.com>,
	"Carlos López" <clopez@suse.de>,
	"Sascha Bischoff" <sascha.bischoff@arm.com>,
	"Jackie Liu" <liuyun01@kylinos.cn>,
	"Christoffer Dall" <cdall@linaro.org>,
	linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev,
	linux-kernel@vger.kernel.org,
	"Karthik Bhargavan" <karthik@pereq.eu>,
	"Clément Blaudeau" <clement@cryspen.com>
Subject: Re: [PATCH] KVM: arm64: vgic-its: Reject ITS_REGS offsets above U32_MAX
Date: Tue, 10 Nov 2026 16:38:34 +0300	[thread overview]
Message-ID: <avMeWguO2gOTX8Bk@stanley.mountain> (raw)
In-Reply-To: <86wlql0x5t.wl-maz@kernel.org>

On Tue, Nov 10, 2026 at 10:59:42AM +0000, Marc Zyngier wrote:
> > +	if (offset > U32_MAX)
> > +		return -ENXIO;
> > +
> >  	/*
> >  	 * Although the spec supports upper/lower 32-bit accesses to
> >  	 * 64-bit ITS registers, the userspace ABI requires 64-bit
> 
> I think this is going in the wrong direction. Instead of capping the
> offset at an arbitrary value, the infrastructure should be able to
> deal with arbitrary offsets.
> 
> Could you try the following (untested) hack?
> 
> I also don't think this is worth a Cc stable (the worse case is that
> the VMM accesses an emulated register and sets something nonsensical),
> which it can always do.

Fair enough.  We are in arch/arm64/ so casting a u64 to a pointer and
back works.  Except for these two, the other callers pass values which
fit in a u32 so they aren't affected.

I'm going to remove some of your casts which aren't necessary and add
the uintptr_t cast back.

regards,
dan carpenter


      reply	other threads:[~2026-11-10 13:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-10  5:07 Dan Carpenter
2026-11-10 10:59 ` Marc Zyngier
2026-11-10 13:38   ` Dan Carpenter [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=avMeWguO2gOTX8Bk@stanley.mountain \
    --to=dan@cryspen.com \
    --cc=catalin.marinas@arm.com \
    --cc=cdall@linaro.org \
    --cc=clement@cryspen.com \
    --cc=clopez@suse.de \
    --cc=eric.auger@redhat.com \
    --cc=fuad.tabba@linux.dev \
    --cc=joey.gouly@arm.com \
    --cc=karthik@pereq.eu \
    --cc=kvmarm@lists.linux.dev \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liuyun01@kylinos.cn \
    --cc=mark.rutland@arm.com \
    --cc=maz@kernel.org \
    --cc=oupton@kernel.org \
    --cc=sascha.bischoff@arm.com \
    --cc=seiden@linux.ibm.com \
    --cc=suzuki.poulose@arm.com \
    --cc=will@kernel.org \
    --cc=yuzenghui@huawei.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

all inboxes | Powered by JetHome®