> 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 <[email protected]> > Reviewed-by: Dave Jiang <[email protected]> > Reviewed-by: Alison Schofield <[email protected]> > Signed-off-by: Kees Cook <[email protected]>
Sashiko has reviewed this patch and found no issues. It looks great! -- Sashiko AI review ยท https://sashiko.dev/#/patchset/[email protected]?part=10
