xen/arm: vgic-v2: Don't crash the hypervisor if the SGI target mode is invalid

The GICv2 spec reserved the value 0b11 for GICD_SGIR.TargetListFilter.

Even if it's an invalid value, a malicious guest could write this value
and threfore crash the hypervisor.

Replace the BUG() by logging the error and inject a data abort to the guest.

This was introduced by commit ea37fd2111
"xen/arm: split vgic driver into generic and vgic-v2 driver".

This is CVE-2015-0268 / XSA-117.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
This commit is contained in:
Julien Grall authored and Ian Campbell committed 2015-02-18 10:26:13 +00:00
1 parent 4f3d3612e6
commit 97c4e77538
1 file changed
+4 -1
+4 -1
View File
@@ -257,7 +257,10 @@ static int vgic_v2_to_sgi(struct vcpu *v, register_t sgir)
sgi_mode = SGI_TARGET_SELF;
break;
default:
BUG();
printk(XENLOG_G_DEBUG
"%pv: vGICD: unhandled GICD_SGIR write %"PRIregister" with wrong mode\n",
v, sgir);
return 0;
}
return vgic_to_sgi(v, sgir, sgi_mode, virq, vcpu_mask);
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.