3 ms·
Apparently you can now load non-GPL licensed eBPF programs, but they can't then access certain functions marked as "GPL only". This matches the behavior for ker
by icebraining 9y ago
Apparently you can now load non-GPL licensed eBPF programs, but they can't then access certain functions marked as "GPL only". This matches the behavior for kernel modules.
- hacknat 9y agoInteresting. @icebraining, do you know where this list exists?
- drzaeus77 9y agoThe helpers are in http://elixir.free-electrons.com/linux/v4.15-rc3/source/kernel/bpf/helpers.c http://elixir.free-electrons.com/linux/v4.15-rc3/source/kern.... See the field gpl_only. For the list of which helpers are available in which hooks, the code needs to be read, to find things like: http://elixir.free-electrons.com/linux/v4.15-rc3/source/net/core/filter.c#L3357 http://elixir.free-electrons.com/linux/v4.15-rc3/source/net/.... Unfortunately, I don't believe the high level list of which hooks have gpl helpers is published, so reading the code is the best method currently.
- qeole 9y agoThis list is under progress. Didn't think about adding licensing information for the helpers, but that's an excellent idea!
- drzaeus77 9y agoThe first BPF programs (original tcpdump use case) were always proprietary-compatible. If you think about it, there is nothing linux-specific about networking, and any code the user writes to tweak the data that is traversing their machine should be theirs to write, and doesn't taint the kernel. The same can be said for iptables/nft rules (you don't have to GPL your firewall configuration). Therefore, the BPF hooks that deal with packets (XDP, tc, socket) are not GPL-restricted and will remain so in the future. Where GPL comes in is when you use BPF to introspect the kernel. It is quite possible to use BPF programs with the kprobe hook to extract data about how the kernel itself works, and the opinion of the kernel developers on this is that such use cases are within the realm of GPL protection.