Skip to content

Commit 399df82

Browse files
committed
xen/blkfront: fix leaking data in shared pages
jira VULN-1437 cve CVE-2022-26365 commit-author Roger Pau Monne <[email protected]> commit 2f446ff upstream-diff One of the alloc_page calls has not been switched to GFP_KERNEL yet, so __GFP_ZERO is or'd with GFP_NOIO instead 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é <[email protected]> Reviewed-by: Jan Beulich <[email protected]> Reviewed-by: Juergen Gross <[email protected]> Signed-off-by: Juergen Gross <[email protected]> (cherry picked from commit 2f446ff) Signed-off-by: Brett Mastbergen <[email protected]>
1 parent 7daa064 commit 399df82

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
@@ -201,7 +201,7 @@ static int fill_grant_buffer(struct blkfront_info *info, int num)
201201
goto out_of_memory;
202202

203203
if (info->feature_persistent) {
204-
granted_page = alloc_page(GFP_NOIO);
204+
granted_page = alloc_page(GFP_NOIO | __GFP_ZERO);
205205
if (!granted_page) {
206206
kfree(gnt_list_entry);
207207
goto out_of_memory;
@@ -1707,7 +1707,8 @@ static int blkfront_setup_indirect(struct blkfront_info *info)
17071707

17081708
BUG_ON(!list_empty(&info->indirect_pages));
17091709
for (i = 0; i < num; i++) {
1710-
struct page *indirect_page = alloc_page(GFP_NOIO);
1710+
struct page *indirect_page = alloc_page(GFP_NOIO |
1711+
__GFP_ZERO);
17111712
if (!indirect_page)
17121713
goto out_of_memory;
17131714
list_add(&indirect_page->lru, &info->indirect_pages);

0 commit comments

Comments
 (0)