]> git.baikalelectronics.ru Git - kernel.git/commitdiff
xen/netfront: fix leaking data in shared pages
authorRoger Pau Monne <roger.pau@citrix.com>
Wed, 6 Apr 2022 15:38:04 +0000 (17:38 +0200)
committerJuergen Gross <jgross@suse.com>
Fri, 1 Jul 2022 08:00:14 +0000 (10:00 +0200)
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-33740, 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>
drivers/net/xen-netfront.c

index 8c0b9546d5a2d6e7620ffcf9f1f9385f08842187..e3165139629d5809994f3201f4e218f04f883b73 100644 (file)
@@ -271,7 +271,8 @@ static struct sk_buff *xennet_alloc_one_rx_buffer(struct netfront_queue *queue)
        if (unlikely(!skb))
                return NULL;
 
-       page = page_pool_dev_alloc_pages(queue->page_pool);
+       page = page_pool_alloc_pages(queue->page_pool,
+                                    GFP_ATOMIC | __GFP_NOWARN | __GFP_ZERO);
        if (unlikely(!page)) {
                kfree_skb(skb);
                return NULL;