25 Dec, 2016

1 commit


23 Dec, 2016

1 commit


21 Dec, 2016

9 commits

  • 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
     
  • For remote attestion it is important for the ima measurement values to
    be platform-independent. Therefore integer fields to be hashed must be
    converted to canonical format.

    Link: http://lkml.kernel.org/r/1480554346-29071-11-git-send-email-zohar@linux.vnet.ibm.com
    Signed-off-by: Andreas Steffen
    Signed-off-by: Mimi Zohar
    Cc: Thiago Jung Bauermann
    Cc: "Eric W. Biederman"
    Cc: Dmitry Kasatkin
    Cc: Josh Sklar
    Cc: Dave Young
    Cc: Vivek Goyal
    Cc: Baoquan He
    Cc: Michael Ellerman
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Cc: Stewart Smith
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andreas Steffen
     
  • The IMA binary_runtime_measurements list is currently in platform native
    format.

    To allow restoring a measurement list carried across kexec with a
    different endianness than the targeted kernel, this patch defines
    little-endian as the canonical format. For big endian systems wanting
    to save/restore the measurement list from a system with a different
    endianness, a new boot command line parameter named "ima_canonical_fmt"
    is defined.

    Considerations: use of the "ima_canonical_fmt" boot command line option
    will break existing userspace applications on big endian systems
    expecting the binary_runtime_measurements list to be in platform native
    format.

    Link: http://lkml.kernel.org/r/1480554346-29071-10-git-send-email-zohar@linux.vnet.ibm.com
    Signed-off-by: Mimi Zohar
    Acked-by: Dmitry Kasatkin
    Cc: Thiago Jung Bauermann
    Cc: "Eric W. Biederman"
    Cc: Andreas Steffen
    Cc: Josh Sklar
    Cc: Dave Young
    Cc: Vivek Goyal
    Cc: Baoquan He
    Cc: Michael Ellerman
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Cc: Stewart Smith
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mimi Zohar
     
  • The configured IMA measurement list template format can be replaced at
    runtime on the boot command line, including a custom template format.
    This patch adds support for restoring a measuremement list containing
    multiple builtin/custom template formats.

    Link: http://lkml.kernel.org/r/1480554346-29071-9-git-send-email-zohar@linux.vnet.ibm.com
    Signed-off-by: Mimi Zohar
    Acked-by: Dmitry Kasatkin
    Cc: Thiago Jung Bauermann
    Cc: "Eric W. Biederman"
    Cc: Andreas Steffen
    Cc: Josh Sklar
    Cc: Dave Young
    Cc: Vivek Goyal
    Cc: Baoquan He
    Cc: Michael Ellerman
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Cc: Stewart Smith
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mimi Zohar
     
  • The builtin and single custom templates are currently stored in an
    array. In preparation for being able to restore a measurement list
    containing multiple builtin/custom templates, this patch stores the
    builtin and custom templates as a linked list. This will permit
    defining more than one custom template per boot.

    Link: http://lkml.kernel.org/r/1480554346-29071-8-git-send-email-zohar@linux.vnet.ibm.com
    Signed-off-by: Mimi Zohar
    Acked-by: Dmitry Kasatkin
    Cc: Thiago Jung Bauermann
    Cc: "Eric W. Biederman"
    Cc: Andreas Steffen
    Cc: Josh Sklar
    Cc: Dave Young
    Cc: Vivek Goyal
    Cc: Baoquan He
    Cc: Michael Ellerman
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Cc: Stewart Smith
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mimi Zohar
     
  • The TPM PCRs are only reset on a hard reboot. In order to validate a
    TPM's quote after a soft reboot (eg. kexec -e), the IMA measurement
    list of the running kernel must be saved and restored on boot.

    This patch uses the kexec buffer passing mechanism to pass the
    serialized IMA binary_runtime_measurements to the next kernel.

    Link: http://lkml.kernel.org/r/1480554346-29071-7-git-send-email-zohar@linux.vnet.ibm.com
    Signed-off-by: Thiago Jung Bauermann
    Signed-off-by: Mimi Zohar
    Acked-by: "Eric W. Biederman"
    Acked-by: Dmitry Kasatkin
    Cc: Andreas Steffen
    Cc: Josh Sklar
    Cc: Dave Young
    Cc: Vivek Goyal
    Cc: Baoquan He
    Cc: Michael Ellerman
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Cc: Stewart Smith
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mimi Zohar
     
  • In preparation for serializing the binary_runtime_measurements, this
    patch maintains the amount of memory required.

    Link: http://lkml.kernel.org/r/1480554346-29071-5-git-send-email-zohar@linux.vnet.ibm.com
    Signed-off-by: Mimi Zohar
    Acked-by: Dmitry Kasatkin
    Cc: Thiago Jung Bauermann
    Cc: "Eric W. Biederman"
    Cc: Andreas Steffen
    Cc: Josh Sklar
    Cc: Dave Young
    Cc: Vivek Goyal
    Cc: Baoquan He
    Cc: Michael Ellerman
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Cc: Stewart Smith
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mimi Zohar
     
  • Measurements carried across kexec need to be added to the IMA
    measurement list, but should not prevent measurements of the newly
    booted kernel from being added to the measurement list. This patch adds
    support for allowing duplicate measurements.

    The "boot_aggregate" measurement entry is the delimiter between soft
    boots.

    Link: http://lkml.kernel.org/r/1480554346-29071-4-git-send-email-zohar@linux.vnet.ibm.com
    Signed-off-by: Mimi Zohar
    Acked-by: Dmitry Kasatkin
    Cc: Thiago Jung Bauermann
    Cc: "Eric W. Biederman"
    Cc: Andreas Steffen
    Cc: Josh Sklar
    Cc: Dave Young
    Cc: Vivek Goyal
    Cc: Baoquan He
    Cc: Michael Ellerman
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Cc: Stewart Smith
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mimi Zohar
     
  • The TPM PCRs are only reset on a hard reboot. In order to validate a
    TPM's quote after a soft reboot (eg. kexec -e), the IMA measurement
    list of the running kernel must be saved and restored on boot. This
    patch restores the measurement list.

    Link: http://lkml.kernel.org/r/1480554346-29071-3-git-send-email-zohar@linux.vnet.ibm.com
    Signed-off-by: Mimi Zohar
    Acked-by: Dmitry Kasatkin
    Cc: Thiago Jung Bauermann
    Cc: "Eric W. Biederman"
    Cc: Andreas Steffen
    Cc: Josh Sklar
    Cc: Dave Young
    Cc: Vivek Goyal
    Cc: Baoquan He
    Cc: Michael Ellerman
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Cc: Stewart Smith
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mimi Zohar
     

