Re: [PATCH net] bpf: don't zero out the info struct in bpf_obj_get_info_by_fd()

2017-07-26 Thread David Miller
From: Jakub Kicinski Date: Tue, 25 Jul 2017 15:16:12 -0700 > 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

Re: [PATCH net] bpf: don't zero out the info struct in bpf_obj_get_info_by_fd()

2017-07-25 Thread Daniel Borkmann
On 07/26/2017 01:15 AM, Jakub Kicinski wrote: On Wed, 26 Jul 2017 00:59:49 +0200, Daniel Borkmann wrote: @@ -418,6 +420,8 @@ static void test_bpf_obj_id(void) nr_id_found++; err = bpf_obj_get_info_by_fd(prog_fd, _info, _len); +

Re: [PATCH net] bpf: don't zero out the info struct in bpf_obj_get_info_by_fd()

2017-07-25 Thread Jakub Kicinski
On Tue, 25 Jul 2017 16:15:47 -0700, Jakub Kicinski wrote: > On Wed, 26 Jul 2017 00:59:49 +0200, Daniel Borkmann wrote: > > > @@ -418,6 +420,8 @@ static void test_bpf_obj_id(void) > > > nr_id_found++; > > > > > > err = bpf_obj_get_info_by_fd(prog_fd, _info, > >

Re: [PATCH net] bpf: don't zero out the info struct in bpf_obj_get_info_by_fd()

2017-07-25 Thread Jakub Kicinski
On Wed, 26 Jul 2017 00:59:49 +0200, Daniel Borkmann wrote: > > @@ -418,6 +420,8 @@ static void test_bpf_obj_id(void) > > nr_id_found++; > > > > err = bpf_obj_get_info_by_fd(prog_fd, _info, _len); > > + prog_infos[i].jited_prog_insns = 0; > > +

Re: [PATCH net] bpf: don't zero out the info struct in bpf_obj_get_info_by_fd()

2017-07-25 Thread Daniel Borkmann
On 07/26/2017 12:16 AM, Jakub Kicinski wrote: 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

[PATCH net] bpf: don't zero out the info struct in bpf_obj_get_info_by_fd()

2017-07-25 Thread Jakub Kicinski
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