]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
KVM: arm64: vgic: Handle const qualifier from gic_kvm_info allocation type
authorKees Cook <kees@kernel.org>
Fri, 6 Feb 2026 22:30:23 +0000 (14:30 -0800)
committerMarc Zyngier <maz@kernel.org>
Fri, 13 Feb 2026 14:59:04 +0000 (14:59 +0000)
commitee5c38a8d31e5dea52299c43c2ec3213351ab6e1
treeaa3469217cc140308d37b5e4153c662f92f3b402
parent02471a78a052b631204aed051ab718e4d14ae687
KVM: arm64: vgic: Handle const qualifier from gic_kvm_info allocation type

In preparation for making the kmalloc family of allocators type aware,
we need to make sure that the returned type from the allocation matches
the type of the variable being assigned. (Before, the allocator would
always return "void *", which can be implicitly cast to any pointer type.)

The assigned type is "struct gic_kvm_info", but the returned type,
while matching, is const qualified. To get them exactly matching, just
use the dereferenced pointer for the sizeof().

Signed-off-by: Kees Cook <kees@kernel.org>
Link: https://patch.msgid.link/20260206223022.it.052-kees@kernel.org
Signed-off-by: Marc Zyngier <maz@kernel.org>
arch/arm64/kvm/vgic/vgic-init.c