Linux CXL
 help / color / mirror / Atom feed
* [PATCH v3 0/2] cxl: Fix uninitialized access coordinates
@ 2026-08-12  8:30 Guixin Liu
  2026-08-12  8:30 ` [PATCH v3 1/2] cxl/cdat: Fix uninitialized stack use in bandwidth gathering Guixin Liu
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Guixin Liu @ 2026-08-12  8:30 UTC (permalink / raw)
  To: Davidlohr Bueso, Jonathan Cameron, Dave Jiang, Alison Schofield,
	Vishal Verma, Dan Williams, Ira Weiny, Li Ming
  Cc: linux-cxl

Two related fixes for stack access_coordinate arrays that are read before
anything writes them, both reachable on real topologies and both ending up
in userspace through the access coordinate sysfs attributes.

Patch 1 is the v2 cdat fix [1] with one more site covered: the coords array
in cxl_switch_gather_bandwidth() has the same defect as the three arrays in
cxl_endpoint_gather_bandwidth().

Patch 2 is new. cxl_endpoint_get_perf_coordinates() returns 0 for an RCD
without writing the caller's array at all, so cxl_port_perf_data_calculate()
combines stack residue with the values parsed from the RCD's CDAT.

Both were pointed out by the Sashiko review bot on the v2 posting of patch 1.
The third finding in that review - cxl_coordinates_combine() aliasing its
output onto an input and leaving a member alone when an input bandwidth is
zero - is the intended "not reported" behaviour and is not addressed here.

[1] https://lore.kernel.org/linux-cxl/20260812060912.54932-1-kanie@linux.alibaba.com/

v2->v3:
- also zero initialize coords in cxl_switch_gather_bandwidth(), same defect
  in the sibling gather path (Sashiko bot)
- new patch 2: clear the output coordinates on the RCD path of
  cxl_endpoint_get_perf_coordinates(), which currently returns success
  without writing them (Sashiko bot)
- drop "endpoint" from the patch 1 subject, it now covers both gather paths

v1->v2:
- rebase onto cxl/next
- rewrite the commit message to describe the behaviour rather than narrate
  the code change (Alison Schofield)

Guixin Liu (2):
  cxl/cdat: Fix uninitialized stack use in bandwidth gathering
  cxl/port: Fix uninitialized coordinates reported for RCDs

 drivers/cxl/core/cdat.c | 8 ++++----
 drivers/cxl/core/port.c | 4 +++-
 2 files changed, 7 insertions(+), 5 deletions(-)


base-commit: 7098e9cd98a05c0c5de2fae0c2465f9d966fdd07
-- 
2.43.7


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-08-12  9:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-12  8:30 [PATCH v3 0/2] cxl: Fix uninitialized access coordinates Guixin Liu
2026-08-12  8:30 ` [PATCH v3 1/2] cxl/cdat: Fix uninitialized stack use in bandwidth gathering Guixin Liu
2026-08-12  8:44   ` sashiko-bot
2026-08-12  9:08     ` Guixin Liu
2026-08-12  8:30 ` [PATCH v3 2/2] cxl/port: Fix uninitialized coordinates reported for RCDs Guixin Liu
2026-08-12  9:48 ` [PATCH v3 0/2] cxl: Fix uninitialized access coordinates Richard Cheng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox