From: Rong Tao <rtoax@foxmail.com>
To: andrii.nakryiko@gmail.com, qmo@kernel.org, ast@kernel.org,
daniel@iogearbox.net, andrii@kernel.org, rongtao@cestc.cn
Cc: Martin KaFai Lau <martin.lau@linux.dev>,
Eduard Zingerman <eddyz87@gmail.com>, Song Liu <song@kernel.org>,
Yonghong Song <yonghong.song@linux.dev>,
John Fastabend <john.fastabend@gmail.com>,
KP Singh <kpsingh@kernel.org>,
Stanislav Fomichev <sdf@fomichev.me>, Hao Luo <haoluo@google.com>,
Jiri Olsa <jolsa@kernel.org>,
bpf@vger.kernel.org (open list:BPF [TOOLING] (bpftool)),
linux-kernel@vger.kernel.org (open list)
Subject: [PATCH bpf-next v4 0/2] libbpf: Fix bpftool gen object segfault
Date: Fri, 6 Dec 2024 09:58:17 +0800 [thread overview]
Message-ID: <tencent_44BC4B6295D557A6D10D444A032D219CAC07@qq.com> (raw)
From: Rong Tao <rongtao@cestc.cn>
When the target file is used as input and output at the same time, the
input file will read a null value, resulting in a segmentation fault.
Add judgment conditions in bpftool and libbpf to prevent segmentation
error.
ChangeLog v2 -> v3:
- argc_cpy and argv_cpy need to be initialised _after_ the call to
GET_ARG()
ChangeLog v1 -> v2:
- Compare each output file.
v4: This patchset, double check and fix in libbpf.
v3: https://lore.kernel.org/lkml/tencent_A7A870BF168D6A21BA193408D5645D5D920A@qq.com/
v2: https://lore.kernel.org/lkml/tencent_F62A51AFF6A38188D70664421F5934974008@qq.com/
v1: https://lore.kernel.org/lkml/tencent_410B8166C55CD2AB64BDEA8E92204619180A@qq.com/
Rong Tao (2):
bpftool: Fix gen object segfault
libbpf: linker: Avoid using object file as both input and output
tools/bpf/bpftool/gen.c | 13 +++++++++++++
tools/lib/bpf/linker.c | 5 +++++
2 files changed, 18 insertions(+)
--
2.47.1
reply other threads:[~2024-12-06 1:58 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=tencent_44BC4B6295D557A6D10D444A032D219CAC07@qq.com \
--to=rtoax@foxmail.com \
--cc=andrii.nakryiko@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=haoluo@google.com \
--cc=john.fastabend@gmail.com \
--cc=jolsa@kernel.org \
--cc=kpsingh@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=martin.lau@linux.dev \
--cc=qmo@kernel.org \
--cc=rongtao@cestc.cn \
--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
all inboxes | Powered by JetHome®