Skip to content

Commit

Permalink
Add and modify license rules to fix detections
Browse files Browse the repository at this point in the history
Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
  • Loading branch information
AyanSinhaMahapatra committed Sep 6, 2024
1 parent 0432bf6 commit 3b8a9ce
Show file tree
Hide file tree
Showing 18 changed files with 147 additions and 3 deletions.
6 changes: 6 additions & 0 deletions src/licensedcode/data/rules/false-positive_771.RULE
Original file line number Diff line number Diff line change
@@ -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
14 changes: 14 additions & 0 deletions src/licensedcode/data/rules/false-positive_772.RULE
Original file line number Diff line number Diff line change
@@ -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: <SPDX License Expression>
C header: /* SPDX-License-Identifier: <SPDX License Expression> */
ASM: /* SPDX-License-Identifier: <SPDX License Expression> */
scripts: # SPDX-License-Identifier: <SPDX License Expression>
.rst: .. SPDX-License-Identifier: <SPDX License Expression>
.dts{i}: // SPDX-License-Identifier: <SPDX License Expression>
6 changes: 6 additions & 0 deletions src/licensedcode/data/rules/false-positive_773.RULE
Original file line number Diff line number Diff line change
@@ -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
6 changes: 6 additions & 0 deletions src/licensedcode/data/rules/false-positive_774.RULE
Original file line number Diff line number Diff line change
@@ -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
6 changes: 6 additions & 0 deletions src/licensedcode/data/rules/false-positive_775.RULE
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
is_false_positive: yes
notes: seen at kernel/bpf/syscall.c
---

sizeof(license) - 1) < 0)
6 changes: 6 additions & 0 deletions src/licensedcode/data/rules/false-positive_776.RULE
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
is_false_positive: yes
notes: seen at kernel/bpf/syscall.c
---

license[sizeof(license) - 1] = 0;
9 changes: 9 additions & 0 deletions src/licensedcode/data/rules/gcc-linking-exception-2.0_13.RULE
Original file line number Diff line number Diff line change
@@ -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: <SPDX-License> WITH GCC-exception-2.0
9 changes: 9 additions & 0 deletions src/licensedcode/data/rules/gpl-2.0-plus_1130.RULE
Original file line number Diff line number Diff line change
@@ -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.
9 changes: 9 additions & 0 deletions src/licensedcode/data/rules/gpl-2.0-plus_or_bsd-new_22.RULE
Original file line number Diff line number Diff line change
@@ -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)
Original file line number Diff line number Diff line change
Expand Up @@ -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
---

Expand Down
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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.
10 changes: 10 additions & 0 deletions src/licensedcode/data/rules/license-clue_free-unknown_5.RULE
Original file line number Diff line number Diff line change
@@ -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.
16 changes: 16 additions & 0 deletions src/licensedcode/data/rules/license-clue_free-unknown_6.RULE
Original file line number Diff line number Diff line change
@@ -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.
6 changes: 6 additions & 0 deletions src/licensedcode/data/rules/license-intro_82.RULE
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
license_expression: unknown-license-reference
is_license_intro: yes
---

* Some parts copyright and used with permission.
7 changes: 7 additions & 0 deletions src/licensedcode/data/rules/license-intro_83.RULE
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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: <SPDX-License> WITH Linux-syscall-note
2 changes: 1 addition & 1 deletion src/licensedcode/data/rules/proprietary-license_272.RULE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
license_expression: proprietary-license
is_license_notice: yes
is_license_clue: yes
relevance: 100
---

Expand Down

0 comments on commit 3b8a9ce

Please sign in to comment.