aboutsummaryrefslogtreecommitdiffstats
path: root/tools/bpf/bpftool/prog.c
diff options
context:
space:
mode:
authorQuentin Monnet <[email protected]>2018-11-08 11:52:25 +0000
committerDaniel Borkmann <[email protected]>2018-11-09 07:20:52 +0000
commit53909030aa29bffe1f8490df62176c2375135652 (patch)
tree8f36333c5fb18e5feb333c4de48be0e5b7c53bb2 /tools/bpf/bpftool/prog.c
parenttools/bpftool: copy a few net uapi headers to tools directory (diff)
downloadkernel-53909030aa29bffe1f8490df62176c2375135652.tar.gz
kernel-53909030aa29bffe1f8490df62176c2375135652.zip
tools: bpftool: prevent infinite loop in get_fdinfo()
Function getline() returns -1 on failure to read a line, thus creating an infinite loop in get_fdinfo() if the key is not found. Fix it by calling the function only as long as we get a strictly positive return value. Found by copying the code for a key which is not always present... Fixes: 71bb428fe2c1 ("tools: bpf: add bpftool") Signed-off-by: Quentin Monnet <[email protected]> Reviewed-by: Jakub Kicinski <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]>
Diffstat (limited to 'tools/bpf/bpftool/prog.c')
0 files changed, 0 insertions, 0 deletions