From: Stephen Hemminger <stephen@networkplumber.org>
To: Prabhakar Pujeri <prabhakar.pujeri@dell.com>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH iproute2 1/2] ss: validate sscanf() return value in packet_show_line()
Date: Tue, 1 Sep 2026 06:45:39 -0700 [thread overview]
Message-ID: <20260901064539.691cb367@phoenix.local> (raw)
In-Reply-To: <20260831104116.2190-2-prabhakar.pujeri@dell.com>
On Mon, 31 Aug 2026 10:41:15 +0000
Prabhakar Pujeri <prabhakar.pujeri@dell.com> wrote:
> The /proc/net/packet fallback parser never checks the return value of
> sscanf(). On a malformed or truncated line some of the output
> variables (type, prot, iface, state, rq, uid, ino) stay
> uninitialized and garbage values are used both for type based
> filtering and for the printed socket state.
>
> Require all eight fields to be converted before using the values and
> return -1 on failure, which makes generic_record_read() stop
> processing, the same way tcp_show_line() bails out on a malformed
> /proc/net/tcp line.
>
> Fixes: aba5acdfdb34 ("(Logical change 1.3)")
> Signed-off-by: Prabhakar Pujeri <prabhakar.pujeri@dell.com>
> ---
Good to check but if kernel gives garbage, kernel is seriously buggy.
I am thinking it would be best to just remove /proc fallback stuff.
It only exists to handle really old systems before netlink diag info
was supported; or embedded hardware kernel configs without netlink diag info.
next prev parent reply other threads:[~2026-09-01 13:45 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-31 10:41 [PATCH iproute2 0/2] ss: reject malformed /proc fallback records Prabhakar Pujeri
2026-08-31 10:41 ` [PATCH iproute2 1/2] ss: validate sscanf() return value in packet_show_line() Prabhakar Pujeri
2026-09-01 13:45 ` Stephen Hemminger [this message]
2026-08-31 10:41 ` [PATCH iproute2 2/2] ss: validate sscanf() return value in netlink_show() Prabhakar Pujeri
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260901064539.691cb367@phoenix.local \
--to=stephen@networkplumber.org \
--cc=netdev@vger.kernel.org \
--cc=prabhakar.pujeri@dell.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.