linux/tools/lib
Jakub Kicinski d777b2ddbe bpf: don't zero out the info struct in bpf_obj_get_info_by_fd()
The buffer passed to bpf_obj_get_info_by_fd() should be initialized
to zeros.  Kernel will enforce that to guarantee we can safely extend
info structures in the future.

Making the bpf_obj_get_info_by_fd() call in libbpf perform the zeroing
is problematic, however, since some members of the info structures
may need to be initialized by the callers (for instance pointers
to buffers to which kernel is to dump translated and jited images).

Remove the zeroing and fix up the in-tree callers before any kernel
has been released with this code.

As Daniel points out this seems to be the intended operation anyway,
since commit 95b9afd398 ("bpf: Test for bpf ID") is itself setting
the buffer pointers before calling bpf_obj_get_info_by_fd().

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-07-26 17:02:52 -07:00
..
api tools lib api fs: Add sysfs__write_int function 2017-06-21 11:35:27 -03:00
bpf bpf: don't zero out the info struct in bpf_obj_get_info_by_fd() 2017-07-26 17:02:52 -07:00
lockdep tools/lib/lockdep: Remove private kernel headers 2017-06-05 09:28:14 +02:00
subcmd tools lib string: Adopt prefixcmp() from perf and subcmd 2017-04-26 15:49:21 -03:00
symbol perf tools: Move sane ctype stuff from util.h to sane_ctype.h 2017-04-19 13:01:48 -03:00
traceevent scripts/spelling.txt: add "overide" pattern and fix typo instances 2017-03-09 17:01:09 -08:00
bitmap.c tools lib: Add bitmap_and function 2016-08-02 16:33:27 -03:00
find_bit.c lib/find_bit.c: micro-optimise find_next_*_bit 2017-02-24 17:46:57 -08:00
hweight.c tools: Copy lib/hweight.c from the kernel sources 2015-07-09 16:29:56 -03:00
rbtree.c
str_error_r.c tools: Introduce str_error_r() 2016-07-12 15:19:47 -03:00
string.c tools lib string: Adopt prefixcmp() from perf and subcmd 2017-04-26 15:49:21 -03:00
vsprintf.c perf tools: Uninline scnprintf() and vscnprint() 2016-07-12 15:20:24 -03:00