17 Dec, 2016

1 commit

  • Pull vfs updates from Al Viro:

    - more ->d_init() stuff (work.dcache)

    - pathname resolution cleanups (work.namei)

    - a few missing iov_iter primitives - copy_from_iter_full() and
    friends. Either copy the full requested amount, advance the iterator
    and return true, or fail, return false and do _not_ advance the
    iterator. Quite a few open-coded callers converted (and became more
    readable and harder to fuck up that way) (work.iov_iter)

    - several assorted patches, the big one being logfs removal

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
    logfs: remove from tree
    vfs: fix put_compat_statfs64() does not handle errors
    namei: fold should_follow_link() with the step into not-followed link
    namei: pass both WALK_GET and WALK_MORE to should_follow_link()
    namei: invert WALK_PUT logics
    namei: shift interpretation of LOOKUP_FOLLOW inside should_follow_link()
    namei: saner calling conventions for mountpoint_last()
    namei.c: get rid of user_path_parent()
    switch getfrag callbacks to ..._full() primitives
    make skb_add_data,{_nocache}() and skb_copy_to_page_nocache() advance only on success
    [iov_iter] new primitives - copy_from_iter_full() and friends
    don't open-code file_inode()
    ceph: switch to use of ->d_init()
    ceph: unify dentry_operations instances
    lustre: switch to use of ->d_init()

    Linus Torvalds
     

15 Dec, 2016

