02 Nov, 2017

1 commit

  • 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
    Reviewed-by: Philippe Ombredanne
    Reviewed-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

01 Aug, 2017

1 commit


11 Mar, 2017

1 commit

  • Compiling with clang and -Wundef makes the compiler report a usage of
    undefined PF_MAX macro in security/selinux/include/classmap.h:

    In file included from scripts/selinux/mdp/mdp.c:48:
    security/selinux/include/classmap.h:37:31: warning: no previous
    extern declaration for non-static variable 'secclass_map'
    [-Wmissing-variable-declarations]
    struct security_class_mapping secclass_map[] = {
    ^
    security/selinux/include/classmap.h:235:5: error: 'PF_MAX' is not
    defined, evaluates to 0 [-Werror,-Wundef]
    #if PF_MAX > 43
    ^
    In file included from scripts/selinux/genheaders/genheaders.c:17:
    security/selinux/include/classmap.h:37:31: warning: no previous
    extern declaration for non-static variable 'secclass_map'
    [-Wmissing-variable-declarations]
    struct security_class_mapping secclass_map[] = {
    ^
    security/selinux/include/classmap.h:235:5: error: 'PF_MAX' is not
    defined, evaluates to 0 [-Werror,-Wundef]
    #if PF_MAX > 43
    ^

    PF_MAX is defined in include/linux/socket.h but not in
    include/uapi/linux/socket.h. Therefore host programs have to rely on the
    definition from libc's /usr/include/bits/socket.h, included by
    .

    Fix the issue by using sys/socket.h in mdp and genheaders. When
    classmap.h is included by security/selinux/avc.c, it uses the kernel
    definition of PF_MAX, which makes the test consistent.

    Signed-off-by: Nicolas Iooss
    Signed-off-by: Paul Moore

    Nicolas Iooss
     

21 Dec, 2016

1 commit

  • Commit 3322d0d64f4e ("selinux: keep SELinux in sync with new capability
    definitions") added a check on the defined capabilities without
    explicitly including the capability header file which caused problems
    when building genheaders for users of clang/llvm. Resolve this by
    using the kernel headers when building genheaders, which is arguably
    the right thing to do regardless, and explicitly including the
    kernel's capability.h header file in classmap.h. We also update the
    mdp build, even though it wasn't causing an error we really should
    be using the headers from the kernel we are building.

    Reported-by: Nicolas Iooss
    Signed-off-by: Paul Moore

    Paul Moore
     

18 Jun, 2014

1 commit


04 Mar, 2011

1 commit

  • The security_is_socket_class() is auto-generated by genheaders based
    on classmap.h to reduce maintenance effort when a new class is defined
    in SELinux kernel. The name for any socket class should be suffixed by
    "socket" and doesn't contain more than one substr of "socket".

    Signed-off-by: Harry Ciao
    Signed-off-by: Eric Paris
    Acked-by: Stephen Smalley

    Harry Ciao
     

16 Mar, 2010

1 commit

  • Fix const warning in the genheaders script as a result of
    changes to the headers, as noted here:

    http://linux.derkeiler.com/Mailing-Lists/Kernel/2010-03/msg03977.html

    Reported-by: Stephen Rothwell
    Signed-off-by: James Morris

    James Morris
     

23 Nov, 2009

1 commit

  • If a permission name is long enough the selinux class definition generation
    tool will go into a infinite loop. This is because it's macro max() is
    fooled into thinking it is dealing with unsigned numbers. This patch makes
    sure the macro always uses signed number so 1 > -1.

    Signed-off-by: Eric Paris
    Signed-off-by: James Morris

    Eric Paris
     

19 Nov, 2009

1 commit

  • scripts/selinux/genheaders/genheaders.c:20: warning: no previous prototype
    for ?usage?
    scripts/selinux/genheaders/genheaders.c:26: warning: no previous prototype
    for ?stoupperx?

    Signed-off-by: Alan Cox
    Acked-by: WANG Cong
    Signed-off-by: James Morris

    Alan Cox
     

24 Oct, 2009

1 commit


07 Oct, 2009

1 commit

  • Add a simple utility (scripts/selinux/genheaders) and invoke it to
    generate the kernel-private class and permission indices in flask.h
    and av_permissions.h automatically during the kernel build from the
    security class mapping definitions in classmap.h. Adding new kernel
    classes and permissions can then be done just by adding them to classmap.h.

    Signed-off-by: Stephen Smalley
    Signed-off-by: James Morris

    Stephen Smalley