Re: [PATCH v3 3/3] cxl/features: Clamp Get Feature output size to the remaining buffer
Alison Schofield <[email protected]>
| Newsgroups | org.kernel.vger.linux-cxl,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <[email protected]> |
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 <[email protected]>