Re: [PATCH net-next] bpf: add helper capable of reading out instructions

2017-07-25 Thread Daniel Borkmann
On 07/25/2017 08:20 PM, Jakub Kicinski wrote: On Tue, 25 Jul 2017 18:40:23 +0200, Daniel Borkmann wrote: [ +Martin ] Sorry, I thought I CCed Martin. On 07/24/2017 11:22 PM, Jakub Kicinski wrote: To read translated and jited instructions from the kernel, one has to set certain pointers of st

Re: [PATCH net-next] bpf: add helper capable of reading out instructions

2017-07-25 Thread Jakub Kicinski
On Tue, 25 Jul 2017 18:40:23 +0200, Daniel Borkmann wrote: > [ +Martin ] Sorry, I thought I CCed Martin. > On 07/24/2017 11:22 PM, Jakub Kicinski wrote: > > To read translated and jited instructions from the kernel, > > one has to set certain pointers of struct bpf_prog_info to > > pre-allocated

Re: [PATCH net-next] bpf: add helper capable of reading out instructions

2017-07-25 Thread Daniel Borkmann
[ +Martin ] On 07/24/2017 11:22 PM, Jakub Kicinski wrote: To read translated and jited instructions from the kernel, one has to set certain pointers of struct bpf_prog_info to pre-allocated user buffers. Unfortunately, the existing bpf_obj_get_info_by_fd() helper zeros struct bpf_prog_info befo

[PATCH net-next] bpf: add helper capable of reading out instructions

2017-07-24 Thread Jakub Kicinski
To read translated and jited instructions from the kernel, one has to set certain pointers of struct bpf_prog_info to pre-allocated user buffers. Unfortunately, the existing bpf_obj_get_info_by_fd() helper zeros struct bpf_prog_info before passing it to the kernel. Keeping the zeroing seems like