Skip to content

Commit 2f446ff

Browse files
roygerjgross1
authored andcommitted
xen/blkfront: fix leaking data in shared pages
When allocating pages to be used for shared communication with the backend always zero them, this avoids leaking unintended data present on the pages. This is CVE-2022-26365, part of XSA-403. Signed-off-by: Roger Pau Monné <roger.pau@citrix.com> Reviewed-by: Jan Beulich <jbeulich@suse.com> Reviewed-by: Juergen Gross <jgross@suse.com> Signed-off-by: Juergen Gross <jgross@suse.com>
1 parent a175eca commit 2f446ff

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/block/xen-blkfront.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ static int fill_grant_buffer(struct blkfront_ring_info *rinfo, int num)
311311
goto out_of_memory;
312312

313313
if (info->feature_persistent) {
314-
granted_page = alloc_page(GFP_NOIO);
314+
granted_page = alloc_page(GFP_NOIO | __GFP_ZERO);
315315
if (!granted_page) {
316316
kfree(gnt_list_entry);
317317
goto out_of_memory;
@@ -2183,7 +2183,8 @@ static int blkfront_setup_indirect(struct blkfront_ring_info *rinfo)
21832183

21842184
BUG_ON(!list_empty(&rinfo->indirect_pages));
21852185
for (i = 0; i < num; i++) {
2186-
struct page *indirect_page = alloc_page(GFP_KERNEL);
2186+
struct page *indirect_page = alloc_page(GFP_KERNEL |
2187+
__GFP_ZERO);
21872188
if (!indirect_page)
21882189
goto out_of_memory;
21892190
list_add(&indirect_page->lru, &rinfo->indirect_pages);

0 commit comments

Comments
 (0)