Re: [PATCH v3 1/3] cxl/features: Reject Get Feature count larger than the output buffer

From: Alison Schofield

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


On Fri, Jun 26, 2026 at 06:41:00PM +0800, Richard Cheng wrote:
> cxlctl_get_feature() sizes its output buffer from the user's
> fwctl_rpc.out_len, but the device is told to write
> cxl_mbox_get_feat_in.count bytes into rpc_out->payload, which is a
> separate user-controlled value. Nothing bounds count against out_len, so
> a small out_len with a large count overflows the kvzalloc()'d buffer.
> A heap OOB write reachable from FWCTL_RPC.
>
> Reject requests where count exceeds the available payload room, before
> allocating.


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