Re: [ndctl PATCH v2] test/fwctl: Add Feature OOB rejection regression tests

Alison Schofield <[email protected]>
Newsgroups org.kernel.vger.linux-cxl,dev.linux.lists.nvdimm,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
On Tue, Jul 21, 2026 at 02:21:22PM +0800, Richard Cheng wrote:
> Add negative cases for the CXL fwctl Get Feature and Set Feature output
> buffer bounds checks.
> 
> For Get Feature, request a non-zero payload while providing room only
> for the fwctl_rpc_cxl_out header. Verify that the kernel rejects the
> request with -EINVAL instead of writing past the rpc_out buffer.
> 
> For Set Feature, build a valid request and set out_len to zero. Verify
> that the kernel rejects it with -EINVAL. Without the bounds check,
> kvzalloc(0) returns ZERO_SIZE_PTR and the output header write can oops
> the kernel.
> 
> Both cases depend on fixes [1]. Gate the tests on the running kernel
> version so older kernels skip the unsafe requests rather than failing
> the fwctl test.
> 
> [1]: https://lore.kernel.org/all/[email protected]/
> Signed-off-by: Richard Cheng <[email protected]>
> ---

Thanks!

Reviewed-by: Alison Schofield <[email protected]>

Applied to pending for NDCTL v86
https://github.com/pmem/ndctl/commits/pending/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.