]> git.baikalelectronics.ru Git - kernel.git/commit
tools: bpftool: protect against races with disappearing objects
authorJakub Kicinski <jakub.kicinski@netronome.com>
Fri, 22 Dec 2017 19:36:06 +0000 (11:36 -0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Sat, 23 Dec 2017 00:09:52 +0000 (01:09 +0100)
commitd4faa1e12e3df7740e0e3ced8914c941a28e32ba
tree36104aee2ea7b2b4a7326c369478890aad7243ef
parent0ffe27de3507740195c25ec5f5e012b83225f6e1
tools: bpftool: protect against races with disappearing objects

On program/map show we may get an ID of an object from GETNEXT,
but the object may disappear before we call GET_FD_BY_ID.  If
that happens, ignore the object and continue.

Fixes: 9ffb478b4d49 ("tools: bpf: add bpftool")
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Acked-by: Quentin Monnet <quentin.monnet@netronome.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
tools/bpf/bpftool/map.c
tools/bpf/bpftool/prog.c