On Tue, Dec 03, 2024 at 01:20:55PM +0000, Marc Zyngier wrote: > On Tue, 03 Dec 2024 12:46:00 +0000, > <gregkh@xxxxxxxxxxxxxxxxxxx> wrote: > > > > > > This is a note to let you know that I've just added the patch titled > > > > KVM: arm64: vgic-its: Add stronger type-checking to the ITS entry sizes > > > > to the 6.12-stable tree which can be found at: > > http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary > > > > The filename of the patch is: > > kvm-arm64-vgic-its-add-stronger-type-checking-to-the-its-entry-sizes.patch > > and it can be found in the queue-6.12 subdirectory. > > > > If you, or anyone else, feels it should not be added to the stable tree, > > please let <stable@xxxxxxxxxxxxxxx> know about it. > > > > > > From 3b2c81d5feb250dfdcb0ef5825319f36c29f8336 Mon Sep 17 00:00:00 2001 > > From: Marc Zyngier <maz@xxxxxxxxxx> > > Date: Sun, 17 Nov 2024 16:57:57 +0000 > > Subject: KVM: arm64: vgic-its: Add stronger type-checking to the ITS entry sizes > > > > From: Marc Zyngier <maz@xxxxxxxxxx> > > > > commit 3b2c81d5feb250dfdcb0ef5825319f36c29f8336 upstream. > > > > The ITS ABI infrastructure allows for some pretty lax code, where > > the size of the data doesn't have to match the size of the entry, > > potentially leading to a collection of interesting bugs. > > > > Commit 7fe28d7e68f9 ("KVM: arm64: vgic-its: Add a data length check > > in vgic_its_save_*") added some checks, but starts by implicitly > > casting all writes to a 64bit value, hiding some of the issues. > > > > Instead, introduce macros that will check the data type actually used > > for dealing with the table entries. The macros are taking a symbolic > > entry type that is used to fetch the size of the entry type for the > > current ABI. This immediately catches a couple of low-impact gotchas > > (zero values that are implicitly 32bit), easy enough to fix. > > > > Given that we currently only have a single ABI, hardcode a couple of > > BUILD_BUG_ON()s that will fire if we use anything but a 64bit quantity, > > and some (currently unreachable) fallback code that may become useful > > one day. > > > > Signed-off-by: Marc Zyngier <maz@xxxxxxxxxx> > > Link: https://lore.kernel.org/r/20241117165757.247686-5-maz@xxxxxxxxxx > > Signed-off-by: Oliver Upton <oliver.upton@xxxxxxxxx> > > Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> > > What is the reason for backporting this? It doesn't fix anything in > 6.12. The second paragraph of the changelog made it seem like "this will fix some hidden issues". If that's not the case, I'll gladly drop this. thanks, greg k-h