License cleanup: add SPDX GPL-2.0 license identifier to files with no license
Many source files in the tree are missing licensing information, which
makes it harder for compliance tools to determine the correct license.
By default all files without license information are under the default
license of the kernel, which is GPL version 2.
Update the files which contain no license information with the 'GPL-2.0'
SPDX license identifier. The SPDX identifier is a legally binding
shorthand, which can be used instead of the full boiler plate text.
This patch is based on work done by Thomas Gleixner and Kate Stewart and
Philippe Ombredanne.
How this work was done:
Patches were generated and checked against linux-4.14-rc6 for a subset of
the use cases:
- file had no licensing information it it.
- file was a */uapi/* one with no licensing information in it,
- file was a */uapi/* one with existing licensing information,
Further patches will be generated in subsequent months to fix up cases
where non-standard license headers were used, and references to license
had to be inferred by heuristics based on keywords.
The analysis to determine which SPDX License Identifier to be applied to
a file was done in a spreadsheet of side by side results from of the
output of two independent scanners (ScanCode & Windriver) producing SPDX
tag:value files created by Philippe Ombredanne. Philippe prepared the
base worksheet, and did an initial spot review of a few 1000 files.
The 4.13 kernel was the starting point of the analysis with 60,537 files
assessed. Kate Stewart did a file by file comparison of the scanner
results in the spreadsheet to determine which SPDX license identifier(s)
to be applied to the file. She confirmed any determination that was not
immediately clear with lawyers working with the Linux Foundation.
Criteria used to select files for SPDX license identifier tagging was:
- Files considered eligible had to be source code files.
- Make and config files were included as candidates if they contained >5
lines of source
- File already had some variant of a license header in it (even if <5
lines).
All documentation files were explicitly excluded.
The following heuristics were used to determine which SPDX license
identifiers to apply.
- when both scanners couldn't find any license traces, file was
considered to have no license information in it, and the top level
COPYING file license applied.
For non */uapi/* files that summary was:
SPDX license identifier # files
---------------------------------------------------|-------
GPL-2.0 11139
and resulted in the first patch in this series.
If that file was a */uapi/* path one, it was "GPL-2.0 WITH
Linux-syscall-note" otherwise it was "GPL-2.0". Results of that was:
SPDX license identifier # files
---------------------------------------------------|-------
GPL-2.0 WITH Linux-syscall-note 930
and resulted in the second patch in this series.
- if a file had some form of licensing information in it, and was one
of the */uapi/* ones, it was denoted with the Linux-syscall-note if
any GPL family license was found in the file or had no licensing in
it (per prior point). Results summary:
SPDX license identifier # files
---------------------------------------------------|------
GPL-2.0 WITH Linux-syscall-note 270
GPL-2.0+ WITH Linux-syscall-note 169
((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) 21
((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) 17
LGPL-2.1+ WITH Linux-syscall-note 15
GPL-1.0+ WITH Linux-syscall-note 14
((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause) 5
LGPL-2.0+ WITH Linux-syscall-note 4
LGPL-2.1 WITH Linux-syscall-note 3
((GPL-2.0 WITH Linux-syscall-note) OR MIT) 3
((GPL-2.0 WITH Linux-syscall-note) AND MIT) 1
and that resulted in the third patch in this series.
- when the two scanners agreed on the detected license(s), that became
the concluded license(s).
- when there was disagreement between the two scanners (one detected a
license but the other didn't, or they both detected different
licenses) a manual inspection of the file occurred.
- In most cases a manual inspection of the information in the file
resulted in a clear resolution of the license that should apply (and
which scanner probably needed to revisit its heuristics).
- When it was not immediately clear, the license identifier was
confirmed with lawyers working with the Linux Foundation.
- If there was any question as to the appropriate license identifier,
the file was flagged for further research and to be revisited later
in time.
In total, over 70 hours of logged manual review was done on the
spreadsheet to determine the SPDX license identifiers to apply to the
source files by Kate, Philippe, Thomas and, in some cases, confirmation
by lawyers working with the Linux Foundation.
Kate also obtained a third independent scan of the 4.13 code base from
FOSSology, and compared selected files where the other two scanners
disagreed against that SPDX file, to see if there was new insights. The
Windriver scanner is based on an older version of FOSSology in part, so
they are related.
Thomas did random spot checks in about 500 files from the spreadsheets
for the uapi headers and agreed with SPDX license identifier in the
files he inspected. For the non-uapi files Thomas did random spot checks
in about 15000 files.
In initial set of patches against 4.14-rc6, 3 files were found to have
copy/paste license identifier errors, and have been fixed to reflect the
correct identifier.
Additionally Philippe spent 10 hours this week doing a detailed manual
inspection and review of the 12,461 patched files from the initial patch
version early this week with:
- a full scancode scan run, collecting the matched texts, detected
license ids and scores
- reviewing anything where there was a license detected (about 500+
files) to ensure that the applied SPDX license was correct
- reviewing anything where there was no detection but the patch license
was not GPL-2.0 WITH Linux-syscall-note to ensure that the applied
SPDX license was correct
This produced a worksheet with 20 files needing minor correction. This
worksheet was then exported into 3 different .csv files for the
different types of files to be modified.
These .csv files were then reviewed by Greg. Thomas wrote a script to
parse the csv files and add the proper SPDX tag to the file, in the
format that the file expected. This script was further refined by Greg
based on the output to detect more types of files automatically and to
distinguish between header and source .c files (which need different
comment types.) Finally Greg ran the script using the .csv files to
generate the patches.
Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org>
Reviewed-by: Philippe Ombredanne <pombredanne@nexb.com>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-01 17:07:57 +03:00
|
|
|
# SPDX-License-Identifier: GPL-2.0
|
2014-01-16 19:16:47 +04:00
|
|
|
infiniband-$(CONFIG_INFINIBAND_ADDR_TRANS) := rdma_cm.o
|
2006-12-01 03:53:41 +03:00
|
|
|
user_access-$(CONFIG_INFINIBAND_ADDR_TRANS) := rdma_ucm.o
|
2006-06-18 07:37:28 +04:00
|
|
|
|
2016-05-19 17:12:33 +03:00
|
|
|
obj-$(CONFIG_INFINIBAND) += ib_core.o ib_cm.o iw_cm.o \
|
2014-01-16 19:16:47 +04:00
|
|
|
$(infiniband-y)
|
2005-09-07 23:43:08 +04:00
|
|
|
obj-$(CONFIG_INFINIBAND_USER_MAD) += ib_umad.o
|
2018-05-23 08:22:11 +03:00
|
|
|
obj-$(CONFIG_INFINIBAND_USER_ACCESS) += ib_uverbs.o $(user_access-y)
|
2005-04-17 02:20:36 +04:00
|
|
|
|
2016-05-03 19:01:09 +03:00
|
|
|
ib_core-y := packer.o ud_header.o verbs.o cq.o rw.o sysfs.o \
|
2020-05-28 22:45:46 +03:00
|
|
|
device.o cache.o netlink.o \
|
2016-05-19 17:12:33 +03:00
|
|
|
roce_gid_mgmt.o mr_pool.o addr.o sa_query.o \
|
IB/core: Enforce PKey security on QPs
Add new LSM hooks to allocate and free security contexts and check for
permission to access a PKey.
Allocate and free a security context when creating and destroying a QP.
This context is used for controlling access to PKeys.
When a request is made to modify a QP that changes the port, PKey index,
or alternate path, check that the QP has permission for the PKey in the
PKey table index on the subnet prefix of the port. If the QP is shared
make sure all handles to the QP also have access.
Store which port and PKey index a QP is using. After the reset to init
transition the user can modify the port, PKey index and alternate path
independently. So port and PKey settings changes can be a merge of the
previous settings and the new ones.
In order to maintain access control if there are PKey table or subnet
prefix change keep a list of all QPs are using each PKey index on
each port. If a change occurs all QPs using that device and port must
have access enforced for the new cache settings.
These changes add a transaction to the QP modify process. Association
with the old port and PKey index must be maintained if the modify fails,
and must be removed if it succeeds. Association with the new port and
PKey index must be established prior to the modify and removed if the
modify fails.
1. When a QP is modified to a particular Port, PKey index or alternate
path insert that QP into the appropriate lists.
2. Check permission to access the new settings.
3. If step 2 grants access attempt to modify the QP.
4a. If steps 2 and 3 succeed remove any prior associations.
4b. If ether fails remove the new setting associations.
If a PKey table or subnet prefix changes walk the list of QPs and
check that they have permission. If not send the QP to the error state
and raise a fatal error event. If it's a shared QP make sure all the
QPs that share the real_qp have permission as well. If the QP that
owns a security structure is denied access the security structure is
marked as such and the QP is added to an error_list. Once the moving
the QP to error is complete the security structure mark is cleared.
Maintaining the lists correctly turns QP destroy into a transaction.
The hardware driver for the device frees the ib_qp structure, so while
the destroy is in progress the ib_qp pointer in the ib_qp_security
struct is undefined. When the destroy process begins the ib_qp_security
structure is marked as destroying. This prevents any action from being
taken on the QP pointer. After the QP is destroyed successfully it
could still listed on an error_list wait for it to be processed by that
flow before cleaning up the structure.
If the destroy fails the QPs port and PKey settings are reinserted into
the appropriate lists, the destroying flag is cleared, and access control
is enforced, in case there were any cache changes during the destroy
flow.
To keep the security changes isolated a new file is used to hold security
related functionality.
Signed-off-by: Daniel Jurgens <danielj@mellanox.com>
Acked-by: Doug Ledford <dledford@redhat.com>
[PM: merge fixup in ib_verbs.h and uverbs_cmd.c]
Signed-off-by: Paul Moore <paul@paul-moore.com>
2017-05-19 15:48:52 +03:00
|
|
|
multicast.o mad.o smi.o agent.o mad_rmpp.o \
|
2019-12-18 23:18:15 +03:00
|
|
|
nldev.o restrack.o counters.o ib_core_uverbs.o \
|
2020-04-30 22:21:43 +03:00
|
|
|
trace.o lag.o
|
2017-06-20 09:14:15 +03:00
|
|
|
|
2018-04-26 10:56:34 +03:00
|
|
|
ib_core-$(CONFIG_SECURITY_INFINIBAND) += security.o
|
2017-01-10 03:02:14 +03:00
|
|
|
ib_core-$(CONFIG_CGROUP_RDMA) += cgroup.o
|
2005-04-17 02:20:36 +04:00
|
|
|
|
2020-08-17 16:53:16 +03:00
|
|
|
ib_cm-y := cm.o cm_trace.o
|
2005-07-27 22:45:40 +04:00
|
|
|
|
2014-03-27 02:07:35 +04:00
|
|
|
iw_cm-y := iwcm.o iwpm_util.o iwpm_msg.o
|
2006-08-04 01:02:42 +04:00
|
|
|
|
2019-12-18 23:18:10 +03:00
|
|
|
CFLAGS_cma_trace.o += -I$(src)
|
|
|
|
rdma_cm-y := cma.o cma_trace.o
|
2006-06-18 07:37:29 +04:00
|
|
|
|
2015-12-23 15:56:55 +03:00
|
|
|
rdma_cm-$(CONFIG_INFINIBAND_ADDR_TRANS_CONFIGFS) += cma_configfs.o
|
|
|
|
|
2006-12-01 03:53:41 +03:00
|
|
|
rdma_ucm-y := ucma.o
|
|
|
|
|
2005-04-17 02:20:36 +04:00
|
|
|
ib_umad-y := user_mad.o
|
2005-07-08 04:57:14 +04:00
|
|
|
|
2017-04-04 13:31:42 +03:00
|
|
|
ib_uverbs-y := uverbs_main.o uverbs_cmd.o uverbs_marshall.o \
|
2017-08-03 16:07:00 +03:00
|
|
|
rdma_core.o uverbs_std_types.o uverbs_ioctl.o \
|
2018-08-10 05:14:43 +03:00
|
|
|
uverbs_std_types_cq.o \
|
2018-04-05 18:53:25 +03:00
|
|
|
uverbs_std_types_flow_action.o uverbs_std_types_dm.o \
|
2018-08-10 05:14:36 +03:00
|
|
|
uverbs_std_types_mr.o uverbs_std_types_counters.o \
|
2020-01-08 20:22:05 +03:00
|
|
|
uverbs_uapi.o uverbs_std_types_device.o \
|
2020-05-19 10:27:09 +03:00
|
|
|
uverbs_std_types_async_fd.o \
|
2020-05-19 10:27:10 +03:00
|
|
|
uverbs_std_types_srq.o \
|
2020-05-19 10:27:11 +03:00
|
|
|
uverbs_std_types_wq.o \
|
|
|
|
uverbs_std_types_qp.o
|
2020-12-16 00:27:13 +03:00
|
|
|
ib_uverbs-$(CONFIG_INFINIBAND_USER_MEM) += umem.o umem_dmabuf.o
|
2019-01-09 12:15:15 +03:00
|
|
|
ib_uverbs-$(CONFIG_INFINIBAND_ON_DEMAND_PAGING) += umem_odp.o
|