[PATCH v4 10/11] nvdimm: ndtest: Return the string length from flags_show()
sashiko-bot at kernel.org
sashiko-bot at kernel.org
Sat Oct 3 04:08:18 UTC 2026
> flags_show() build their output with a seq_buf and return seq_buf_used(),
> which may include the trailing NUL byte when the seq_buf has
> overflowed. Use seq_buf_strlen() instead.
>
> The flag names are far shorter than the PAGE_SIZE buffer sysfs
> provides, so this cannot overflow today.
>
> Build tested ARCH=x86_64 with GCC 16.2.0, built out of tree with
> make M=tools/testing/nvdimm:
> tools/testing/nvdimm/test/ndtest.o
>
> Assisted-by: LLM
> Reviewed-by: Andy Shevchenko <andriy.shevchenko at linux.intel.com>
> Reviewed-by: Dave Jiang <dave.jiang at intel.com>
> Reviewed-by: Alison Schofield <alison.schofield at intel.com>
> Signed-off-by: Kees Cook <kees at kernel.org>
Sashiko has reviewed this patch and found no issues. It looks great!
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261003035906.too.263-kees@kernel.org?part=10
More information about the Linux-security-module-archive
mailing list