5 commits

  • Al Viro
     
  • Merge more updates from Andrew Morton:

    - a few misc things

    - kexec updates

    - DMA-mapping updates to better support networking DMA operations

    - IPC updates

    - various MM changes to improve DAX fault handling

    - lots of radix-tree changes, mainly to the test suite. All leading up
    to reimplementing the IDA/IDR code to be a wrapper layer over the
    radix-tree. However the final trigger-pulling patch is held off for
    4.11.

    * emailed patches from Andrew Morton : (114 commits)
    radix tree test suite: delete unused rcupdate.c
    radix tree test suite: add new tag check
    radix-tree: ensure counts are initialised
    radix tree test suite: cache recently freed objects
    radix tree test suite: add some more functionality
    idr: reduce the number of bits per level from 8 to 6
    rxrpc: abstract away knowledge of IDR internals
    tpm: use idr_find(), not idr_find_slowpath()
    idr: add ida_is_empty
    radix tree test suite: check multiorder iteration
    radix-tree: fix replacement for multiorder entries
    radix-tree: add radix_tree_split_preload()
    radix-tree: add radix_tree_split
    radix-tree: add radix_tree_join
    radix-tree: delete radix_tree_range_tag_if_tagged()
    radix-tree: delete radix_tree_locate_item()
    radix-tree: improve multiorder iterators
    btrfs: fix race in btrfs_free_dummy_fs_info()
    radix-tree: improve dump output
    radix-tree: make radix_tree_find_next_bit more useful
    ...

    Linus Torvalds
     
  • Patch series "mm: unexport __get_user_pages_unlocked()".

    This patch series continues the cleanup of get_user_pages*() functions
    taking advantage of the fact we can now pass gup_flags as we please.

    It firstly adds an additional 'locked' parameter to
    get_user_pages_remote() to allow for its callers to utilise
    VM_FAULT_RETRY functionality. This is necessary as the invocation of
    __get_user_pages_unlocked() in process_vm_rw_single_vec() makes use of
    this and no other existing higher level function would allow it to do
    so.

    Secondly existing callers of __get_user_pages_unlocked() are replaced
    with the appropriate higher-level replacement -
    get_user_pages_unlocked() if the current task and memory descriptor are
    referenced, or get_user_pages_remote() if other task/memory descriptors
    are referenced (having acquiring mmap_sem.)

    This patch (of 2):

    Add a int *locked parameter to get_user_pages_remote() to allow
    VM_FAULT_RETRY faulting behaviour similar to get_user_pages_[un]locked().

    Taking into account the previous adjustments to get_user_pages*()
    functions allowing for the passing of gup_flags, we are now in a
    position where __get_user_pages_unlocked() need only be exported for his
    ability to allow VM_FAULT_RETRY behaviour, this adjustment allows us to
    subsequently unexport __get_user_pages_unlocked() as well as allowing
    for future flexibility in the use of get_user_pages_remote().

    [sfr@canb.auug.org.au: merge fix for get_user_pages_remote API change]
    Link: http://lkml.kernel.org/r/20161122210511.024ec341@canb.auug.org.au
    Link: http://lkml.kernel.org/r/20161027095141.2569-2-lstoakes@gmail.com
    Signed-off-by: Lorenzo Stoakes
    Acked-by: Michal Hocko
    Cc: Jan Kara
    Cc: Hugh Dickins
    Cc: Dave Hansen
    Cc: Rik van Riel
    Cc: Mel Gorman
    Cc: Paolo Bonzini
    Cc: Radim Krcmar
    Signed-off-by: Stephen Rothwell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Lorenzo Stoakes
     
  • Pull namespace updates from Eric Biederman:
    "After a lot of discussion and work we have finally reachanged a basic
    understanding of what is necessary to make unprivileged mounts safe in
    the presence of EVM and IMA xattrs which the last commit in this
    series reflects. While technically it is a revert the comments it adds
    are important for people not getting confused in the future. Clearing
    up that confusion allows us to seriously work on unprivileged mounts
    of fuse in the next development cycle.

    The rest of the fixes in this set are in the intersection of user
    namespaces, ptrace, and exec. I started with the first fix which
    started a feedback cycle of finding additional issues during review
    and fixing them. Culiminating in a fix for a bug that has been present
    since at least Linux v1.0.

    Potentially these fixes were candidates for being merged during the rc
    cycle, and are certainly backport candidates but enough little things
    turned up during review and testing that I decided they should be
    handled as part of the normal development process just to be certain
    there were not any great surprises when it came time to backport some
    of these fixes"

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace:
    Revert "evm: Translate user/group ids relative to s_user_ns when computing HMAC"
    exec: Ensure mm->user_ns contains the execed files
    ptrace: Don't allow accessing an undumpable mm
    ptrace: Capture the ptracer's creds not PT_PTRACE_CAP
    mm: Add a user_ns owner to mm_struct and fix ptrace permission checks

    Linus Torvalds
     
  • Pull security subsystem updates from James Morris:
    "Generally pretty quiet for this release. Highlights:

    Yama:
    - allow ptrace access for original parent after re-parenting

    TPM:
    - add documentation
    - many bugfixes & cleanups
    - define a generic open() method for ascii & bios measurements

    Integrity:
    - Harden against malformed xattrs

    SELinux:
    - bugfixes & cleanups

    Smack:
    - Remove unnecessary smack_known_invalid label
    - Do not apply star label in smack_setprocattr hook
    - parse mnt opts after privileges check (fixes unpriv DoS vuln)"

    * 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security: (56 commits)
    Yama: allow access for the current ptrace parent
    tpm: adjust return value of tpm_read_log
    tpm: vtpm_proxy: conditionally call tpm_chip_unregister
    tpm: Fix handling of missing event log
    tpm: Check the bios_dir entry for NULL before accessing it
    tpm: return -ENODEV if np is not set
    tpm: cleanup of printk error messages
    tpm: replace of_find_node_by_name() with dev of_node property
    tpm: redefine read_log() to handle ACPI/OF at runtime
    tpm: fix the missing .owner in tpm_bios_measurements_ops
    tpm: have event log use the tpm_chip
    tpm: drop tpm1_chip_register(/unregister)
    tpm: replace dynamically allocated bios_dir with a static array
    tpm: replace symbolic permission with octal for securityfs files
    char: tpm: fix kerneldoc tpm2_unseal_trusted name typo
    tpm_tis: Allow tpm_tis to be bound using DT
    tpm, tpm_vtpm_proxy: add kdoc comments for VTPM_PROXY_IOC_NEW_DEV
    tpm: Only call pm_runtime_get_sync if device has a parent
    tpm: define a generic open() method for ascii & bios measurements
    Documentation: tpm: add the Physical TPM device tree binding documentation
    ...

    Linus Torvalds
     

