]> xenbits.xensource.com Git - xen.git/commit
x86/P2M: deal with partial success of p2m_set_entry() 4.16.0-rc4
authorJan Beulich <jbeulich@suse.com>
Mon, 22 Nov 2021 11:12:32 +0000 (11:12 +0000)
committerIan Jackson <iwj@xenproject.org>
Mon, 22 Nov 2021 12:27:30 +0000 (12:27 +0000)
commit74a11c43fd7e074b1f77631b446dd2115eacb9e8
tree70b8f2b323ef9bf4a2bdddbcce4b2588eace7e62
parent8ec13f68e0b026863d23e7f44f252d06478bc809
x86/P2M: deal with partial success of p2m_set_entry()

M2P and PoD stats need to remain in sync with P2M; if an update succeeds
only partially, respective adjustments need to be made. If updates get
made before the call, they may also need undoing upon complete failure
(i.e. including the single-page case).

Log-dirty state would better also be kept in sync.

Note that the change to set_typed_p2m_entry() may not be strictly
necessary (due to the order restriction enforced near the top of the
function), but is being kept here to be on the safe side.

This is CVE-2021-28705 and CVE-2021-28709 / XSA-389.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
xen/arch/x86/mm/p2m.c