Skip to content

platform/surface: aggregator: Fix packet list handling in ssh_ptl_shutdown()

Wentao Liang lkml platform-driver-x86 stable 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 Latest2 patches 0 repliesNew

Changes in v2 from the cover letter

- Sorry for the delay in getting back to this review.
- Split into two patches as requested, instead of one patch that mixes two independent problems.
- The pending/complete list mismatch has its own changelog describing the effect of the wrong list node, as Maximilian asked for.
- Both patches carry Maximilian's Acked-by.

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2platform/surface: aggregator: Fix wrong completion list for pending packetsdrivers/platform/surface/aggregator/ssh_packet_layer.c+1 -10 replies
2/2platform/surface: aggregator: Fix use-after-free in ssh_ptl_shutdown()drivers/platform/surface/aggregator/ssh_packet_layer.c+2 -20 replies

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchMaximilian Luz
1/2A-b
2/2A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/2] platform/surface: aggregator: Fix packet list handling in ssh_ptl_shutdown()

Hi Maximilian, Ilpo,

this is a split of the single patch I sent in September, following the review comments from Ilpo and Maximilian. The two problems in ssh_ptl_shutdown() are independent, so patch 1 corrects the list that pending packets are moved to, and patch 2 makes both drain loops safe against the packet being released while iterating.

Changes in v2:
- Sorry for the delay in getting back to this review.
- Split into two patches as requested, instead of one patch that mixes two independent problems.
- The pending/complete list mismatch has its own changelog describing the effect of the wrong list node, as Maximilian asked for.
- Both patches carry Maximilian's Acked-by.

The candidate was found with our static analysis tooling; the audit and the fix were then assisted by DeepSeek and GPT-6.1 Sol. The patches are based on mainline as of d4872371bae (v7.4-rc1) and were built for x86_64 with CONFIG_SURFACE_AGGREGATOR=m, without new warnings; checkpatch.pl reports no issues. I could not test them at runtime, as that needs a Surface device shutting down with packets still queued or pending.

Wentao Liang (2):
platform/surface: aggregator: Fix wrong completion list for pending
packets
platform/surface: aggregator: Fix use-after-free in ssh_ptl_shutdown()

 drivers/platform/surface/aggregator/ssh_packet_layer.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
Signature · 1 line
2.34.1