All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: netdev@vger.kernel.org
Cc: Stephen Hemminger <stephen@networkplumber.org>
Subject: [PATCH iproute2 0/3] don't build printf formats out of names
Date: Mon, 19 Oct 2026 13:03:01 -0700	[thread overview]
Message-ID: <20261019200623.816470-1-stephen@networkplumber.org> (raw)

Several print helpers built a printf format string by concatenating a
name or key onto a conversion specifier, then passed the result to
printf as the format. This is unsafe since '%' in name would
be converted by printf.

Most of the affected names are string literals, but the rdma driver
attribute and hwcounter keys and the vdpa vendor statistics names come
from the kernel, so they are not under iproute2's control. No failures
have been reported in practice. Each patch passes the name as a normal
string argument with a literal format instead; text and JSON output are
otherwise unchanged.

Found by an automated source scan (ANT-2026-JAWA8082).

Stephen Hemminger (3):
  lib: don't build printf formats out of names
  rdma: don't build printf formats out of keys
  vdpa: don't build printf format out of vendor stats name

 lib/json_print.c |  7 ++-----
 rdma/res-cmid.c  |  3 ++-
 rdma/res.c       | 10 +++++-----
 rdma/utils.c     |  4 ++--
 vdpa/vdpa.c      | 14 +++-----------
 5 files changed, 14 insertions(+), 24 deletions(-)

-- 
2.53.0


             reply	other threads:[~2026-10-19 20:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-19 20:03 Stephen Hemminger [this message]
2026-10-19 20:03 ` [PATCH iproute 1/3] lib: don't build printf formats out of names Stephen Hemminger
2026-10-19 20:03 ` [PATCH iproute 2/3] rdma: don't build printf formats out of keys Stephen Hemminger
2026-10-20 13:10   ` Leon Romanovsky
2026-10-19 20:03 ` [PATCH iproute 3/3] vdpa: don't build printf format out of vendor stats name Stephen Hemminger

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=20261019200623.816470-1-stephen@networkplumber.org \
    --to=stephen@networkplumber.org \
    --cc=netdev@vger.kernel.org \
    /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.