Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

libbpf: relicense libbpf as LGPL-2.1 OR BSD-2-Clause

libbpf is maturing as a library and gaining features that no other bpf libraries support
(BPF Type Format, bpf to bpf calls, etc)
Many Apache2 licensed projects (like bcc, bpftrace, gobpf, cilium, etc)
would like to use libbpf, but cannot do this yet, since Apache Foundation explicitly
states that LGPL is incompatible with Apache2.
Hence let's relicense libbpf as dual license LGPL-2.1 or BSD-2-Clause,
since BSD-2 is compatible with Apache2.
Dual LGPL or Apache2 is invalid combination.
Fix license mistake in Makefile as well.

Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Andrey Ignatov <rdna@fb.com>
Acked-by: Arnaldo Carvalho de Melo <acme@kernel.org>
Acked-by: Björn Töpel <bjorn.topel@intel.com>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: David Beckett <david.beckett@netronome.com>
Acked-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Acked-by: Joe Stringer <joe@ovn.org>
Acked-by: John Fastabend <john.fastabend@gmail.com>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Acked-by: Quentin Monnet <quentin.monnet@netronome.com>
Acked-by: Thomas Graf <tgraf@suug.ch>
Acked-by: Roman Gushchin <guro@fb.com>
Acked-by: Wang Nan <wangnan0@huawei.com>
Acked-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>

authored by

Alexei Starovoitov and committed by
Daniel Borkmann
1bc38b8f 541d7fdd

