Re: [PATCH bpf-next v1] bpftool: Skip prog/map that disappears while looking it up by name
From: Jiayuan Chen
Date: Mon Jul 20 2026 - 04:43:16 EST
On 7/20/26 4:02 PM, bot+bpf-ci@xxxxxxxxxx wrote:
commit 084a91fc9c087ee9f5a2163da8368590cad6f121This looks like a bug fix for the prog/map lookup functions. Should this
Author: Jiayuan Chen <jiayuan.chen@xxxxxxxxx>
bpftool: Skip prog/map that disappears while looking it up by name
Looking up a prog or map by name walks the whole id space. There is a
window between bpf_prog_get_next_id()/bpf_map_get_next_id() and getting
an fd for that id in which an unrelated object can be freed, and the
lookup then fails with ENOENT and aborts the whole command.
Skip such ids and keep walking, the same way do_show() already does.
Signed-off-by: Jiayuan Chen <jiayuan.chen@xxxxxxxxx>
include:
Fixes: a479b8ce4ed1 ("tools/bpftool: Move map/prog parsing logic into common")
It's not worth backporting it.
People can always upgrade bpftool to latest version.