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 14:07:57 +00:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
2005-04-16 22:20:36 +00:00
|
|
|
#ifndef _ASM_S390X_COMPAT_H
|
|
|
|
#define _ASM_S390X_COMPAT_H
|
|
|
|
/*
|
|
|
|
* Architecture specific compatibility types
|
|
|
|
*/
|
|
|
|
#include <linux/types.h>
|
|
|
|
#include <linux/sched.h>
|
2017-02-08 17:51:37 +00:00
|
|
|
#include <linux/sched/task_stack.h>
|
2009-06-12 08:26:25 +00:00
|
|
|
#include <linux/thread_info.h>
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2021-07-22 14:28:58 +00:00
|
|
|
#define compat_mode_t compat_mode_t
|
|
|
|
typedef u16 compat_mode_t;
|
|
|
|
|
2018-04-18 20:01:26 +00:00
|
|
|
#include <asm-generic/compat.h>
|
|
|
|
|
2017-07-08 15:40:39 +00:00
|
|
|
#define __TYPE_IS_PTR(t) (!__builtin_types_compatible_p( \
|
|
|
|
typeof(0?(__force t)0:0ULL), u64))
|
2014-03-05 11:55:06 +00:00
|
|
|
|
|
|
|
#define __SC_DELOUSE(t,v) ({ \
|
|
|
|
BUILD_BUG_ON(sizeof(t) > 4 && !__TYPE_IS_PTR(t)); \
|
2017-07-08 15:40:39 +00:00
|
|
|
(__force t)(__TYPE_IS_PTR(t) ? ((v) & 0x7fffffff) : (v)); \
|
2014-03-05 11:55:06 +00:00
|
|
|
})
|
2012-11-23 14:12:59 +00:00
|
|
|
|
2007-02-05 20:18:17 +00:00
|
|
|
#define PSW32_MASK_PER 0x40000000UL
|
|
|
|
#define PSW32_MASK_DAT 0x04000000UL
|
|
|
|
#define PSW32_MASK_IO 0x02000000UL
|
|
|
|
#define PSW32_MASK_EXT 0x01000000UL
|
|
|
|
#define PSW32_MASK_KEY 0x00F00000UL
|
2011-10-30 14:16:50 +00:00
|
|
|
#define PSW32_MASK_BASE 0x00080000UL /* Always one */
|
2007-02-05 20:18:17 +00:00
|
|
|
#define PSW32_MASK_MCHECK 0x00040000UL
|
|
|
|
#define PSW32_MASK_WAIT 0x00020000UL
|
|
|
|
#define PSW32_MASK_PSTATE 0x00010000UL
|
|
|
|
#define PSW32_MASK_ASC 0x0000C000UL
|
|
|
|
#define PSW32_MASK_CC 0x00003000UL
|
|
|
|
#define PSW32_MASK_PM 0x00000f00UL
|
2013-10-16 07:58:01 +00:00
|
|
|
#define PSW32_MASK_RI 0x00000080UL
|
2007-02-05 20:18:17 +00:00
|
|
|
|
2012-11-07 09:44:08 +00:00
|
|
|
#define PSW32_MASK_USER 0x0000FF00UL
|
2011-10-30 14:16:50 +00:00
|
|
|
|
|
|
|
#define PSW32_ADDR_AMODE 0x80000000UL
|
2007-02-05 20:18:17 +00:00
|
|
|
#define PSW32_ADDR_INSN 0x7FFFFFFFUL
|
|
|
|
|
2011-10-30 14:16:50 +00:00
|
|
|
#define PSW32_DEFAULT_KEY (((u32) PAGE_DEFAULT_ACC) << 20)
|
2007-02-05 20:18:17 +00:00
|
|
|
|
|
|
|
#define PSW32_ASC_PRIMARY 0x00000000UL
|
|
|
|
#define PSW32_ASC_ACCREG 0x00004000UL
|
|
|
|
#define PSW32_ASC_SECONDARY 0x00008000UL
|
|
|
|
#define PSW32_ASC_HOME 0x0000C000UL
|
|
|
|
|
2013-10-16 12:17:29 +00:00
|
|
|
#define PSW32_USER_BITS (PSW32_MASK_DAT | PSW32_MASK_IO | PSW32_MASK_EXT | \
|
|
|
|
PSW32_DEFAULT_KEY | PSW32_MASK_BASE | \
|
2014-01-13 12:35:16 +00:00
|
|
|
PSW32_MASK_MCHECK | PSW32_MASK_PSTATE | \
|
|
|
|
PSW32_ASC_PRIMARY)
|
2007-02-05 20:18:17 +00:00
|
|
|
|
2010-03-10 23:21:19 +00:00
|
|
|
#define COMPAT_USER_HZ 100
|
|
|
|
#define COMPAT_UTS_MACHINE "s390\0\0\0\0"
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2005-09-06 22:16:40 +00:00
|
|
|
typedef u16 __compat_uid_t;
|
|
|
|
typedef u16 __compat_gid_t;
|
2005-04-16 22:20:36 +00:00
|
|
|
typedef u16 compat_dev_t;
|
|
|
|
typedef u16 compat_nlink_t;
|
|
|
|
typedef u16 compat_ipc_pid_t;
|
|
|
|
typedef __kernel_fsid_t compat_fsid_t;
|
|
|
|
|
2013-04-20 12:05:42 +00:00
|
|
|
typedef struct {
|
|
|
|
u32 mask;
|
|
|
|
u32 addr;
|
|
|
|
} __aligned(8) psw_compat_t;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
psw_compat_t psw;
|
|
|
|
u32 gprs[NUM_GPRS];
|
|
|
|
u32 acrs[NUM_ACRS];
|
|
|
|
u32 orig_gpr2;
|
|
|
|
} s390_compat_regs;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
u32 gprs_high[NUM_GPRS];
|
|
|
|
} s390_compat_regs_high;
|
|
|
|
|
2005-04-16 22:20:36 +00:00
|
|
|
struct compat_stat {
|
|
|
|
compat_dev_t st_dev;
|
|
|
|
u16 __pad1;
|
|
|
|
compat_ino_t st_ino;
|
|
|
|
compat_mode_t st_mode;
|
|
|
|
compat_nlink_t st_nlink;
|
2005-09-06 22:16:40 +00:00
|
|
|
__compat_uid_t st_uid;
|
|
|
|
__compat_gid_t st_gid;
|
2005-04-16 22:20:36 +00:00
|
|
|
compat_dev_t st_rdev;
|
|
|
|
u16 __pad2;
|
|
|
|
u32 st_size;
|
|
|
|
u32 st_blksize;
|
|
|
|
u32 st_blocks;
|
|
|
|
u32 st_atime;
|
|
|
|
u32 st_atime_nsec;
|
|
|
|
u32 st_mtime;
|
|
|
|
u32 st_mtime_nsec;
|
|
|
|
u32 st_ctime;
|
|
|
|
u32 st_ctime_nsec;
|
|
|
|
u32 __unused4;
|
|
|
|
u32 __unused5;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct compat_flock {
|
|
|
|
short l_type;
|
|
|
|
short l_whence;
|
|
|
|
compat_off_t l_start;
|
|
|
|
compat_off_t l_len;
|
|
|
|
compat_pid_t l_pid;
|
|
|
|
};
|
|
|
|
|
|
|
|
#define F_GETLK64 12
|
|
|
|
#define F_SETLK64 13
|
|
|
|
#define F_SETLKW64 14
|
|
|
|
|
|
|
|
struct compat_flock64 {
|
|
|
|
short l_type;
|
|
|
|
short l_whence;
|
|
|
|
compat_loff_t l_start;
|
|
|
|
compat_loff_t l_len;
|
|
|
|
compat_pid_t l_pid;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct compat_statfs {
|
2013-04-22 08:41:27 +00:00
|
|
|
u32 f_type;
|
|
|
|
u32 f_bsize;
|
|
|
|
u32 f_blocks;
|
|
|
|
u32 f_bfree;
|
|
|
|
u32 f_bavail;
|
|
|
|
u32 f_files;
|
|
|
|
u32 f_ffree;
|
2005-04-16 22:20:36 +00:00
|
|
|
compat_fsid_t f_fsid;
|
2013-04-22 08:41:27 +00:00
|
|
|
u32 f_namelen;
|
|
|
|
u32 f_frsize;
|
|
|
|
u32 f_flags;
|
|
|
|
u32 f_spare[4];
|
|
|
|
};
|
|
|
|
|
|
|
|
struct compat_statfs64 {
|
|
|
|
u32 f_type;
|
|
|
|
u32 f_bsize;
|
|
|
|
u64 f_blocks;
|
|
|
|
u64 f_bfree;
|
|
|
|
u64 f_bavail;
|
|
|
|
u64 f_files;
|
|
|
|
u64 f_ffree;
|
|
|
|
compat_fsid_t f_fsid;
|
|
|
|
u32 f_namelen;
|
|
|
|
u32 f_frsize;
|
|
|
|
u32 f_flags;
|
|
|
|
u32 f_spare[4];
|
2005-04-16 22:20:36 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#define COMPAT_RLIM_INFINITY 0xffffffff
|
|
|
|
|
|
|
|
#define COMPAT_OFF_T_MAX 0x7fffffff
|
|
|
|
|
|
|
|
/*
|
|
|
|
* A pointer passed in from user mode. This should not
|
|
|
|
* be used for syscall parameters, just declare them
|
|
|
|
* as pointers because the syscall entry code will have
|
2008-02-03 14:32:51 +00:00
|
|
|
* appropriately converted them already.
|
2005-04-16 22:20:36 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
static inline void __user *compat_ptr(compat_uptr_t uptr)
|
|
|
|
{
|
|
|
|
return (void __user *)(unsigned long)(uptr & 0x7fffffffUL);
|
|
|
|
}
|
2019-12-12 17:15:25 +00:00
|
|
|
#define compat_ptr(uptr) compat_ptr(uptr)
|
2006-03-27 09:16:09 +00:00
|
|
|
|
2009-06-12 08:26:25 +00:00
|
|
|
#ifdef CONFIG_COMPAT
|
|
|
|
|
|
|
|
static inline int is_compat_task(void)
|
|
|
|
{
|
2015-11-26 08:25:35 +00:00
|
|
|
return test_thread_flag(TIF_31BIT);
|
2009-06-12 08:26:25 +00:00
|
|
|
}
|
|
|
|
|
2013-04-20 12:25:42 +00:00
|
|
|
#endif
|
|
|
|
|
2005-04-16 22:20:36 +00:00
|
|
|
struct compat_ipc64_perm {
|
|
|
|
compat_key_t key;
|
2005-09-06 22:16:40 +00:00
|
|
|
__compat_uid32_t uid;
|
|
|
|
__compat_gid32_t gid;
|
|
|
|
__compat_uid32_t cuid;
|
|
|
|
__compat_gid32_t cgid;
|
2005-04-16 22:20:36 +00:00
|
|
|
compat_mode_t mode;
|
|
|
|
unsigned short __pad1;
|
|
|
|
unsigned short seq;
|
|
|
|
unsigned short __pad2;
|
|
|
|
unsigned int __unused1;
|
|
|
|
unsigned int __unused2;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct compat_semid64_ds {
|
|
|
|
struct compat_ipc64_perm sem_perm;
|
2015-05-05 20:47:56 +00:00
|
|
|
compat_ulong_t sem_otime;
|
|
|
|
compat_ulong_t sem_otime_high;
|
|
|
|
compat_ulong_t sem_ctime;
|
|
|
|
compat_ulong_t sem_ctime_high;
|
2005-04-16 22:20:36 +00:00
|
|
|
compat_ulong_t sem_nsems;
|
|
|
|
compat_ulong_t __unused1;
|
|
|
|
compat_ulong_t __unused2;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct compat_msqid64_ds {
|
|
|
|
struct compat_ipc64_perm msg_perm;
|
2015-05-05 20:47:56 +00:00
|
|
|
compat_ulong_t msg_stime;
|
|
|
|
compat_ulong_t msg_stime_high;
|
|
|
|
compat_ulong_t msg_rtime;
|
|
|
|
compat_ulong_t msg_rtime_high;
|
|
|
|
compat_ulong_t msg_ctime;
|
|
|
|
compat_ulong_t msg_ctime_high;
|
2005-04-16 22:20:36 +00:00
|
|
|
compat_ulong_t msg_cbytes;
|
|
|
|
compat_ulong_t msg_qnum;
|
|
|
|
compat_ulong_t msg_qbytes;
|
|
|
|
compat_pid_t msg_lspid;
|
|
|
|
compat_pid_t msg_lrpid;
|
|
|
|
compat_ulong_t __unused1;
|
|
|
|
compat_ulong_t __unused2;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct compat_shmid64_ds {
|
|
|
|
struct compat_ipc64_perm shm_perm;
|
|
|
|
compat_size_t shm_segsz;
|
2015-05-05 20:47:56 +00:00
|
|
|
compat_ulong_t shm_atime;
|
|
|
|
compat_ulong_t shm_atime_high;
|
|
|
|
compat_ulong_t shm_dtime;
|
|
|
|
compat_ulong_t shm_dtime_high;
|
|
|
|
compat_ulong_t shm_ctime;
|
|
|
|
compat_ulong_t shm_ctime_high;
|
2005-04-16 22:20:36 +00:00
|
|
|
compat_pid_t shm_cpid;
|
|
|
|
compat_pid_t shm_lpid;
|
|
|
|
compat_ulong_t shm_nattch;
|
|
|
|
compat_ulong_t __unused1;
|
|
|
|
compat_ulong_t __unused2;
|
|
|
|
};
|
|
|
|
#endif /* _ASM_S390X_COMPAT_H */
|