[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen staging-4.12] xenoprof: clear buffer intended to be shared with guests



commit dc3fb833c609ef1e918c47ee9d4e2439b21ffece
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Tue Apr 14 14:55:05 2020 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Tue Apr 14 14:55:05 2020 +0200

    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 <ivansprundel@xxxxxxxxxxxx>
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    Reviewed-by: Wei Liu <wl@xxxxxxx>
    master commit: 0763a7ebfcdad66cf9e5475a1301eefb29bae9ed
    master date: 2020-04-14 14:32:33 +0200
---
 xen/common/xenoprof.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/xen/common/xenoprof.c b/xen/common/xenoprof.c
index 8a72e382e6..bed796c876 100644
--- a/xen/common/xenoprof.c
+++ b/xen/common/xenoprof.c
@@ -254,6 +254,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;
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.12



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.