13 Dec, 2016

1 commit

  • Pull timer updates from Thomas Gleixner:
    "The time/timekeeping/timer folks deliver with this update:

    - Fix a reintroduced signed/unsigned issue and cleanup the whole
    signed/unsigned mess in the timekeeping core so this wont happen
    accidentaly again.

    - Add a new trace clock based on boot time

    - Prevent injection of random sleep times when PM tracing abuses the
    RTC for storage

    - Make posix timers configurable for real tiny systems

    - Add tracepoints for the alarm timer subsystem so timer based
    suspend wakeups can be instrumented

    - The usual pile of fixes and updates to core and drivers"

    * 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (23 commits)
    timekeeping: Use mul_u64_u32_shr() instead of open coding it
    timekeeping: Get rid of pointless typecasts
    timekeeping: Make the conversion call chain consistently unsigned
    timekeeping_Force_unsigned_clocksource_to_nanoseconds_conversion
    alarmtimer: Add tracepoints for alarm timers
    trace: Update documentation for mono, mono_raw and boot clock
    trace: Add an option for boot clock as trace clock
    timekeeping: Add a fast and NMI safe boot clock
    timekeeping/clocksource_cyc2ns: Document intended range limitation
    timekeeping: Ignore the bogus sleep time if pm_trace is enabled
    selftests/timers: Fix spelling mistake "Asyncrhonous" -> "Asynchronous"
    clocksource/drivers/bcm2835_timer: Unmap region obtained by of_iomap
    clocksource/drivers/arm_arch_timer: Map frame with of_io_request_and_map()
    arm64: dts: rockchip: Arch counter doesn't tick in system suspend
    clocksource/drivers/arm_arch_timer: Don't assume clock runs in suspend
    posix-timers: Make them configurable
    posix_cpu_timers: Move the add_device_randomness() call to a proper place
    timer: Move sys_alarm from timer.c to itimer.c
    ptp_clock: Allow for it to be optional
    Kconfig: Regenerate *.c_shipped files after previous changes
    ...

    Linus Torvalds
     

06 Dec, 2016

1 commit

  • copy_from_iter_full(), copy_from_iter_full_nocache() and
    csum_and_copy_from_iter_full() - counterparts of copy_from_iter()
    et.al., advancing iterator only in case of successful full copy
    and returning whether it had been successful or not.

    Convert some obvious users. *NOTE* - do not blindly assume that
    something is a good candidate for those unless you are sure that
    not advancing iov_iter in failure case is the right thing in
    this case. Anything that does short read/short write kind of
    stuff (or is in a loop, etc.) is unlikely to be a good one.

    Signed-off-by: Al Viro

    Al Viro
     

05 Dec, 2016

2 commits

  • Under ptrace_scope=1, it's possible to have a tracee that is already
    ptrace-attached, but is no longer a direct descendant. For instance, a
    forking daemon will be re-parented to init, losing its ancestry to the
    tracer that launched it.

    The tracer can continue using ptrace in that state, but it will be
    denied other accesses that check PTRACE_MODE_ATTACH, like process_vm_rw
    and various procfs files. There's no reason to prevent such access for
    a tracer that already has ptrace control anyway.

    This patch adds a case to ptracer_exception_found to allow access for
    any task in the same thread group as the current ptrace parent.

    Signed-off-by: Josh Stone
    Cc: Kees Cook
    Cc: James Morris
    Cc: "Serge E. Hallyn"
    Cc: linux-security-module@vger.kernel.org
    Signed-off-by: Kees Cook
    Signed-off-by: James Morris

    Josh Stone
     
  • Signed-off-by: Al Viro

    Al Viro
     

03 Dec, 2016

1 commit

  • This reverts commit 0b3c9761d1e405514a551ed24d3ea89aea26ce14.

    Seth Forshee writes:
    > All right, I think 0b3c9761d1e405514a551ed24d3ea89aea26ce14 should be
    > reverted then. EVM is a machine-local integrity mechanism, and so it
    > makes sense that the signature would be based on the kernel's notion of
    > the uid and not the filesystem's.

    I added a commment explaining why the EVM hmac needs to be in the
    kernel's notion of uid and gid, not the filesystems to prevent
    remounting the filesystem and gaining unwaranted trust in files.

    Acked-by: Seth Forshee
    Signed-off-by: "Eric W. Biederman"

    Eric W. Biederman
     

24 Nov, 2016

1 commit


23 Nov, 2016

2 commits

  • James Morris
     
  • Convert isec->lock from a mutex into a spinlock. Instead of holding
    the lock while sleeping in inode_doinit_with_dentry, set
    isec->initialized to LABEL_PENDING and release the lock. Then, when
    the sid has been determined, re-acquire the lock. If isec->initialized
    is still set to LABEL_PENDING, set isec->sid; otherwise, the sid has
    been set by another task (LABEL_INITIALIZED) or invalidated
    (LABEL_INVALID) in the meantime.

    This fixes a deadlock on gfs2 where

    * one task is in inode_doinit_with_dentry -> gfs2_getxattr, holds
    isec->lock, and tries to acquire the inode's glock, and

    * another task is in do_xmote -> inode_go_inval ->
    selinux_inode_invalidate_secctx, holds the inode's glock, and
    tries to acquire isec->lock.

    Signed-off-by: Andreas Gruenbacher
    [PM: minor tweaks to keep checkpatch.pl happy]
    Signed-off-by: Paul Moore

    Andreas Gruenbacher
     

22 Nov, 2016

2 commits

  • James Morris
     
  • When a new capability is defined, SELinux needs to be updated.
    Trigger a build error if a new capability is defined without
    corresponding update to security/selinux/include/classmap.h's
    COMMON_CAP2_PERMS. This is similar to BUILD_BUG_ON() guards
    in the SELinux nlmsgtab code to ensure that SELinux tracks
    new netlink message types as needed.

    Note that there is already a similar build guard in
    security/selinux/hooks.c to detect when more than 64
    capabilities are defined, since that will require adding
    a third capability class to SELinux.

    A nicer way to do this would be to extend scripts/selinux/genheaders
    or a similar tool to auto-generate the necessary definitions and code
    for SELinux capability checking from include/uapi/linux/capability.h.
    AppArmor does something similar in its Makefile, although it only
    needs to generate a single table of names. That is left as future
    work.

    Signed-off-by: Stephen Smalley
    [PM: reformat the description to keep checkpatch.pl happy]
    Signed-off-by: Paul Moore

    Stephen Smalley
     

21 Nov, 2016

2 commits

  • After a policy replacement, the task cred may be out of date and need
    to be updated. However change_hat is using the stale profiles from
    the out of date cred resulting in either: a stale profile being applied
    or, incorrect failure when searching for a hat profile as it has been
    migrated to the new parent profile.

    Fixes: 01e2b670aa898a39259bc85c78e3d74820f4d3b6 (failure to find hat)
    Fixes: 898127c34ec03291c86f4ff3856d79e9e18952bc (stale policy being applied)
    Bugzilla: https://bugzilla.suse.com/show_bug.cgi?id=1000287
    Cc: stable@vger.kernel.org
    Signed-off-by: John Johansen
    Signed-off-by: James Morris

    John Johansen
     
  • At present, one can write any signed integer value to
    /sys/fs/selinux/enforce and it will be stored,
    e.g. echo -1 > /sys/fs/selinux/enforce or echo 2 >
    /sys/fs/selinux/enforce. This makes no real difference
    to the kernel, since it only ever cares if it is zero or non-zero,
    but some userspace code compares it with 1 to decide if SELinux
    is enforcing, and this could confuse it. Only a process that is
    already root and is allowed the setenforce permission in SELinux
    policy can write to /sys/fs/selinux/enforce, so this is not considered
    to be a security issue, but it should be fixed.

    Signed-off-by: Stephen Smalley
    Signed-off-by: Paul Moore

    Stephen Smalley
     

16 Nov, 2016

2 commits

  • Some embedded systems have no use for them. This removes about
    25KB from the kernel binary size when configured out.

    Corresponding syscalls are routed to a stub logging the attempt to
    use those syscalls which should be enough of a clue if they were
    disabled without proper consideration. They are: timer_create,
    timer_gettime: timer_getoverrun, timer_settime, timer_delete,
    clock_adjtime, setitimer, getitimer, alarm.

    The clock_settime, clock_gettime, clock_getres and clock_nanosleep
    syscalls are replaced by simple wrappers compatible with CLOCK_REALTIME,
    CLOCK_MONOTONIC and CLOCK_BOOTTIME only which should cover the vast
    majority of use cases with very little code.

    Signed-off-by: Nicolas Pitre
    Acked-by: Richard Cochran
    Acked-by: Thomas Gleixner
    Acked-by: John Stultz
    Reviewed-by: Josh Triplett
    Cc: Paul Bolle
    Cc: linux-kbuild@vger.kernel.org
    Cc: netdev@vger.kernel.org
    Cc: Michal Marek
    Cc: Edward Cree
    Link: http://lkml.kernel.org/r/1478841010-28605-7-git-send-email-nicolas.pitre@linaro.org
    Signed-off-by: Thomas Gleixner

    Nicolas Pitre
     
  • The invalid Smack label ("") and the Huh ("?") Smack label
    serve the same purpose and having both is unnecessary.
    While pulling out the invalid label it became clear that
    the use of smack_from_secid() was inconsistent, so that
    is repaired. The setting of inode labels to the invalid
    label could never happen in a functional system, has
    never been observed in the wild and is not what you'd
    really want for a failure behavior in any case. That is
    removed.

    Signed-off-by: Casey Schaufler

    Casey Schaufler
     

15 Nov, 2016

5 commits


14 Nov, 2016

4 commits

  • In general the handling of IMA/EVM xattrs is good, but I found
    a few locations where either the xattr size or the value of the
    type field in the xattr are not checked. Add a few simple checks
    to these locations to prevent malformed or malicious xattrs from
    causing problems.

    Signed-off-by: Seth Forshee
    Signed-off-by: Mimi Zohar

    Seth Forshee
     
  • This patch includes the reason for going into TPM-bypass mode
    and not using the TPM.

    Signed-off-by: Mimi Zohar (zohar@linux.vnet.ibm>

    Mimi Zohar
     
  • Userspace applications have been modified to write security xattrs,
    but they are not context aware. In the case of security.ima, the
    security xattr can be either a file hash or a file signature.
    Permitting writing one, but not the other requires the application to
    be context aware.

    In addition, userspace applications might write files to a staging
    area, which might not be in policy, and then change some file metadata
    (eg. owner) making it in policy. As a result, these files are not
    labeled properly.

    This reverts commit c68ed80c97d9720f51ef31fe91560fdd1e121533, which
    prevents writing file hashes as security.ima xattrs.

    Requested-by: Patrick Ohly
    Cc: Dmitry Kasatkin
    Signed-off-by: Mimi Zohar

    Mimi Zohar
     
  • When the "policy" securityfs file is opened for read, it is opened as a
    sequential file. However, when it is eventually released, there is no
    cleanup for the sequential file, therefore some memory is leaked.

    This patch adds a call to seq_release() in ima_release_policy() to clean up
    the memory when the file is opened for read.

    Fixes: 80eae209d63a IMA: allow reading back the current policy
    Reported-by: Colin Ian King
    Signed-off-by: Eric Richter
    Tested-by: Colin Ian King
    Signed-off-by: Mimi Zohar

    Eric Richter