Thread View: linux.kernel.netdev
2 messages
2 total messages
Started by Stephen Hemminger
Tue, 20 Oct 2026 18:06
Re: [PATCH iproute2] ss: bound fscanf width when reading comm in user_ent_hash_build_task
Author: Stephen Hemminger
Date: Tue, 20 Oct 2026 18:06
Date: Tue, 20 Oct 2026 18:06
17 lines
11609 bytes
11609 bytes
On Tue, 20 Oct 2026 09:59:56 -0700
Prashanth Swaminathan <prashanthsw@google.com> wrote:
> user_ent_hash_build_task() reads the process comm name from
> /proc/<pid>/stat into a 16-byte stack buffer (char name[16]) using an
> unbounded fscanf("%*d (%[^)])", name).
>
> Although the Linux kernel bounds the comm field to TASK_COMM_LEN - 1
> (15) bytes, bound the conversion specifier to %15[^)] so a malformed
> stat entry (e.g., via PROC_ROOT or non-standard procfs implementations)
> cannot overflow the stack buffer.
>
> Signed-off-by: Prashanth Swaminathan <prashanthsw@google.com>
> ---
If you have a non-standard procfs, that is not our problem.
Re: [PATCH iproute2] ss: bound fscanf width when reading comm in user_ent_hash_build_task
Author: Stephen Hemminger
Date: Wed, 21 Oct 2026 02:46
Date: Wed, 21 Oct 2026 02:46
11 lines
11515 bytes
11515 bytes
On Tue, 20 Oct 2026 15:13:58 -0700 Prashanth Swaminathan <prashanthsw@google.com> wrote: > No problem. I couldn't find any definitive source on the org's current > thinking regarding whether these types of hardening changes, which don't > actually cover a security vulnerability, are desirable, so I erred on the > side of caution. Apologies for the thrash! It did motivate me to replace fscanf there, there already is a helper in lib/fs.c just needs some small changes.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads