From: Jan Beulich Date: Tue, 7 Jul 2020 13:19:40 +0000 (+0200) Subject: x86/shadow: correct an inverted conditional in dirty VRAM tracking X-Git-Tag: archive/raspbian/4.11.4+24-gddaaccbbab-1_deb10u1+rpi1^2^2~53^2~10 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=a3a392ef21ee562cead19d6fe34ac260aa9c0788;p=xen.git x86/shadow: correct an inverted conditional in dirty VRAM tracking This originally was "mfn_x(mfn) == INVALID_MFN". Make it like this again, taking the opportunity to also drop the unnecessary nearby braces. This is XSA-319. Fixes: 246a5a3377c2 ("xen: Use a typesafe to define INVALID_MFN") Signed-off-by: Jan Beulich Reviewed-by: Andrew Cooper master commit: 23a216f99d40fbfbc2318ade89d8213eea6ba1f8 master date: 2020-07-07 14:36:24 +0200 --- diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c index 34913c1ade..0b8682d7a9 100644 --- a/xen/arch/x86/mm/shadow/common.c +++ b/xen/arch/x86/mm/shadow/common.c @@ -3881,10 +3881,8 @@ int shadow_track_dirty_vram(struct domain *d, int dirty = 0; paddr_t sl1ma = dirty_vram->sl1ma[i]; - if ( !mfn_eq(mfn, INVALID_MFN) ) - { + if ( mfn_eq(mfn, INVALID_MFN) ) dirty = 1; - } else { page = mfn_to_page(mfn);