x86/PoD: handle intermediate page orders in p2m_pod_cache_add()
authorJan Beulich <jbeulich@suse.com>
Mon, 22 Nov 2021 11:11:44 +0000 (11:11 +0000)
committerIan Jackson <iwj@xenproject.org>
Mon, 22 Nov 2021 12:27:30 +0000 (12:27 +0000)
commit8ec13f68e0b026863d23e7f44f252d06478bc809
tree2473bb728437f7926078b3951d7ade7523b53374
parent182c737b9ba540ebceb1433f3940fbed6eac4ea9
x86/PoD: handle intermediate page orders in p2m_pod_cache_add()

p2m_pod_decrease_reservation() may pass pages to the function which
aren't 4k, 2M, or 1G. Handle all intermediate orders as well, to avoid
hitting the BUG() at the switch() statement's "default" case.

This is CVE-2021-28708 / part of XSA-388.

Fixes: 3c352011c0d3 ("x86/PoD: shorten certain operations on higher order ranges")
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
xen/arch/x86/mm/p2m-pod.c