On Mon, 05 Oct 2026 08:56:50 -0700, Kees Cook wrote:
> While working on seq_buf conversions[1], we found there was a need for
> seq_buf_strlen() (since calling strlen(seq_buf_str()) would be a waste
> of time: seq_buf already knows the length), seq_buf_init_append() (to
> start a seq_buf from an existing string buffer), and seq_buf_terminate()
> (as there are many callers using seq_buf_str() just for its termination
> side-effect). And while implementing that, we found a bunch of other
> related things that needed fixing. This is that ever-growing series,
> with tests for each fix.
>
> [...]
Applied to for-next/hardening.
[01/12] seq_buf: Do not print an empty line from an overflowed
seq_buf_do_printk()
https://git.kernel.org/kees/c/a09fb764832d
[02/12] seq_buf: Do not pop from an overflowed seq_buf
https://git.kernel.org/kees/c/b7e688b5635a
[03/12] scsi: lpfc: Print rx monitor records straight into the seq_buf
https://git.kernel.org/kees/c/cc9d25b45119
[04/12] seq_buf: Copy what fits when seq_buf_puts() and seq_buf_putmem()
overflow
https://git.kernel.org/kees/c/505a4aeea2c9
[05/12] seq_buf: Clear what a writer did not claim when a seq_buf overflows
https://git.kernel.org/kees/c/ea5666e56723
[06/12] seq_buf: Add seq_buf_strlen()
https://git.kernel.org/kees/c/8d1478bfd63b
[07/12] seq_buf: Add seq_buf_terminate()
https://git.kernel.org/kees/c/88c652df02cc
[08/12] bpf: Remove dead newline stripping from format_disasm_line()
https://git.kernel.org/kees/c/c8cd1725d259
[09/12] seq_buf: Add seq_buf_init_append()
https://git.kernel.org/kees/c/61ef3f1490f8
[10/12] powerpc/papr_scm: Return the string length from the sysfs show functions
https://git.kernel.org/kees/c/63ae65caa98a
[11/12] nvdimm: ndtest: Return the string length from flags_show()
https://git.kernel.org/kees/c/9ac219976ecf
[12/12] docs: core-api: Document the seq_buf API
https://git.kernel.org/kees/c/e3f8dfafd7d6
Take care,
--
Kees Cook