Re: [PATCH 1/2] cxl/region: Fix out-of-bounds access in cxl_cancel_auto_attach()
From: Alison Schofield
Date: Thu Jun 11 2026 - 21:20:15 EST
On Sat, Jun 06, 2026 at 03:51:00PM +0800, Li Ming wrote:
> In cxl_cancel_auto_attach(), it assumes cxled->pos is a valid index for
> accessing p->targets[]. However, cxled->pos can be set to negative errno
> in cxl_region_sort_targets() if cxl_calc_interleave_pos() fails. This
> causes the driver to use a negative index to access p->targets[],
> resulting in out-of-bounds access.
>
> Fix it by walking p->targets[] instead of using cxled->pos directly.
Reviewed-by: Alison Schofield <alison.schofield@xxxxxxxxx>