From: Jan Beulich Date: Tue, 14 Apr 2020 13:16:07 +0000 (+0200) Subject: xenoprof: clear buffer intended to be shared with guests X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=b3718b79184b973d7c5d7ae625b9bea126f748ec;p=xen.git xenoprof: clear buffer intended to be shared with guests 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 Signed-off-by: Jan Beulich Reviewed-by: Andrew Cooper Reviewed-by: Wei Liu master commit: 0763a7ebfcdad66cf9e5475a1301eefb29bae9ed master date: 2020-04-14 14:32:33 +0200 --- diff --git a/xen/common/xenoprof.c b/xen/common/xenoprof.c index a5fe6204a5..1b7c58d60b 100644 --- a/xen/common/xenoprof.c +++ b/xen/common/xenoprof.c @@ -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;