Closed bersoare closed 4 years ago
as this functionality is supposed to be used only in userland code.
Are you sure? Is BPF program is not allowed to iterate over hash map?
i wouldn't say im sure, but this is what i could infer after noticing there's not a single example kernel code implementing such function (https://elixir.bootlin.com/linux/latest/ident/bpf_map_get_next_key) and the kernel prototype documentation seem to say that this is specific to userspace (https://prototype-kernel.readthedocs.io/en/latest/bpf/ebpf_maps.html - although not explicitly).
btw - i have also found this: https://elixir.bootlin.com/linux/latest/source/include/linux/bpf.h#L41
documentation/code doesn't say that "it's not allowed" with these words exactly, but after looking at that piece of code i believe the intention is to have get_next_key used in userspace only, via syscall.
btw - i have also found this: https://elixir.bootlin.com/linux/latest/source/include/linux/bpf.h#L41
documentation/code doesn't say that "it's not allowed" with these words exactly, but after looking at that piece of code i believe the intention is to have get_next_key used in userspace only, via syscall.
Sounds good, thanks for your research.
Anyway, if we're wrong here we can always return it.
this removes get_next_key function from kernel code (bpf_helpers.h), as this functionality is supposed to be used only in userland code.
https://travis-ci.org/github/dropbox/goebpf/builds/728180572