+13 -62
+1 -1
tools/lib/bpf/Makefile
··· 1 - # SPDX-License-Identifier: GPL-2.0 1 + # SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) 2 2 # Most of this file is copied from tools/lib/traceevent/Makefile 3 3 4 4 BPF_VERSION = 0
+1 -1
tools/lib/bpf/bpf.c
··· 1 - // SPDX-License-Identifier: LGPL-2.1 1 + // SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) 2 2 3 3 /* 4 4 * common eBPF ELF operations.
+1 -1
tools/lib/bpf/bpf.h
··· 1 - /* SPDX-License-Identifier: LGPL-2.1 */ 1 + /* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */ 2 2 3 3 /* 4 4 * common eBPF ELF operations.
+1 -1
tools/lib/bpf/btf.c
··· 1 - // SPDX-License-Identifier: LGPL-2.1 1 + // SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) 2 2 /* Copyright (c) 2018 Facebook */ 3 3 4 4 #include <stdlib.h>
+1 -1
tools/lib/bpf/btf.h
··· 1 - /* SPDX-License-Identifier: LGPL-2.1 */ 1 + /* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */ 2 2 /* Copyright (c) 2018 Facebook */ 3 3 4 4 #ifndef __LIBBPF_BTF_H
+1 -14
tools/lib/bpf/libbpf.c
··· 1 - // SPDX-License-Identifier: LGPL-2.1 1 + // SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) 2 2 3 3 /* 4 4 * Common eBPF ELF object loading operations. ··· 7 7 * Copyright (C) 2015 Wang Nan <wangnan0@huawei.com> 8 8 * Copyright (C) 2015 Huawei Inc. 9 9 * Copyright (C) 2017 Nicira, Inc. 10 - * 11 - * This program is free software; you can redistribute it and/or 12 - * modify it under the terms of the GNU Lesser General Public 13 - * License as published by the Free Software Foundation; 14 - * version 2.1 of the License (not later!) 15 - * 16 - * This program is distributed in the hope that it will be useful, 17 - * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 - * GNU Lesser General Public License for more details. 20 - * 21 - * You should have received a copy of the GNU Lesser General Public 22 - * License along with this program; if not, see <http://www.gnu.org/licenses> 23 10 */ 24 11 25 12 #define _GNU_SOURCE
+1 -14
tools/lib/bpf/libbpf.h
··· 1 - /* SPDX-License-Identifier: LGPL-2.1 */ 1 + /* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */ 2 2 3 3 /* 4 4 * Common eBPF ELF object loading operations. ··· 6 6 * Copyright (C) 2013-2015 Alexei Starovoitov <ast@kernel.org> 7 7 * Copyright (C) 2015 Wang Nan <wangnan0@huawei.com> 8 8 * Copyright (C) 2015 Huawei Inc. 9 - * 10 - * This program is free software; you can redistribute it and/or 11 - * modify it under the terms of the GNU Lesser General Public 12 - * License as published by the Free Software Foundation; 13 - * version 2.1 of the License (not later!) 14 - * 15 - * This program is distributed in the hope that it will be useful, 16 - * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 - * GNU Lesser General Public License for more details. 19 - * 20 - * You should have received a copy of the GNU Lesser General Public 21 - * License along with this program; if not, see <http://www.gnu.org/licenses> 22 9 */ 23 10 #ifndef __LIBBPF_LIBBPF_H 24 11 #define __LIBBPF_LIBBPF_H
+1 -14
tools/lib/bpf/libbpf_errno.c
··· 1 - // SPDX-License-Identifier: LGPL-2.1 1 + // SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) 2 2 3 3 /* 4 4 * Copyright (C) 2013-2015 Alexei Starovoitov <ast@kernel.org> 5 5 * Copyright (C) 2015 Wang Nan <wangnan0@huawei.com> 6 6 * Copyright (C) 2015 Huawei Inc. 7 7 * Copyright (C) 2017 Nicira, Inc. 8 - * 9 - * This program is free software; you can redistribute it and/or 10 - * modify it under the terms of the GNU Lesser General Public 11 - * License as published by the Free Software Foundation; 12 - * version 2.1 of the License (not later!) 13 - * 14 - * This program is distributed in the hope that it will be useful, 15 - * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 - * GNU Lesser General Public License for more details. 18 - * 19 - * You should have received a copy of the GNU Lesser General Public 20 - * License along with this program; if not, see <http://www.gnu.org/licenses> 21 8 */ 22 9 23 10 #include <stdio.h>
+1 -1
tools/lib/bpf/netlink.c
··· 1 - // SPDX-License-Identifier: LGPL-2.1 1 + // SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) 2 2 /* Copyright (c) 2018 Facebook */ 3 3 4 4 #include <stdlib.h>
+1 -6
tools/lib/bpf/nlattr.c
··· 1 - // SPDX-License-Identifier: LGPL-2.1 1 + // SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) 2 2 3 3 /* 4 4 * NETLINK Netlink attributes 5 - * 6 - * This library is free software; you can redistribute it and/or 7 - * modify it under the terms of the GNU Lesser General Public 8 - * License as published by the Free Software Foundation version 2.1 9 - * of the License. 10 5 * 11 6 * Copyright (c) 2003-2013 Thomas Graf <tgraf@suug.ch> 12 7 */
+1 -6
tools/lib/bpf/nlattr.h
··· 1 - /* SPDX-License-Identifier: LGPL-2.1 */ 1 + /* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */ 2 2 3 3 /* 4 4 * NETLINK Netlink attributes 5 - * 6 - * This library is free software; you can redistribute it and/or 7 - * modify it under the terms of the GNU Lesser General Public 8 - * License as published by the Free Software Foundation version 2.1 9 - * of the License. 10 5 * 11 6 * Copyright (c) 2003-2013 Thomas Graf <tgraf@suug.ch> 12 7 */
+1 -1
tools/lib/bpf/str_error.c
··· 1 - // SPDX-License-Identifier: LGPL-2.1 1 + // SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) 2 2 #undef _GNU_SOURCE 3 3 #include <string.h> 4 4 #include <stdio.h>
+1 -1
tools/lib/bpf/str_error.h
··· 1 - // SPDX-License-Identifier: LGPL-2.1 1 + /* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */ 2 2 #ifndef __LIBBPF_STR_ERROR_H 3 3 #define __LIBBPF_STR_ERROR_H 4 4