]> git.ipfire.org Git - thirdparty/linux.git/commit
KVM: arm64: vgic-its: Add a data length check in vgic_its_save_*
authorJing Zhang <jingzhangos@google.com>
Thu, 7 Nov 2024 21:41:34 +0000 (13:41 -0800)
committerOliver Upton <oliver.upton@linux.dev>
Mon, 11 Nov 2024 19:50:14 +0000 (19:50 +0000)
commit7fe28d7e68f92cc3d0668b8f2fbdf5c303ac3022
tree9f88eb8bf7611b48791de2dde99869fb9da0e5df
parent81983758430957d9a5cb3333fe324fd70cf63e7e
KVM: arm64: vgic-its: Add a data length check in vgic_its_save_*

In all the vgic_its_save_*() functinos, they do not check whether
the data length is 8 bytes before calling vgic_write_guest_lock.
This patch adds the check. To prevent the kernel from being blown up
when the fault occurs, KVM_BUG_ON() is used. And the other BUG_ON()s
are replaced together.

Cc: stable@vger.kernel.org
Signed-off-by: Kunkun Jiang <jiangkunkun@huawei.com>
[Jing: Update with the new entry read/write helpers]
Signed-off-by: Jing Zhang <jingzhangos@google.com>
Link: https://lore.kernel.org/r/20241107214137.428439-4-jingzhangos@google.com
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
arch/arm64/kvm/vgic/vgic-its.c
arch/arm64/kvm/vgic/vgic.h