Re: [PATCH v3 3/3] cxl/features: Clamp Get Feature output size to the remaining buffer

From: Alison Schofield

Date: Tue Jul 14 2026 - 15:39:07 EST


On Fri, Jun 26, 2026 at 06:41:02PM +0800, Richard Cheng wrote:
> cxl_get_feature() reads a feature in a loop but passes a fixed size_out
> as the output capacity every iteration. On the last partial iteration
> the buffer has less room left, so a device that returns more than asked
> can overflow feat_out.
>
> Use the per-iter size data_to_rd_size, which already tracks the
> remaining room, as the output capacity.

Reviewed-by: Alison Schofield <alison.schofield@xxxxxxxxx>