From 3b8a9ce1f1d353319e7b017153afa1f3ca676d7a Mon Sep 17 00:00:00 2001 From: Ayan Sinha Mahapatra Date: Fri, 6 Sep 2024 14:22:42 +0530 Subject: [PATCH] Add and modify license rules to fix detections Signed-off-by: Ayan Sinha Mahapatra --- .../data/rules/false-positive_771.RULE | 6 ++++++ .../data/rules/false-positive_772.RULE | 14 ++++++++++++++ .../data/rules/false-positive_773.RULE | 6 ++++++ .../data/rules/false-positive_774.RULE | 6 ++++++ .../data/rules/false-positive_775.RULE | 6 ++++++ .../data/rules/false-positive_776.RULE | 6 ++++++ .../rules/gcc-linking-exception-2.0_13.RULE | 9 +++++++++ .../data/rules/gpl-2.0-plus_1130.RULE | 9 +++++++++ .../data/rules/gpl-2.0-plus_or_bsd-new_22.RULE | 9 +++++++++ ...gpl-2.0-plus_with_mif-exception_jjfs2_2.RULE | 2 -- ...0-plus_and_lgpl-2.1_and_lgpl-2.1-plus_1.RULE | 17 +++++++++++++++++ ...2.0_with_linux-syscall-exception-gpl_14.RULE | 10 ++++++++++ .../data/rules/license-clue_free-unknown_5.RULE | 10 ++++++++++ .../data/rules/license-clue_free-unknown_6.RULE | 16 ++++++++++++++++ .../data/rules/license-intro_82.RULE | 6 ++++++ .../data/rules/license-intro_83.RULE | 7 +++++++ .../rules/linux-syscall-exception-gpl_11.RULE | 9 +++++++++ .../data/rules/proprietary-license_272.RULE | 2 +- 18 files changed, 147 insertions(+), 3 deletions(-) create mode 100644 src/licensedcode/data/rules/false-positive_771.RULE create mode 100644 src/licensedcode/data/rules/false-positive_772.RULE create mode 100644 src/licensedcode/data/rules/false-positive_773.RULE create mode 100644 src/licensedcode/data/rules/false-positive_774.RULE create mode 100644 src/licensedcode/data/rules/false-positive_775.RULE create mode 100644 src/licensedcode/data/rules/false-positive_776.RULE create mode 100644 src/licensedcode/data/rules/gcc-linking-exception-2.0_13.RULE create mode 100644 src/licensedcode/data/rules/gpl-2.0-plus_1130.RULE create mode 100644 src/licensedcode/data/rules/gpl-2.0-plus_or_bsd-new_22.RULE create mode 100644 src/licensedcode/data/rules/gpl-2.0_and_gpl-1.0-plus_and_gpl-2.0-plus_and_lgpl-2.0_and_lgpl-2.0-plus_and_lgpl-2.1_and_lgpl-2.1-plus_1.RULE create mode 100644 src/licensedcode/data/rules/gpl-2.0_with_linux-syscall-exception-gpl_14.RULE create mode 100644 src/licensedcode/data/rules/license-clue_free-unknown_5.RULE create mode 100644 src/licensedcode/data/rules/license-clue_free-unknown_6.RULE create mode 100644 src/licensedcode/data/rules/license-intro_82.RULE create mode 100644 src/licensedcode/data/rules/license-intro_83.RULE create mode 100644 src/licensedcode/data/rules/linux-syscall-exception-gpl_11.RULE diff --git a/src/licensedcode/data/rules/false-positive_771.RULE b/src/licensedcode/data/rules/false-positive_771.RULE new file mode 100644 index 00000000000..827d5d86526 --- /dev/null +++ b/src/licensedcode/data/rules/false-positive_771.RULE @@ -0,0 +1,6 @@ +--- +is_false_positive: yes +notes: seen in kernel /Documentation/process/license-rules.rst +--- + +The SPDX license identifier in kernel files shall be added at the first \ No newline at end of file diff --git a/src/licensedcode/data/rules/false-positive_772.RULE b/src/licensedcode/data/rules/false-positive_772.RULE new file mode 100644 index 00000000000..c82d1093f14 --- /dev/null +++ b/src/licensedcode/data/rules/false-positive_772.RULE @@ -0,0 +1,14 @@ +--- +is_false_positive: yes +notes: seen in kernel /Documentation/process/license-rules.rst +--- + +The SPDX license identifier is added in form of a comment. The comment +style depends on the file type:: + + C source: // SPDX-License-Identifier: + C header: /* SPDX-License-Identifier: */ + ASM: /* SPDX-License-Identifier: */ + scripts: # SPDX-License-Identifier: + .rst: .. SPDX-License-Identifier: + .dts{i}: // SPDX-License-Identifier: \ No newline at end of file diff --git a/src/licensedcode/data/rules/false-positive_773.RULE b/src/licensedcode/data/rules/false-positive_773.RULE new file mode 100644 index 00000000000..f5d8a79e525 --- /dev/null +++ b/src/licensedcode/data/rules/false-positive_773.RULE @@ -0,0 +1,6 @@ +--- +is_false_positive: yes +notes: seen in kernel /Documentation/process/license-rules.rst +--- + +(SPDX-License-Identifier) nor in any way relevant for expressing or \ No newline at end of file diff --git a/src/licensedcode/data/rules/false-positive_774.RULE b/src/licensedcode/data/rules/false-positive_774.RULE new file mode 100644 index 00000000000..939efabc4a5 --- /dev/null +++ b/src/licensedcode/data/rules/false-positive_774.RULE @@ -0,0 +1,6 @@ +--- +is_false_positive: yes +notes: seen at drivers/block/floppy.c +--- + +* modeled after the freeware MS-DOS program fdformat/88 V1.8 by \ No newline at end of file diff --git a/src/licensedcode/data/rules/false-positive_775.RULE b/src/licensedcode/data/rules/false-positive_775.RULE new file mode 100644 index 00000000000..de96dfed8a6 --- /dev/null +++ b/src/licensedcode/data/rules/false-positive_775.RULE @@ -0,0 +1,6 @@ +--- +is_false_positive: yes +notes: seen at kernel/bpf/syscall.c +--- + +sizeof(license) - 1) < 0) \ No newline at end of file diff --git a/src/licensedcode/data/rules/false-positive_776.RULE b/src/licensedcode/data/rules/false-positive_776.RULE new file mode 100644 index 00000000000..491daada164 --- /dev/null +++ b/src/licensedcode/data/rules/false-positive_776.RULE @@ -0,0 +1,6 @@ +--- +is_false_positive: yes +notes: seen at kernel/bpf/syscall.c +--- + +license[sizeof(license) - 1] = 0; \ No newline at end of file diff --git a/src/licensedcode/data/rules/gcc-linking-exception-2.0_13.RULE b/src/licensedcode/data/rules/gcc-linking-exception-2.0_13.RULE new file mode 100644 index 00000000000..472974a20ea --- /dev/null +++ b/src/licensedcode/data/rules/gcc-linking-exception-2.0_13.RULE @@ -0,0 +1,9 @@ +--- +license_expression: gcc-linking-exception-2.0 +is_license_tag: yes +relevance: 70 +minimum_coverage: 100 +notes: seen in kernel /Documentation/process/license-rules.rst +--- + +SPDX-License-Identifier: WITH GCC-exception-2.0 \ No newline at end of file diff --git a/src/licensedcode/data/rules/gpl-2.0-plus_1130.RULE b/src/licensedcode/data/rules/gpl-2.0-plus_1130.RULE new file mode 100644 index 00000000000..6d4bb466045 --- /dev/null +++ b/src/licensedcode/data/rules/gpl-2.0-plus_1130.RULE @@ -0,0 +1,9 @@ +--- +license_expression: gpl-2.0-plus +is_license_reference: yes +minimum_coverage: 100 +--- + +MODULE_LICENSE("GPL"); + // Actually dual-licensed, but it doesn't matter for + // the sake of this tag. It's Free Software. \ No newline at end of file diff --git a/src/licensedcode/data/rules/gpl-2.0-plus_or_bsd-new_22.RULE b/src/licensedcode/data/rules/gpl-2.0-plus_or_bsd-new_22.RULE new file mode 100644 index 00000000000..8f54b4add51 --- /dev/null +++ b/src/licensedcode/data/rules/gpl-2.0-plus_or_bsd-new_22.RULE @@ -0,0 +1,9 @@ +--- +license_expression: gpl-2.0-plus OR bsd-new +is_license_tag: yes +relevance: 100 +minimum_coverage: 100 +notes: seen at linux/include/dt-bindings/reset/amlogic,meson-axg-reset.h +--- + +* SPDX-License-Identifier: (GPL-2.0+ OR BSD) \ No newline at end of file diff --git a/src/licensedcode/data/rules/gpl-2.0-plus_with_mif-exception_jjfs2_2.RULE b/src/licensedcode/data/rules/gpl-2.0-plus_with_mif-exception_jjfs2_2.RULE index f1b74d40f03..8e00215b8d8 100644 --- a/src/licensedcode/data/rules/gpl-2.0-plus_with_mif-exception_jjfs2_2.RULE +++ b/src/licensedcode/data/rules/gpl-2.0-plus_with_mif-exception_jjfs2_2.RULE @@ -3,8 +3,6 @@ license_expression: gpl-2.0-plus WITH mif-exception is_license_notice: yes relevance: 99 minimum_coverage: 100 -referenced_filenames: - - LICENCE notes: seen in U-Boot and the kernel. The LICENCE file is a clear gpl + exception notice --- diff --git a/src/licensedcode/data/rules/gpl-2.0_and_gpl-1.0-plus_and_gpl-2.0-plus_and_lgpl-2.0_and_lgpl-2.0-plus_and_lgpl-2.1_and_lgpl-2.1-plus_1.RULE b/src/licensedcode/data/rules/gpl-2.0_and_gpl-1.0-plus_and_gpl-2.0-plus_and_lgpl-2.0_and_lgpl-2.0-plus_and_lgpl-2.1_and_lgpl-2.1-plus_1.RULE new file mode 100644 index 00000000000..7f2ea495db2 --- /dev/null +++ b/src/licensedcode/data/rules/gpl-2.0_and_gpl-1.0-plus_and_gpl-2.0-plus_and_lgpl-2.0_and_lgpl-2.0-plus_and_lgpl-2.1_and_lgpl-2.1-plus_1.RULE @@ -0,0 +1,17 @@ +--- +license_expression: gpl-2.0 AND gpl-1.0-plus AND gpl-2.0-plus AND lgpl-2.0 AND lgpl-2.0-plus + AND lgpl-2.1 AND lgpl-2.1-plus +is_license_notice: yes +minimum_coverage: 90 +--- + +The license described in the COPYING file applies to the kernel source +as a whole, though individual source files can have a different license +which is required to be compatible with the GPL-2.0:: + + GPL-1.0+ : GNU General Public License v1.0 or later + GPL-2.0+ : GNU General Public License v2.0 or later + LGPL-2.0 : GNU Library General Public License v2 only + LGPL-2.0+ : GNU Library General Public License v2 or later + LGPL-2.1 : GNU Lesser General Public License v2.1 only + LGPL-2.1+ : GNU Lesser General Public License v2.1 or later \ No newline at end of file diff --git a/src/licensedcode/data/rules/gpl-2.0_with_linux-syscall-exception-gpl_14.RULE b/src/licensedcode/data/rules/gpl-2.0_with_linux-syscall-exception-gpl_14.RULE new file mode 100644 index 00000000000..29360e719b2 --- /dev/null +++ b/src/licensedcode/data/rules/gpl-2.0_with_linux-syscall-exception-gpl_14.RULE @@ -0,0 +1,10 @@ +--- +license_expression: gpl-2.0 WITH linux-syscall-exception-gpl +is_license_notice: yes +notes: seen in kernel /Documentation/process/license-rules.rst +--- + +The Linux Kernel is provided under the terms of the {{GNU General Public +License version 2 only}} (GPL-2.0), as provided in LICENSES/preferred/GPL-2.0, +with an explicit syscall exception described in +{{LICENSES/exceptions/Linux-syscall-note}}, as described in the COPYING file. \ No newline at end of file diff --git a/src/licensedcode/data/rules/license-clue_free-unknown_5.RULE b/src/licensedcode/data/rules/license-clue_free-unknown_5.RULE new file mode 100644 index 00000000000..3d5230b38c9 --- /dev/null +++ b/src/licensedcode/data/rules/license-clue_free-unknown_5.RULE @@ -0,0 +1,10 @@ +--- +license_expression: free-unknown +is_license_clue: yes +minimum_coverage: 100 +notes: seen in kernel /Documentation/process/license-rules.rst +--- + +Aside from that, individual files can be provided under a dual license, +e.g. one of the compatible GPL variants and alternatively under a +permissive license like BSD, MIT etc. \ No newline at end of file diff --git a/src/licensedcode/data/rules/license-clue_free-unknown_6.RULE b/src/licensedcode/data/rules/license-clue_free-unknown_6.RULE new file mode 100644 index 00000000000..3316420c86f --- /dev/null +++ b/src/licensedcode/data/rules/license-clue_free-unknown_6.RULE @@ -0,0 +1,16 @@ +--- +license_expression: free-unknown +is_license_clue: yes +minimum_coverage: 95 +notes: seen in kernel /Documentation/process/license-rules.rst +--- + +Dual Licensing Only + + These licenses should only be used to dual license code with another + license in addition to a preferred license. These licenses are available + from the directory:: + + LICENSES/dual/ + + in the kernel source tree. \ No newline at end of file diff --git a/src/licensedcode/data/rules/license-intro_82.RULE b/src/licensedcode/data/rules/license-intro_82.RULE new file mode 100644 index 00000000000..bbd3b2f6959 --- /dev/null +++ b/src/licensedcode/data/rules/license-intro_82.RULE @@ -0,0 +1,6 @@ +--- +license_expression: unknown-license-reference +is_license_intro: yes +--- + +* Some parts copyright and used with permission. \ No newline at end of file diff --git a/src/licensedcode/data/rules/license-intro_83.RULE b/src/licensedcode/data/rules/license-intro_83.RULE new file mode 100644 index 00000000000..3342dfd4ad3 --- /dev/null +++ b/src/licensedcode/data/rules/license-intro_83.RULE @@ -0,0 +1,7 @@ +--- +license_expression: unknown-license-reference +is_license_intro: yes +--- + +including portions of which come from the +Developer's Reference Manual and used with permission \ No newline at end of file diff --git a/src/licensedcode/data/rules/linux-syscall-exception-gpl_11.RULE b/src/licensedcode/data/rules/linux-syscall-exception-gpl_11.RULE new file mode 100644 index 00000000000..a85337f3546 --- /dev/null +++ b/src/licensedcode/data/rules/linux-syscall-exception-gpl_11.RULE @@ -0,0 +1,9 @@ +--- +license_expression: linux-syscall-exception-gpl +is_license_tag: yes +relevance: 70 +minimum_coverage: 100 +notes: seen in kernel /Documentation/process/license-rules.rst +--- + +SPDX-License-Identifier: WITH Linux-syscall-note \ No newline at end of file diff --git a/src/licensedcode/data/rules/proprietary-license_272.RULE b/src/licensedcode/data/rules/proprietary-license_272.RULE index cb3bde24654..9a038527ffe 100644 --- a/src/licensedcode/data/rules/proprietary-license_272.RULE +++ b/src/licensedcode/data/rules/proprietary-license_272.RULE @@ -1,6 +1,6 @@ --- license_expression: proprietary-license -is_license_notice: yes +is_license_clue: yes relevance: 100 ---