Skip to content

[Deepin-Kernel-SIG] [linux 6.6.y] [Upstream] Update kernel base to 6.6.162 - #2272

Merged
opsiff merged 4 commits into
deepin-community:linux-6.6.yfrom
opsiff:linux-stable-update-6.6.162
Nov 20, 2026
Merged

opsiff merged 4 commits into
deepin-community:linux-6.6.yfrom
opsiff:linux-stable-update-6.6.162

Conversation

@opsiff

@opsiff opsiff commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Update kernel base to 6.6.162.

Summary by Sourcery

Update the kernel base to 6.6.162 and incorporate upstream Xen backend stability fixes.

Bug Fixes:

  • Backport Xen block and network backend fixes to improve concurrent ring handling and multicast address cleanup during disconnect and reconnect paths.

Enhancements:

  • Update the kernel base version to 6.6.162.

jgross1 and others added 4 commits November 20, 2026 11:35
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 <yhlee@isslab.korea.ac.kr>
Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 89e534265b62c94749639350200b10370564bb3a)
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
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: b17075d ("xen-netback: fix race condition on XenBus disconnect")
Reported-by: kerhunt <kerhunt@proton.me>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 0d515c409033c8e2a645a781be3ca76ab825fc8c)
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
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 <yhlee@isslab.korea.ac.kr>
Signed-off-by: Juergen Gross <jgross@suse.com>
Acked-by: Roger Pau Monné <roger@xenproject.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit fe9ead8c5bdb752e329cecfecbdb5dfca5e9996b)
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 5139929c698c273e07cb0635732f6a918a7b8e78)
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
@sourcery-ai

sourcery-ai Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

Data structures

Add a rings lock and use it to synchronize Xen blkback ring allocation, teardown, and sysfs statistics reads.

  • drivers/block/xen-blkback/common.h L321-324
  • drivers/block/xen-blkback/xenbus.c L130-146, L348-357 (+5 small edits)

Implementation

Defer multicast-address-list freeing until after network processing has stopped, and synchronize the error teardown path before freeing queue data.

  • drivers/net/xen-netback/xenbus.c L270-271, L842
  • drivers/net/xen-netback/interface.c L812 (removed lines)

Configuration

Bump the kernel sublevel to 6.6.162.

  • Makefile L4

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from opsiff. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@opsiff
opsiff merged commit 9e39d6e into deepin-community:linux-6.6.y Nov 20, 2026
13 checks passed

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 2 issues

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="drivers/net/xen-netback/xenbus.c" line_range="842" />
<code_context>
 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]);
</code_context>
<issue_to_address>
**Statistics can access freed queues**

When queue setup fails after at least one queue has been initialized while a statistics read begins after the grace period, `xenvif_get_stats()` can start an RCU read after `synchronize_net()` returns, observe the still-positive `vif->num_queues`, and read `vif->queues` after the error path frees it with `vfree()`. The resulting use-after-free can crash the backend.

Set `num_queues` to zero before `synchronize_net()` in the error path, while preserving the count needed to deinitialize the queues.
</issue_to_address>

### Comment 2
<location path="drivers/net/xen-netback/interface.c" line_range="813" />
<code_context>
 		xenvif_disconnect_queue(queue);
 	}
-
-	xenvif_mcast_addr_list_free(vif);
 }

</code_context>
<issue_to_address>
**Failed reconnect retains multicast entries**

When a guest adds multicast addresses while a queue is active and a later queue or ring fails to connect, `xenvif_disconnect_data()` now stops the queues without clearing `fe_mcast_addr`, and the connection-error path only synchronizes and deinitializes those queues. Guest-supplied multicast entries therefore survive a failed connection and are reused on a later connection, leaving stale multicast membership and potentially allowing multicast traffic to reach the guest after it unsubscribes.

Clear the multicast list on the failed-connect path after the synchronization point, or otherwise ensure it is reset before reconnecting.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨

err:
if (be->vif->num_queues > 0)
xenvif_disconnect_data(be->vif); /* Clean up existing queues */
synchronize_net();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 High · Statistics can access freed queues

When queue setup fails after at least one queue has been initialized while a statistics read begins after the grace period, xenvif_get_stats() can start an RCU read after synchronize_net() returns, observe the still-positive vif->num_queues, and read vif->queues after the error path frees it with vfree(). The resulting use-after-free can crash the backend.

Set num_queues to zero before synchronize_net() in the error path, while preserving the count needed to deinitialize the queues.

Prompt for AI agents
In `drivers/net/xen-netback/xenbus.c` at line 842:

**Statistics can access freed queues**

When queue setup fails after at least one queue has been initialized while a statistics read begins after the grace period, `xenvif_get_stats()` can start an RCU read after `synchronize_net()` returns, observe the still-positive `vif->num_queues`, and read `vif->queues` after the error path frees it with `vfree()`. The resulting use-after-free can crash the backend.

Set `num_queues` to zero before `synchronize_net()` in the error path, while preserving the count needed to deinitialize the queues.

xenvif_disconnect_queue(queue);
}

xenvif_mcast_addr_list_free(vif);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Medium · Failed reconnect retains multicast entries

When a guest adds multicast addresses while a queue is active and a later queue or ring fails to connect, xenvif_disconnect_data() now stops the queues without clearing fe_mcast_addr, and the connection-error path only synchronizes and deinitializes those queues. Guest-supplied multicast entries therefore survive a failed connection and are reused on a later connection, leaving stale multicast membership and potentially allowing multicast traffic to reach the guest after it unsubscribes.

Clear the multicast list on the failed-connect path after the synchronization point, or otherwise ensure it is reset before reconnecting.

Prompt for AI agents
In `drivers/net/xen-netback/interface.c` at line 813:

**Failed reconnect retains multicast entries**

When a guest adds multicast addresses while a queue is active and a later queue or ring fails to connect, `xenvif_disconnect_data()` now stops the queues without clearing `fe_mcast_addr`, and the connection-error path only synchronizes and deinitializes those queues. Guest-supplied multicast entries therefore survive a failed connection and are reused on a later connection, leaving stale multicast membership and potentially allowing multicast traffic to reach the guest after it unsubscribes.

Clear the multicast list on the failed-connect path after the synchronization point, or otherwise ensure it is reset before reconnecting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants