diff options
author | Daniel Borkmann <daniel@iogearbox.net> | 2017-07-28 17:05:25 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-07-29 23:29:41 -0700 |
commit | 9975a54b3c9ecf029cbf5dd7a8c9701b1d74029e (patch) | |
tree | 86d2c8f44b7a5aec50febea181056a7784156428 /tools | |
parent | efe967cdec32af93e15839cc639695ec5f637771 (diff) | |
download | linux-9975a54b3c9ecf029cbf5dd7a8c9701b1d74029e.tar.bz2 |
bpf: fix bpf_prog_get_info_by_fd to dump correct xlated_prog_len
bpf_prog_size(prog->len) is not the correct length we want to dump
back to user space. The code in bpf_prog_get_info_by_fd() uses this
to copy prog->insnsi to user space, but bpf_prog_size(prog->len) also
includes the size of struct bpf_prog itself plus program instructions
and is usually used either in context of accounting or for bpf_prog_alloc()
et al, thus we copy out of bounds in bpf_prog_get_info_by_fd()
potentially. Use the correct bpf_prog_insn_size() instead.
Fixes: 1e2709769086 ("bpf: Add BPF_OBJ_GET_INFO_BY_FD")
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'tools')
0 files changed, 0 insertions, 0 deletions