-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question: why bpf_helpers.h declares _license="GPL"? #1804
Comments
Update: this is becoming an issue, in my opinion. I detected the following issues, correct me if I'm wrong:
I suggest removing the automatic licensing from helpers.h, letting the user decide what license to use (and getting an error if the kernel rejects the eBPF program). I also suggest changing the BCC C headers from Apache 2.0 to LGPL, which would allow to compile GPL and non-GPL programs. |
oriolarcas
pushed a commit
to oriolarcas/bcc
that referenced
this issue
Jun 12, 2018
The helpers.h header specifies the eBPF program license as 'GPL'. However, other GPL-compatible licenses are possible (e.g., Dual BSD/GPL) or even proprietary licenses (e.g., cachetop can run with a proprietary license). With this commit, the user can specify an EBPF_LICENSE macro: b = BPF(text=bpf_text, cflags=['-DEBPF_LICENSE=Custom license']) Note it supports multiple words and the absence of quotes. If the eBPF doesn't have a GPL-compatible license and it uses any GPL-only helpers, the kernel will reject it with: cannot call GPL only function from proprietary program See all the GPL-compatible license strings at: https://github.com/torvalds/linux/blob/v4.17/include/linux/module.h#L172
oriolarcas
pushed a commit
to oriolarcas/bcc
that referenced
this issue
Jun 13, 2018
The helpers.h header specifies the BPF program license as 'GPL'. However, other GPL-compatible licenses are possible (e.g., Dual BSD/GPL) or even proprietary licenses (e.g., cachetop can run with a proprietary license). With this commit, the user can specify an BPF_LICENSE macro: b = BPF(text=bpf_text, cflags=['-DBPF_LICENSE=Custom license']) Note it supports multiple words and the absence of quotes. If the BPF doesn't have a GPL-compatible license and it uses any GPL-only helpers, the kernel will reject it with: cannot call GPL only function from proprietary program See all the GPL-compatible license strings at: https://github.com/torvalds/linux/blob/v4.17/include/linux/module.h#L172
oriolarcas
pushed a commit
to oriolarcas/bcc
that referenced
this issue
Jun 13, 2018
The helpers.h header specifies the BPF program license as 'GPL'. However, other GPL-compatible licenses are possible (e.g., Dual BSD/GPL) or even proprietary licenses (e.g., cachetop can run with a proprietary license). With this commit, the user can specify an BPF_LICENSE macro: b = BPF(text=bpf_text, cflags=['-DBPF_LICENSE=Custom license']) Note it supports multiple words and the absence of quotes. If the BPF doesn't have a GPL-compatible license and it uses any GPL-only helpers, the kernel will reject it with: cannot call GPL only function from proprietary program See all the GPL-compatible license strings at: https://github.com/torvalds/linux/blob/v4.17/include/linux/module.h#L172
oriolarcas
pushed a commit
to oriolarcas/bcc
that referenced
this issue
Jun 13, 2018
The helpers.h header specifies the BPF program license as 'GPL'. However, other GPL-compatible licenses are possible (e.g., Dual BSD/GPL) or even proprietary licenses (e.g., cachetop can run with a proprietary license). With this commit, the user can specify an BPF_LICENSE macro: b = BPF(text=bpf_text, cflags=['-DBPF_LICENSE=Custom license']) Note it supports multiple words and the absence of quotes. If the BPF doesn't have a GPL-compatible license and it uses any GPL-only helpers, the kernel will reject it with: cannot call GPL only function from proprietary program See all the GPL-compatible license strings at: https://github.com/torvalds/linux/blob/v4.17/include/linux/module.h#L172
oriolarcas
pushed a commit
to oriolarcas/bcc
that referenced
this issue
Jun 13, 2018
The helpers.h header specifies the BPF program license as 'GPL'. However, other GPL-compatible licenses are possible (e.g., Dual BSD/GPL) or even proprietary licenses (e.g., cachetop can run with a proprietary license). With this commit, the user can specify an BPF_LICENSE macro: b = BPF(text=bpf_text, cflags=['-DBPF_LICENSE=Custom license']) Note it supports multiple words and the absence of quotes. If the BPF doesn't have a GPL-compatible license and it uses any GPL-only helpers, the kernel will reject it with: cannot call GPL only function from proprietary program See all the GPL-compatible license strings at: https://github.com/torvalds/linux/blob/v4.17/include/linux/module.h#L172
oriolarcas
pushed a commit
to oriolarcas/bcc
that referenced
this issue
Jun 13, 2018
The helpers.h header specifies the BPF program license as 'GPL'. However, other GPL-compatible licenses are possible (e.g., Dual BSD/GPL) or even proprietary licenses (e.g., cachetop can run with a proprietary license). With this commit, the user can specify an BPF_LICENSE macro: b = BPF(text=bpf_text, cflags=['-DBPF_LICENSE=Custom license']) Note it supports multiple words and the absence of quotes. If the BPF doesn't have a GPL-compatible license and it uses any GPL-only helpers, the kernel will reject it with: cannot call GPL only function from proprietary program See all the GPL-compatible license strings at: https://github.com/torvalds/linux/blob/v4.17/include/linux/module.h#L172
oriolarcas
pushed a commit
to oriolarcas/bcc
that referenced
this issue
Jun 13, 2018
The helpers.h header specifies the BPF program license as 'GPL'. However, other GPL-compatible licenses are possible (e.g., Dual BSD/GPL) or even proprietary licenses (e.g., cachetop can run with a proprietary license). With this commit, the user can specify an BPF_LICENSE macro: b = BPF(text=bpf_text, cflags=['-DBPF_LICENSE=Custom license']) Note it supports multiple words and the absence of quotes. If the BPF doesn't have a GPL-compatible license and it uses any GPL-only helpers, the kernel will reject it with: cannot call GPL only function from proprietary program See all the GPL-compatible license strings at: https://github.com/torvalds/linux/blob/v4.17/include/linux/module.h#L172
oriolarcas
pushed a commit
to oriolarcas/bcc
that referenced
this issue
Jun 13, 2018
The helpers.h header specifies the BPF program license as 'GPL'. However, other GPL-compatible licenses are possible (e.g., Dual BSD/GPL) or even proprietary licenses (e.g., cachetop can run with a proprietary license). With this commit, the user can specify a BPF_LICENSE macro: b = BPF(text=bpf_text, cflags=['-DBPF_LICENSE=Custom license']) Note it supports multiple words and the absence of quotes. If the BPF doesn't have a GPL-compatible license and it uses any GPL-only helpers, the kernel will reject it with: cannot call GPL only function from proprietary program Updated the documentation with BPF_LICENSE description, licensing error description, and licenses for each helper.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Disclaimer: totally in favor of GPL, just curious, but I didn't find any documentation or issues about this.
I noticed that
bpf_helpers.h
declareschar _license[4] SEC("license") = "GPL"
. I stumbled upon this because it conflicted with my own identical declaration of_license
.My question is: why GPL?
One possible answer would be "because eBPF helpers need it". Well, some need a GPL-compatible license, for instance
bpf_probe_read()
. But some not, for instancebpf_get_prandom_u32()
orbpf_get_smp_processor_id()
(which is supported in BCC but not documented, I think). Thus, using helpers not necessarily implies requiring GPL compatibility. Thegpl_only
field discriminates which eBPF helpers require it.A second issue is the license itself. The kernel doesn't require GPL, but GPL-compatibility, which currently is defined as GPL, BSD/GPL, MIT/GPL or MPL/GPL. I am not a lawyer, maybe I am wrong here and "GPL" is just fine...
Finally, the helpers header is incompatible with programs that declare their own license, even if it already is GPL.
I'm not sure if it can be inconvenient to license code without a proper warning. BCC itself is not GPL, it is Apache 2.0, so its C headers don't force GPL. Is there some warning in the documentation that I missed? Is it possible that some users will discover that their eBPF program was licensed under GPL without their knowledge?
So, tentative suggestions:
Anyway, I understand that this is a low priority discussion now, and that it is much more convenient to have eBPF programs that just work.
Thanks!
Oriol
The text was updated successfully, but these errors were encountered: