2022-03-14 09:03:41

by Daniel Xu

[permalink] [raw]
Subject: [PATCH bpf-next] bpftool: Add SPDX identifier to btf-dump-file output

A concern about potential GPL violations came up at the new $DAYJOB when
I tried to vendor the vmlinux.h output. The central point was that the
generated vmlinux.h does not embed a license string -- making the
licensing of the file non-obvious.

This commit adds a LGPL-2.1 OR BSD-2-Clause SPDX license identifier to
the generated vmlinux.h output. This is line with what bpftool generates
in object file skeletons.

Signed-off-by: Daniel Xu <[email protected]>
---
tools/bpf/bpftool/btf.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/tools/bpf/bpftool/btf.c b/tools/bpf/bpftool/btf.c
index a2c665beda87..fca810a27768 100644
--- a/tools/bpf/bpftool/btf.c
+++ b/tools/bpf/bpftool/btf.c
@@ -425,6 +425,7 @@ static int dump_btf_c(const struct btf *btf,
if (err)
return err;

+ printf("/* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */\n\n");
printf("#ifndef __VMLINUX_H__\n");
printf("#define __VMLINUX_H__\n");
printf("\n");
--
2.35.1


2022-03-16 12:14:00

by Alexei Starovoitov

[permalink] [raw]
Subject: Re: [PATCH bpf-next] bpftool: Add SPDX identifier to btf-dump-file output

On Tue, Mar 15, 2022 at 4:10 PM Daniel Xu <[email protected]> wrote:
>
> Hi Alexei,
>
> On Tue, Mar 15, 2022, at 2:38 PM, Alexei Starovoitov wrote:
> > On Sun, Mar 13, 2022 at 4:01 PM Daniel Xu <[email protected]> wrote:
> >>
> >> A concern about potential GPL violations came up at the new $DAYJOB when
> >> I tried to vendor the vmlinux.h output. The central point was that the
> >> generated vmlinux.h does not embed a license string -- making the
> >> licensing of the file non-obvious.
> >>
> >> This commit adds a LGPL-2.1 OR BSD-2-Clause SPDX license identifier to
> >> the generated vmlinux.h output. This is line with what bpftool generates
> >> in object file skeletons.
> >>
> >> Signed-off-by: Daniel Xu <[email protected]>
> >> ---
> >> tools/bpf/bpftool/btf.c | 1 +
> >> 1 file changed, 1 insertion(+)
> >>
> >> diff --git a/tools/bpf/bpftool/btf.c b/tools/bpf/bpftool/btf.c
> >> index a2c665beda87..fca810a27768 100644
> >> --- a/tools/bpf/bpftool/btf.c
> >> +++ b/tools/bpf/bpftool/btf.c
> >> @@ -425,6 +425,7 @@ static int dump_btf_c(const struct btf *btf,
> >> if (err)
> >> return err;
> >>
> >> + printf("/* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */\n\n");
> >
> > I don't think we can add any kind of license identifier
> > to the auto generated output.
> > vmlinux.h is a pretty printed dwarfdump.
>
> Just so I understand better, when you say "I don't think we can",
> do you mean:
>
> 1) There may be legal issues w/ adding the license identifier
> 2) It doesn't make sense to add the license header
> 3) Something else?

2

2022-03-17 04:57:49

by Daniel Xu

[permalink] [raw]
Subject: Re: [PATCH bpf-next] bpftool: Add SPDX identifier to btf-dump-file output

Hi Alexei,

On Tue, Mar 15, 2022, at 2:38 PM, Alexei Starovoitov wrote:
> On Sun, Mar 13, 2022 at 4:01 PM Daniel Xu <[email protected]> wrote:
>>
>> A concern about potential GPL violations came up at the new $DAYJOB when
>> I tried to vendor the vmlinux.h output. The central point was that the
>> generated vmlinux.h does not embed a license string -- making the
>> licensing of the file non-obvious.
>>
>> This commit adds a LGPL-2.1 OR BSD-2-Clause SPDX license identifier to
>> the generated vmlinux.h output. This is line with what bpftool generates
>> in object file skeletons.
>>
>> Signed-off-by: Daniel Xu <[email protected]>
>> ---
>> tools/bpf/bpftool/btf.c | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git a/tools/bpf/bpftool/btf.c b/tools/bpf/bpftool/btf.c
>> index a2c665beda87..fca810a27768 100644
>> --- a/tools/bpf/bpftool/btf.c
>> +++ b/tools/bpf/bpftool/btf.c
>> @@ -425,6 +425,7 @@ static int dump_btf_c(const struct btf *btf,
>> if (err)
>> return err;
>>
>> + printf("/* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */\n\n");
>
> I don't think we can add any kind of license identifier
> to the auto generated output.
> vmlinux.h is a pretty printed dwarfdump.

Just so I understand better, when you say "I don't think we can",
do you mean:

1) There may be legal issues w/ adding the license identifier
2) It doesn't make sense to add the license header
3) Something else?

Thanks,
Daniel

2022-03-17 06:30:10

by Daniel Xu

[permalink] [raw]
Subject: Re: [PATCH bpf-next] bpftool: Add SPDX identifier to btf-dump-file output

On Tue, Mar 15, 2022, at 4:39 PM, Alexei Starovoitov wrote:
> On Tue, Mar 15, 2022 at 4:10 PM Daniel Xu <[email protected]> wrote:
>>
>> Hi Alexei,
>>
>> On Tue, Mar 15, 2022, at 2:38 PM, Alexei Starovoitov wrote:
>> > On Sun, Mar 13, 2022 at 4:01 PM Daniel Xu <[email protected]> wrote:
>> >>
>> >> A concern about potential GPL violations came up at the new $DAYJOB when
>> >> I tried to vendor the vmlinux.h output. The central point was that the
>> >> generated vmlinux.h does not embed a license string -- making the
>> >> licensing of the file non-obvious.
>> >>
>> >> This commit adds a LGPL-2.1 OR BSD-2-Clause SPDX license identifier to
>> >> the generated vmlinux.h output. This is line with what bpftool generates
>> >> in object file skeletons.
>> >>
>> >> Signed-off-by: Daniel Xu <[email protected]>
>> >> ---
>> >> tools/bpf/bpftool/btf.c | 1 +
>> >> 1 file changed, 1 insertion(+)
>> >>
>> >> diff --git a/tools/bpf/bpftool/btf.c b/tools/bpf/bpftool/btf.c
>> >> index a2c665beda87..fca810a27768 100644
>> >> --- a/tools/bpf/bpftool/btf.c
>> >> +++ b/tools/bpf/bpftool/btf.c
>> >> @@ -425,6 +425,7 @@ static int dump_btf_c(const struct btf *btf,
>> >> if (err)
>> >> return err;
>> >>
>> >> + printf("/* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */\n\n");
>> >
>> > I don't think we can add any kind of license identifier
>> > to the auto generated output.
>> > vmlinux.h is a pretty printed dwarfdump.
>>
>> Just so I understand better, when you say "I don't think we can",
>> do you mean:
>>
>> 1) There may be legal issues w/ adding the license identifier
>> 2) It doesn't make sense to add the license header
>> 3) Something else?
>
> 2

Got it, thanks.

2022-03-17 06:31:49

by Alexei Starovoitov

[permalink] [raw]
Subject: Re: [PATCH bpf-next] bpftool: Add SPDX identifier to btf-dump-file output

On Sun, Mar 13, 2022 at 4:01 PM Daniel Xu <[email protected]> wrote:
>
> A concern about potential GPL violations came up at the new $DAYJOB when
> I tried to vendor the vmlinux.h output. The central point was that the
> generated vmlinux.h does not embed a license string -- making the
> licensing of the file non-obvious.
>
> This commit adds a LGPL-2.1 OR BSD-2-Clause SPDX license identifier to
> the generated vmlinux.h output. This is line with what bpftool generates
> in object file skeletons.
>
> Signed-off-by: Daniel Xu <[email protected]>
> ---
> tools/bpf/bpftool/btf.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/tools/bpf/bpftool/btf.c b/tools/bpf/bpftool/btf.c
> index a2c665beda87..fca810a27768 100644
> --- a/tools/bpf/bpftool/btf.c
> +++ b/tools/bpf/bpftool/btf.c
> @@ -425,6 +425,7 @@ static int dump_btf_c(const struct btf *btf,
> if (err)
> return err;
>
> + printf("/* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */\n\n");

I don't think we can add any kind of license identifier
to the auto generated output.
vmlinux.h is a pretty printed dwarfdump.