From: Jiayuan Chen <jiayuan.chen@linux.dev>
To: bpf@vger.kernel.org, qmo@kernel.org
Cc: daniel@iogearbox.net, linux-kernel@vger.kernel.org,
ast@kernel.org, davem@davemloft.net, kuba@kernel.org,
hawk@kernel.org, john.fastabend@gmail.com, andrii@kernel.org,
martin.lau@linux.dev, eddyz87@gmail.com, song@kernel.org,
yonghong.song@linux.dev, kpsingh@kernel.org, sdf@fomichev.me,
haoluo@google.com, jolsa@kernel.org, mrpre@163.com,
Jiayuan Chen <jiayuan.chen@linux.dev>
Subject: [PATCH bpf-next v2 0/2] bpftool: Using the right format specifiers
Date: Tue, 11 Mar 2025 19:28:07 +0800 [thread overview]
Message-ID: <20250311112809.81901-1-jiayuan.chen@linux.dev> (raw)
This patch adds the -Wformat-signedness compiler flag to detect and
prevent format string errors, where signed or unsigned types are
mismatched with format specifiers. Additionally, it fixes some format
string errors that were not fully addressed by the previous patch [1].
[1] https://lore.kernel.org/bpf/20250207123706.727928-1-mrpre@163.com/T/#u
---
v1->v2:
https://lore.kernel.org/bpf/20250310142037.45932-1-jiayuan.chen@linux.dev/
---
Jiayuan Chen (2):
bpftool: Add -Wformat-signedness flag to detect format errors
bpftool: Using the right format specifiers
kernel/bpf/disasm.c | 4 ++--
tools/bpf/bpftool/Makefile | 7 ++++++-
tools/bpf/bpftool/btf.c | 14 +++++++-------
tools/bpf/bpftool/btf_dumper.c | 2 +-
tools/bpf/bpftool/cgroup.c | 2 +-
tools/bpf/bpftool/common.c | 4 ++--
tools/bpf/bpftool/jit_disasm.c | 3 ++-
tools/bpf/bpftool/map_perf_ring.c | 6 +++---
tools/bpf/bpftool/net.c | 4 ++--
tools/bpf/bpftool/netlink_dumper.c | 6 +++---
tools/bpf/bpftool/prog.c | 12 ++++++------
tools/bpf/bpftool/tracelog.c | 2 +-
tools/bpf/bpftool/xlated_dumper.c | 6 +++---
13 files changed, 39 insertions(+), 33 deletions(-)
--
2.47.1
next reply other threads:[~2025-03-11 11:28 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-11 11:28 Jiayuan Chen [this message]
2025-03-11 11:28 ` [PATCH bpf-next v2 1/2] bpftool: Add -Wformat-signedness flag to detect format errors Jiayuan Chen
2025-03-11 11:28 ` [PATCH bpf-next v2 2/2] bpftool: Using the right format specifiers Jiayuan Chen
2025-03-17 21:00 ` [PATCH bpf-next v2 0/2] " patchwork-bot+netdevbpf
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=20250311112809.81901-1-jiayuan.chen@linux.dev \
--to=jiayuan.chen@linux.dev \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=eddyz87@gmail.com \
--cc=haoluo@google.com \
--cc=hawk@kernel.org \
--cc=john.fastabend@gmail.com \
--cc=jolsa@kernel.org \
--cc=kpsingh@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=martin.lau@linux.dev \
--cc=mrpre@163.com \
--cc=qmo@kernel.org \
--cc=sdf@fomichev.me \
--cc=song@kernel.org \
--cc=yonghong.song@linux.dev \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox