25 Jan, 2019

1 commit

  • Follow many of recommendations by scripts/checkpatch.pl, and follow
    "lift switch variables out of switches" by Kees Cook.
    This patch makes no functional change.

    Signed-off-by: Tetsuo Handa
    Signed-off-by: James Morris

    Tetsuo Handa
     

12 Feb, 2018

1 commit

  • This is the mindless scripted replacement of kernel use of POLL*
    variables as described by Al, done by this script:

    for V in IN OUT PRI ERR RDNORM RDBAND WRNORM WRBAND HUP RDHUP NVAL MSG; do
    L=`git grep -l -w POLL$V | grep -v '^t' | grep -v /um/ | grep -v '^sa' | grep -v '/poll.h$'|grep -v '^D'`
    for f in $L; do sed -i "-es/^\([^\"]*\)\(\\)/\\1E\\2/" $f; done
    done

    with de-mangling cleanups yet to come.

    NOTE! On almost all architectures, the EPOLL* constants have the same
    values as the POLL* constants do. But they keyword here is "almost".
    For various bad reasons they aren't the same, and epoll() doesn't
    actually work quite correctly in some cases due to this on Sparc et al.

    The next patch from Al will sort out the final differences, and we
    should be all done.

    Scripted-by: Al Viro
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     

28 Nov, 2017

1 commit


14 Nov, 2017

1 commit

  • Pull general security subsystem updates from James Morris:
    "TPM (from Jarkko):
    - essential clean up for tpm_crb so that ARM64 and x86 versions do
    not distract each other as much as before

    - /dev/tpm0 rejects now too short writes (shorter buffer than
    specified in the command header

    - use DMA-safe buffer in tpm_tis_spi

    - otherwise mostly minor fixes.

    Smack:
    - base support for overlafs

    Capabilities:
    - BPRM_FCAPS fixes, from Richard Guy Briggs:

    The audit subsystem is adding a BPRM_FCAPS record when auditing
    setuid application execution (SYSCALL execve). This is not expected
    as it was supposed to be limited to when the file system actually
    had capabilities in an extended attribute. It lists all
    capabilities making the event really ugly to parse what is
    happening. The PATH record correctly records the setuid bit and
    owner. Suppress the BPRM_FCAPS record on set*id.

    TOMOYO:
    - Y2038 timestamping fixes"

    * 'next-general' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security: (28 commits)
    MAINTAINERS: update the IMA, EVM, trusted-keys, encrypted-keys entries
    Smack: Base support for overlayfs
    MAINTAINERS: remove David Safford as maintainer for encrypted+trusted keys
    tomoyo: fix timestamping for y2038
    capabilities: audit log other surprising conditions
    capabilities: fix logic for effective root or real root
    capabilities: invert logic for clarity
    capabilities: remove a layer of conditional logic
    capabilities: move audit log decision to function
    capabilities: use intuitive names for id changes
    capabilities: use root_priveleged inline to clarify logic
    capabilities: rename has_cap to has_fcap
    capabilities: intuitive names for cap gain status
    capabilities: factor out cap_bprm_set_creds privileged root
    tpm, tpm_tis: use ARRAY_SIZE() to define TPM_HID_USR_IDX
    tpm: fix duplicate inline declaration specifier
    tpm: fix type of a local variables in tpm_tis_spi.c
    tpm: fix type of a local variable in tpm2_map_command()
    tpm: fix type of a local variable in tpm2_get_cc_attrs_tbl()
    tpm-dev-common: Reject too short writes
    ...

    Linus Torvalds
     

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
     

21 Oct, 2017

1 commit

  • Tomoyo uses an open-coded version of time_to_tm() to create a timestamp
    from the current time as read by get_seconds(). This will overflow and
    give wrong results on 32-bit systems in 2038.

    To correct this, this changes the code to use ktime_get_real_seconds()
    and the generic time64_to_tm() function that are both y2038-safe.
    Using the library function avoids adding an expensive 64-bit division
    in this code and can benefit from any optimizations we do in common
    code.

    Acked-by: Tetsuo Handa
    Signed-off-by: Arnd Bergmann
    Signed-off-by: James Morris

    Arnd Bergmann
     

12 Jun, 2014

1 commit

  • There is no point in calling gettimeofday if only the seconds part of
    the timespec is used. Use get_seconds() instead. It's not only the
    proper interface it's also faster.

    Signed-off-by: Thomas Gleixner
    Acked-by: Tetsuo Handa
    Cc: John Stultz
    Cc: Peter Zijlstra
    Cc: Kentaro Takeda
    Cc: linux-security-module@vger.kernel.org
    Link: http://lkml.kernel.org/r/20140611234607.775273584@linutronix.de

    Thomas Gleixner
     

21 Sep, 2012

1 commit


15 Mar, 2012

1 commit

  • "struct file_operations"->poll() expects "unsigned int" return value.
    All files in /sys/kernel/security/tomoyo/ directory other than
    /sys/kernel/security/tomoyo/query and /sys/kernel/security/tomoyo/audit should
    return POLLIN | POLLRDNORM | POLLOUT | POLLWRNORM rather than -ENOSYS.
    Also, /sys/kernel/security/tomoyo/query and /sys/kernel/security/tomoyo/audit
    should return POLLOUT | POLLWRNORM rather than 0 when there is no data to read.

    Signed-off-by: Tetsuo Handa
    Signed-off-by: James Morris

    Tetsuo Handa
     

04 Jan, 2012

1 commit


14 Sep, 2011

1 commit


14 Jul, 2011

1 commit


11 Jul, 2011

4 commits


01 Jul, 2011

1 commit


29 Jun, 2011

4 commits

  • Show statistics such as last policy update time and last policy violation time
    in addition to memory usage.

    Signed-off-by: Tetsuo Handa
    Signed-off-by: James Morris

    Tetsuo Handa
     
  • Gather string constants to one file in order to make the object size smaller.
    Use unsigned type where appropriate.
    read()/write() returns ssize_t.

    Signed-off-by: Tetsuo Handa
    Signed-off-by: James Morris

    Tetsuo Handa
     
  • Mauras Olivier reported that it is difficult to use TOMOYO in LXC environments,
    for TOMOYO cannot distinguish between environments outside the container and
    environments inside the container since LXC environments are created using
    pivot_root(). To address this problem, this patch introduces policy namespace.

    Each policy namespace has its own set of domain policy, exception policy and
    profiles, which are all independent of other namespaces. This independency
    allows users to develop policy without worrying interference among namespaces.

    Signed-off-by: Tetsuo Handa
    Signed-off-by: James Morris

    Tetsuo Handa
     
  • Add /sys/kernel/security/tomoyo/audit interface. This interface generates audit
    logs in the form of domain policy so that /usr/sbin/tomoyo-auditd can reuse
    audit logs for appending to /sys/kernel/security/tomoyo/domain_policy
    interface.

    Signed-off-by: Tetsuo Handa
    Signed-off-by: James Morris

    Tetsuo Handa