gnttab: fix array capacity check in gnttab_get_status_frames()
authorJan Beulich <jbeulich@suse.com>
Wed, 25 Aug 2021 13:08:09 +0000 (15:08 +0200)
committerJan Beulich <jbeulich@suse.com>
Wed, 25 Aug 2021 13:08:09 +0000 (15:08 +0200)
commit66f5e867c6e3d400af354ab72e924fa7b3ada733
tree7c79ce7cec1cbd98f5c85d4cbe34da75c40c4647
parentb81187fc4032be56be712f0126c7215f243093ed
gnttab: fix array capacity check in gnttab_get_status_frames()

The number of grant frames is of no interest here; converting the passed
in op.nr_frames this way means we allow for 8 times as many GFNs to be
written as actually fit in the array. We would corrupt xlat areas of
higher vCPU-s (after having faulted many times while trying to write to
the guard pages between any two areas) for 32-bit PV guests. For HVM
guests we'd simply crash as soon as we hit the first guard page, as
accesses to the xlat area are simply memcpy() there.

This is CVE-2021-28699 / XSA-382.

Fixes: 18b1be5e324b ("gnttab: make resource limits per domain")
Signed-off-by: Jan Beulich <jbeulich@suse.com>
master commit: ec820035b875cdbedce5e73f481ce65963ede9ed
master date: 2021-08-25 14:19:09 +0200
xen/common/grant_table.c