Skip to contentSkip to conversation

Clarification on bpftool dual licensing

DISCUSSION Martin Kelly 2 participants 2 messages Nov 18, 2021 – Nov 19, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw
Quoted 54 lines
Quoted 3 lines · Martin Kelly
Quoted 3 lines

On Tue, Nov 16, 2021 at 2:16 AM Daniel Borkmann

<[email protected]>

Quoted 9 lines
Quoted 9 lines
Quoted 6 lines · wrote:
Quoted 4 lines · Martin Kelly

Hi,

I have a question regarding the dual licensing provision of bpftool. I understand that bpftool can be distributed as either GPL 2.0 or BSD 2-

clause.

Quoted 1 line
Quoted 1 line

That said, bpftool can also auto-generate BPF code that gets specified

inline

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

in the skeleton header file, and it's possible that the BPF code generated

is

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

GPL. What I'm wondering is what happens if bpftool generates GPL-

licensed

Quoted 15 lines
Quoted 15 lines

BPF

Quoted 14 lines
Quoted 4 lines

code inside the skeleton header, so that you get a header like this:

something.skel.h:
/* this file is BSD 2-clause, by nature of dual licensing */

Fwiw, the generated header contains an SPDX identifier:

/* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */ /* THIS FILE IS AUTOGENERATED! */

Quoted 4 lines

/* THIS FILE IS AUTOGENERATED! */

/* standard skeleton definitions */

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

...

s->data_sz = XXX;
s->data = (void *)"\
<eBPF bytecode, produced by GPL 2.0 sources, specified in binary> ";

My guess is that, based on the choice to dual-license bpftool, the header

is

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

meant to still be BSD 2-clause, and the s->data inline code's GPL license

is

Quoted 5 lines
Quoted 3 lines
Quoted 1 line
Quoted 1 line

not meant to change the licensing of the header itself, but I wanted to

Yes, definitely that is the intent (but not a lawyer either).

Thanks everyone, that's what I assumed as well. Any objection to a patch

clarifying this more explicitly?

Quoted 2 lines

One other, related question: vmlinux.h (generated by "bpftool btf dump file

Quoted 8 lines

/sys/kernel/btf/vmlinux format c"), does not currently contain a license declaration. I assume this would have to be a GPL header, since vmlinux.h references many GPL'd Linux kernel structs and similar, though again I'm not a lawyer and therefore am not certain. Would you all agree with this? If so, any objection to a patch adding an SPDX line to the generated vmlinux.h?

Is vmlinux DWARF data GPL'ed? I certainly hope not. So vmlinux.h shouldn't be licensed under GPL.

I have no idea; I had assumed that a struct definition coming from a GPL-licensed header would have to be GPL, but again, not a lawyer, and I could totally be wrong. If not GPL though, what would the license be? Is it just "output of a program" and therefore license-less, even though the output happens to be code?

#1 lore raw
Quoted 7 lines · Martin Kelly
Quoted 7 lines
Quoted 1 line

One other, related question: vmlinux.h (generated by "bpftool btf dump file

/sys/kernel/btf/vmlinux format c"), does not currently contain a license declaration. I assume this would have to be a GPL header, since vmlinux.h references many GPL'd Linux kernel structs and similar, though again I'm not a lawyer and therefore am not certain. Would you all agree with this? If so, any objection to a patch adding an SPDX line to the generated vmlinux.h?

Quoted 8 lines
Quoted 2 lines

Is vmlinux DWARF data GPL'ed? I certainly hope not. So vmlinux.h shouldn't be licensed under GPL.

I have no idea; I had assumed that a struct definition coming from a GPL-licensed header would have to be GPL, but again, not a lawyer, and I could totally be wrong. If not GPL though, what would the license be? Is it just "output of a program" and therefore license-less, even though the output happens to be code?

Totally not a lawyer either, but:

There's (generally, in many jurisdictions, etc), a minimum bar for when something is considered a "creative work" and thus copyrightable. Debug output *could* fall short of this (and thus not be copyrightable at all). It could also fall under the same "API" umbrella as that famous Google v Oracle case. Or it could fall under the "syscall exception" of the kernel source.

I guess it would take a court decision to know either way. IMO it would make sense if vmlinux.h is not copyrightable for whatever reason, but, again, IANAL :)

Anyway, while we obviously can't resolve legal matters on the mailing, we can express the *intention* of the community, which is what the licensing document is trying to do. So it totally makes sense to mention vmlinux.h here; the question is what should such a text say?

-Toke