]> xenbits.xensource.com Git - xen.git/commitdiff
xenoprof: clear buffer intended to be shared with guests
authorJan Beulich <jbeulich@suse.com>
Tue, 14 Apr 2020 13:16:07 +0000 (15:16 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 14 Apr 2020 13:16:07 +0000 (15:16 +0200)
alloc_xenheap_pages() making use of MEMF_no_scrub is fine for Xen
internally used allocations, but buffers allocated to be shared with
(unpriviliged) guests need to be zapped of their prior content.

This is part of XSA-313.

Reported-by: Ilja Van Sprundel <ivansprundel@ioactive.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Wei Liu <wl@xen.org>
master commit: 0763a7ebfcdad66cf9e5475a1301eefb29bae9ed
master date: 2020-04-14 14:32:33 +0200

xen/common/xenoprof.c

index a5fe6204a57ee0de7d20e0feb7d49def16c58e9b..1b7c58d60b2143a9c7df06968c16333d8adb1554 100644 (file)
@@ -248,6 +248,9 @@ static int alloc_xenoprof_struct(
         return -ENOMEM;
     }
 
+    for ( i = 0; i < npages; ++i )
+        clear_page(d->xenoprof->rawbuf + i * PAGE_SIZE);
+
     d->xenoprof->npages = npages;
     d->xenoprof->nbuf = nvcpu;
     d->xenoprof->bufsize = bufsize;