diff options
| author | Alison Schofield <alison.schofield@intel.com> | 2026-11-03 09:07:10 -0800 |
|---|---|---|
| committer | Dave Jiang <dave.jiang@intel.com> | 2026-11-16 14:50:41 -0700 |
| commit | b8183f9259b55fd79ecd0f2039bb4e9393eac936 (patch) | |
| tree | 1d475475a232e5894b80130b242d4e746466879f /kernel/debug | |
| parent | 1731c729762b54e41965a822415dd35b91570b81 (diff) | |
cxl/region: Reject a repeat write of an endpoint decoder to targetN
Writing an endpoint decoder to a region targetN attribute that already
holds it returns -EBUSY, but leaves the partially populated region in an
inconsistent state. The targetN attribute still names the decoder, so the
failed write gives no indication that the region was damaged.
Filling the remaining target positions can then trigger a NULL pointer
dereference in cxl_region_setup_targets(). This can be reproduced through
sysfs:
echo $decoder > /sys/bus/cxl/devices/region0/target0
echo $decoder > /sys/bus/cxl/devices/region0/target0
echo $other_decoder > /sys/bus/cxl/devices/region0/target1
An existing check recognizes the repeated assignment but incorrectly allows
the attachment to proceed, damaging region state. Remove that check so the
repeated write is rejected without disturbing the existing attachment,
consistent with the documented targetN ABI.
Fixes: 9995576cef48 ("cxl/region: Move region-position validation to a helper")
Signed-off-by: Alison Schofield <alison.schofield@intel.com>
Reviewed-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Reviewed-by: Ben Cheatham <benjamin.cheatham@amd.com>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Link: https://patch.msgid.link/e8235faea3d75dbfd45f197fe657c467b6259705.1793724885.git.alison.schofield@intel.com
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Diffstat (limited to 'kernel/debug')
0 files changed, 0 insertions, 0 deletions
