From b07e2e9e55b620710bafd1afe1770485afa9dc6f Mon Sep 17 00:00:00 2001 From: Juergen Gross Date: Fri, 6 Nov 2026 13:07:52 +0100 Subject: [PATCH 1/4] xen-netback: Fix UAF when reading statistics data commit 5fb756f1bbec7a3862dda5d79028bf656271804c upstream. The network statistic data in the driver is protected by RCU. Unfortunately when tearing down the queues after an error during connecting to the frontend (e.g. due to illegal Xenstore data filled in by the guest), the statistic data is being freed without synchronizing the RCU state. In case the data is being read via sysfs in this phase, access to already freed memory or memory being in new use is possible. Fix that by calling synchronize_net() before freeing the queue data. This is XSA-526 / CVE-2026-100080 Reported-by: Yehyeong Lee Signed-off-by: Juergen Gross Signed-off-by: Greg Kroah-Hartman (cherry picked from commit 89e534265b62c94749639350200b10370564bb3a) Signed-off-by: Wentao Guan --- drivers/net/xen-netback/xenbus.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/xen-netback/xenbus.c b/drivers/net/xen-netback/xenbus.c index 61b547aab286a..5e4d522de36bd 100644 --- a/drivers/net/xen-netback/xenbus.c +++ b/drivers/net/xen-netback/xenbus.c @@ -837,6 +837,7 @@ static void connect(struct backend_info *be) err: if (be->vif->num_queues > 0) xenvif_disconnect_data(be->vif); /* Clean up existing queues */ + synchronize_net(); for (queue_index = 0; queue_index < be->vif->num_queues; ++queue_index) xenvif_deinit_queue(&be->vif->queues[queue_index]); vfree(be->vif->queues); From 54a5776fdaba4309c11120eefe679bd181dc0daa Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Fri, 6 Nov 2026 17:07:01 +0100 Subject: [PATCH 2/4] xen-netback: defer xenvif_mcast_addr_list_free() commit bfddc420afe827d9f06458cdf8087cd602f8c9cb upstream. In order for the function to legitimately avoid locking/RCU, it needs to run after all TX/RX processing has finished/stopped: Lookups happen from xenvif_start_xmit(), while adds/removes happen from xenvif_tx_action() (called out of xenvif_poll()). Move the call out of xenvif_disconnect_data() (the call to the function from connect()'s error path doesn't require any cleaning up there), and put it past the synchronization point in backend_disconnect(). This is XSA-527 / CVE-2026-100081. Fixes: b17075d5c198 ("xen-netback: fix race condition on XenBus disconnect") Reported-by: kerhunt Signed-off-by: Jan Beulich Reviewed-by: Juergen Gross Signed-off-by: Greg Kroah-Hartman (cherry picked from commit 0d515c409033c8e2a645a781be3ca76ab825fc8c) Signed-off-by: Wentao Guan --- drivers/net/xen-netback/interface.c | 2 -- drivers/net/xen-netback/xenbus.c | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/xen-netback/interface.c b/drivers/net/xen-netback/interface.c index acf310e58f7e2..0c4b77acc56bb 100644 --- a/drivers/net/xen-netback/interface.c +++ b/drivers/net/xen-netback/interface.c @@ -809,8 +809,6 @@ void xenvif_disconnect_data(struct xenvif *vif) xenvif_disconnect_queue(queue); } - - xenvif_mcast_addr_list_free(vif); } void xenvif_disconnect_ctrl(struct xenvif *vif) diff --git a/drivers/net/xen-netback/xenbus.c b/drivers/net/xen-netback/xenbus.c index 5e4d522de36bd..aca25db2503b6 100644 --- a/drivers/net/xen-netback/xenbus.c +++ b/drivers/net/xen-netback/xenbus.c @@ -267,6 +267,8 @@ static void backend_disconnect(struct backend_info *be) vif->num_queues = 0; synchronize_net(); + xenvif_mcast_addr_list_free(vif); + for (queue_index = 0; queue_index < num_queues; ++queue_index) xenvif_deinit_queue(&vif->queues[queue_index]); From 4d8ccbf6353bbb0891e6713fb92f369abf3f8b93 Mon Sep 17 00:00:00 2001 From: Juergen Gross Date: Thu, 5 Nov 2026 08:27:38 +0100 Subject: [PATCH 3/4] xen-blkback: Avoid UAF when reading I/O statistics MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit commit a02926f7c89bfc798ee9514e09694ff4279928a1 upstream. Reading I/O statistics via sysfs concurrently with tearing down a frontend device might result in UAF or a NULL dereference, as the reading of the statistics data is not synchronized with freeing the data. Use a rwlock for synchronizing. This is XSA-528 / CVE-2026-100082 Reported-by: Yehyeong Lee Signed-off-by: Juergen Gross Acked-by: Roger Pau Monné Signed-off-by: Greg Kroah-Hartman (cherry picked from commit fe9ead8c5bdb752e329cecfecbdb5dfca5e9996b) Signed-off-by: Wentao Guan --- drivers/block/xen-blkback/common.h | 2 ++ drivers/block/xen-blkback/xenbus.c | 31 +++++++++++++++++++++++------- 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/drivers/block/xen-blkback/common.h b/drivers/block/xen-blkback/common.h index 40f67bfc052de..4ade16ae45f34 100644 --- a/drivers/block/xen-blkback/common.h +++ b/drivers/block/xen-blkback/common.h @@ -318,8 +318,10 @@ struct xen_blkif { unsigned int nr_ring_pages; bool multi_ref; /* All rings for this device. */ + rwlock_t rings_lock; struct xen_blkif_ring *rings; unsigned int nr_rings; + unsigned long buffer_squeeze_end; }; diff --git a/drivers/block/xen-blkback/xenbus.c b/drivers/block/xen-blkback/xenbus.c index bb66178c432b0..b4ea123e9be18 100644 --- a/drivers/block/xen-blkback/xenbus.c +++ b/drivers/block/xen-blkback/xenbus.c @@ -127,15 +127,23 @@ static void xen_update_blkif_status(struct xen_blkif *blkif) return; } -static int xen_blkif_alloc_rings(struct xen_blkif *blkif) +static int xen_blkif_alloc_rings(struct xen_blkif *blkif, + unsigned int nr_rings) { unsigned int r; + struct xen_blkif_ring *rings; - blkif->rings = kcalloc(blkif->nr_rings, sizeof(struct xen_blkif_ring), - GFP_KERNEL); - if (!blkif->rings) + rings = kcalloc(nr_rings, sizeof(struct xen_blkif_ring), GFP_KERNEL); + if (!rings) return -ENOMEM; + write_lock(&blkif->rings_lock); + + blkif->rings = rings; + blkif->nr_rings = nr_rings; + + write_unlock(&blkif->rings_lock); + for (r = 0; r < blkif->nr_rings; r++) { struct xen_blkif_ring *ring = &blkif->rings[r]; @@ -175,6 +183,7 @@ static struct xen_blkif *xen_blkif_alloc(domid_t domid) blkif->domid = domid; atomic_set(&blkif->refcnt, 1); init_completion(&blkif->drain_complete); + rwlock_init(&blkif->rings_lock); /* * Because freeing back to the cache may be deferred, it is not @@ -269,6 +278,7 @@ static int xen_blkif_disconnect(struct xen_blkif *blkif) struct pending_req *req, *n; unsigned int j, r; bool busy = false; + struct xen_blkif_ring *rings; for (r = 0; r < blkif->nr_rings; r++) { struct xen_blkif_ring *ring = &blkif->rings[r]; @@ -335,10 +345,16 @@ static int xen_blkif_disconnect(struct xen_blkif *blkif) * blkif->rings was allocated in connect_ring, so we should free it in * here. */ - kfree(blkif->rings); + write_lock(&blkif->rings_lock); + + rings = blkif->rings; blkif->rings = NULL; blkif->nr_rings = 0; + write_unlock(&blkif->rings_lock); + + kfree(rings); + return 0; } @@ -386,6 +402,7 @@ void xen_blkif_interface_fini(void) unsigned int i; \ unsigned long long result = 0; \ \ + read_lock(&blkif->rings_lock); \ if (!blkif->rings) \ goto out; \ \ @@ -396,6 +413,7 @@ void xen_blkif_interface_fini(void) } \ \ out: \ + read_unlock(&blkif->rings_lock); \ return sprintf(buf, format, result); \ } \ static DEVICE_ATTR(name, 0444, show_##name, NULL) @@ -1104,8 +1122,7 @@ static int connect_ring(struct backend_info *be) requested_num_queues, xenblk_max_queues); return -ENOSYS; } - blkif->nr_rings = requested_num_queues; - if (xen_blkif_alloc_rings(blkif)) + if (xen_blkif_alloc_rings(blkif, requested_num_queues)) return -ENOMEM; pr_info("%s: using %d queues, protocol %d (%s) %s\n", dev->nodename, From 1774e4ac5744c050d956d12cc63e70e57381388b Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Fri, 6 Nov 2026 13:15:59 -0500 Subject: [PATCH 4/4] Linux 6.6.162 Signed-off-by: Greg Kroah-Hartman (cherry picked from commit 5139929c698c273e07cb0635732f6a918a7b8e78) Signed-off-by: Wentao Guan --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index cdf196014d06c..b8a408157f17d 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 VERSION = 6 PATCHLEVEL = 6 -SUBLEVEL = 161 +SUBLEVEL = 162 EXTRAVERSION = NAME = Pinguïn Aangedreven