Re: [PATCH v4 03/11] seq_buf: Copy what fits when seq_buf_puts() and seq_buf_putmem() overflow

From: Kees Cook

Date: Mon Oct 05 2026 - 06:11:49 EST


On Sat, Oct 03, 2026 at 04:50:58AM +0000, bot+bpf-ci@xxxxxxxxxx wrote:
> Can this break callers that rely on seq_buf_puts() dropping a string whole
> when it does not fit?

Yes, good catch; lpfc does. For v5 there's a new patch ahead of this one
that has lpfc_rx_monitor_report() print each record with
seq_buf_printf() and, when one doesn't fit, end the string where it
began, so its debugfs output still stops at the last whole record.

I've checked all the other users of seq_buf_puts() and didn't find any
other cases like this.

-Kees

--
Kees Cook