lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <87o745urnm.wl-maz@kernel.org>
Date: Mon, 30 Sep 2024 15:45:17 +0100
From: Marc Zyngier <maz@...nel.org>
To: Marc Zyngier <maz@...nel.org>,
	Oliver Upton <oliver.upton@...ux.dev>,
	James Morse <james.morse@....com>,
	Suzuki K Poulose <suzuki.poulose@....com>,
	Zenghui Yu <yuzenghui@...wei.com>,
	Catalin Marinas <catalin.marinas@....com>,
	Will Deacon <will@...nel.org>,
	Joey Gouly <joey.gouly@....com>,
	Jia Qingtong <jiaqingtong@...wei.com>,
	linux-arm-kernel@...ts.infradead.org,
	kvmarm@...ts.linux.dev,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] KVM: arm64: vgic: fix GICR_STATUSR in vgic_v3_rd_registers

On Mon, 30 Sep 2024 07:20:35 +0100,
Jia Qingtong <jiaqingtong97@...il.com> wrote:
> 
> On 29 Sep 10:38, Marc Zyngier wrote:
> > On Sun, 29 Sep 2024 05:39:35 +0100,
> > jiaqingtong97@...il.com wrote:
> > > 
> > > From: Jia Qingtong <jiaqingtong@...wei.com>
> > > 
> > > vgic_uaccess use bsearch search regs in vgic_io_device.regions, but the
> > > GICR_STATUSR have wrong order in vgic_v3_rd_registers.
> > > When check all vgic_register_region, it turned out that only
> > > vgic_v3_rd_registers has this problem.
> > > 
> > > It's harmless since vgic_uaccess behaves as RAZ&WI when it can't find the
> > > specified reg. This is exactly the same as the behavior of the GICR_STATUSR
> > > register.
> > >
> > > So just move GICR_STATUSR to the right place.
> > 
> > That looks correct, but I think we should have some code that ensures
> > that these tables are correct at boot time, just like we're doing for
> > the system registers. Or completely remove our reliance on bsearch().
> > 
> struct vgic_register_region was defined in vgic-{its,mmio-v2,mmio-v3},
> do you think it's appropriate to extern and check tables's item order in
> vgic-init.c's kvm_vgic_hyp_init?.

I'd rather we have local functions performing the check, one in each
of the GIC "modules", calling a global helper taking a pointer to the
register array as a parameter.

> 
> > Another thing is that GICD_STATUSR looks pretty wrong. It is handled
> > as RAO, but we never clear any "error" (it is WI). This has been buggy
> > since GICv3 save/restore was added, 7 years ago.
> > 
> Let's change it to RAZ? We will implement the complete logic when someone
> really needs this feature.

Exactly. Which is probably *never*.

> 
> > Do you mind spinning a series fixing this up?
> > 
> Sure. 

Thanks,

	M.

-- 
Without deviation from the norm, progress is not possible.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