Skip to content
  1. May 07, 2021
  2. May 05, 2021
  3. May 03, 2021
  4. May 02, 2021
    • Linus Torvalds's avatar
      Merge tag 'landlock_v34' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security · 17ae69ab
      Linus Torvalds authored
      Pull Landlock LSM from James Morris:
       "Add Landlock, a new LSM from Mickaël Salaün.
      
        Briefly, Landlock provides for unprivileged application sandboxing.
      
        From Mickaël's cover letter:
          "The goal of Landlock is to enable to restrict ambient rights (e.g.
           global filesystem access) for a set of processes. Because Landlock
           is a stackable LSM [1], it makes possible to create safe security
           sandboxes as new security layers in addition to the existing
           system-wide access-controls. This kind of sandbox is expected to
           help mitigate the security impact of bugs or unexpected/malicious
           behaviors in user-space applications. Landlock empowers any
           process, including unprivileged ones, to securely restrict
           themselves.
      
           Landlock is inspired by seccomp-bpf but instead of filtering
           syscalls and their raw arguments, a Landlock rule can restrict the
           use of kernel objects like file hierarchies, according to the
           kernel semantic. Landlock also takes inspiration from other OS
           sandbox mechanisms: XNU Sandbox, FreeBSD Capsicum or OpenBSD
           Pledge/Unveil.
      
           In this current form, Landlock misses some access-control features.
           This enables to minimize this patch series and ease review. This
           series still addresses multiple use cases, especially with the
           combined use of seccomp-bpf: applications with built-in sandboxing,
           init systems, security sandbox tools and security-oriented APIs [2]"
      
        The cover letter and v34 posting is here:
      
            https://lore.kernel.org/linux-security-module/20210422154123.13086-1-mic@digikod.net/
      
        See also:
      
            https://landlock.io/
      
        This code has had extensive design discussion and review over several
        years"
      
      Link: https://lore.kernel.org/lkml/50db058a-7dde-441b-a7f9-f6837fe8b69f@schaufler-ca.com/ [1]
      Link: https://lore.kernel.org/lkml/f646e1c7-33cf-333f-070c-0a40ad0468cd@digikod.net/ [2]
      
      * tag 'landlock_v34' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security:
        landlock: Enable user space to infer supported features
        landlock: Add user and kernel documentation
        samples/landlock: Add a sandbox manager example
        selftests/landlock: Add user space tests
        landlock: Add syscall implementations
        arch: Wire up Landlock syscalls
        fs,security: Add sb_delete hook
        landlock: Support filesystem access-control
        LSM: Infrastructure management of the superblock
        landlock: Add ptrace restrictions
        landlock: Set up the security framework and manage credentials
        landlock: Add ruleset and domain management
        landlock: Add object management
      17ae69ab
    • Linus Torvalds's avatar
      Merge tag 'integrity-v5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-integrity · e6f0bf09
      Linus Torvalds authored
      Pull IMA updates from Mimi Zohar:
       "In addition to loading the kernel module signing key onto the builtin
        keyring, load it onto the IMA keyring as well.
      
        Also six trivial changes and bug fixes"
      
      * tag 'integrity-v5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-integrity:
        ima: ensure IMA_APPRAISE_MODSIG has necessary dependencies
        ima: Fix fall-through warnings for Clang
        integrity: Add declarations to init_once void arguments.
        ima: Fix function name error in comment.
        ima: enable loading of build time generated key on .ima keyring
        ima: enable signing of modules with build time generated key
        keys: cleanup build time module signing keys
        ima: Fix the error code for restoring the PCR value
        ima: without an IMA policy loaded, return quickly
      e6f0bf09
    • Linus Torvalds's avatar
      Merge tag 'perf-tools-for-v5.13-2021-04-29' of... · 10a3efd0
      Linus Torvalds authored
      Merge tag 'perf-tools-for-v5.13-2021-04-29' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux
      
      Pull perf tool updates from Arnaldo Carvalho de Melo:
       "perf stat:
      
         - Add support for hybrid PMUs to support systems such as Intel
           Alderlake and its BIG/little core/atom cpus.
      
         - Introduce 'bperf' to share hardware PMCs with BPF.
      
         - New --iostat option to collect and present IO stats on Intel
           hardware.
      
           This functionality is based on recently introduced sysfs attributes
           for Intel® Xeon® Scalable processor family (code name Skylake-SP)
           in commit bb42b3d3 ("perf/x86/intel/uncore: Expose an Uncore
           unit to IIO PMON mapping")
      
           It is intended to provide four I/O performance metrics in MB per
           each PCIe root port:
      
             - Inbound Read: I/O devices below root port read from the host memory
             - Inbound Write: I/O devices below root port write to the host memory
             - Outbound Read: CPU reads from I/O devices below root port
             - Outbound Write: CPU writes to I/O devices below root port
      
         - Align CSV output for summary.
      
         - Clarify --null use cases: Assess raw overhead of 'perf stat' or
           measure just wall clock time.
      
         - Improve readability of shadow stats.
      
        perf record:
      
         - Change the COMM when starting tha workload so that --exclude-perf
           doesn't seem to be not honoured.
      
         - Improve 'Workload failed' message printing events + what was
           exec'ed.
      
         - Fix cross-arch support for TIME_CONV.
      
        perf report:
      
         - Add option to disable raw event ordering.
      
         - Dump the contents of PERF_RECORD_TIME_CONV in 'perf report -D'.
      
         - Improvements to --stat output, that shows information about
           PERF_RECORD_ events.
      
         - Preserve identifier id in OCaml demangler.
      
        perf annotate:
      
         - Show full source location with 'l' hotkey in the 'perf annotate'
           TUI.
      
         - Add line number like in TUI and source location at EOL to the 'perf
           annotate' --stdio mode.
      
         - Add --demangle and --demangle-kernel to 'perf annotate'.
      
         - Allow configuring annotate.demangle{,_kernel} in 'perf config'.
      
         - Fix sample events lost in stdio mode.
      
        perf data:
      
         - Allow converting a perf.data file to JSON.
      
        libperf:
      
         - Add support for user space counter access.
      
         - Update topdown documentation to permit rdpmc calls.
      
        perf test:
      
         - Add 'perf test' for 'perf stat' CSV output.
      
         - Add 'perf test' entries to test the hybrid PMU support.
      
         - Cleanup 'perf test daemon' if its 'perf test' is interrupted.
      
         - Handle metric reuse in pmu-events parsing 'perf test' entry.
      
         - Add test for PE executable support.
      
         - Add timeout for wait for daemon start in its 'perf test' entries.
      
        Build:
      
         - Enable libtraceevent dynamic linking.
      
         - Improve feature detection output.
      
         - Fix caching of feature checks caching.
      
         - First round of updates for tools copies of kernel headers.
      
         - Enable warnings when compiling BPF programs.
      
        Vendor specific events:
      
         - Intel:
            - Add missing skylake & icelake model numbers.
      
         - arm64:
            - Add Hisi hip08 L1, L2 and L3 metrics.
            - Add Fujitsu A64FX PMU events.
      
         - PowerPC:
            - Initial JSON/events list for power10 platform.
            - Remove unsupported power9 metrics.
      
         - AMD:
            - Add Zen3 events.
            - Fix broken L2 Cache Hits from L2 HWPF metric.
            - Use lowercases for all the eventcodes and umasks.
      
        Hardware tracing:
      
         - arm64:
            - Update CoreSight ETM metadata format.
            - Fix bitmap for CS-ETM option.
            - Support PID tracing in config.
            - Detect pid in VMID for kernel running at EL2.
      
        Arch specific updates:
      
         - MIPS:
            - Support MIPS unwinding and dwarf-regs.
            - Generate mips syscalls_n64.c syscall table.
      
         - PowerPC:
            - Add support for PERF_SAMPLE_WEIGH_STRUCT on PowerPC.
            - Support pipeline stage cycles for powerpc.
      
        libbeauty:
      
         - Fix fsconfig generator"
      
      * tag 'perf-tools-for-v5.13-2021-04-29' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux: (132 commits)
        perf build: Defer printing detected features to the end of all feature checks
        tools build: Allow deferring printing the results of feature detection
        perf build: Regenerate the FEATURE_DUMP file after extra feature checks
        perf session: Dump PERF_RECORD_TIME_CONV event
        perf session: Add swap operation for event TIME_CONV
        perf jit: Let convert_timestamp() to be backwards-compatible
        perf tools: Change fields type in perf_record_time_conv
        perf tools: Enable libtraceevent dynamic linking
        perf Documentation: Document intel-hybrid support
        perf tests: Skip 'perf stat metrics (shadow stat) test' for hybrid
        perf tests: Support 'Convert perf time to TSC' test for hybrid
        perf tests: Support 'Session topology' test for hybrid
        perf tests: Support 'Parse and process metrics' test for hybrid
        perf tests: Support 'Track with sched_switch' test for hybrid
        perf tests: Skip 'Setup struct perf_event_attr' test for hybrid
        perf tests: Add hybrid cases for 'Roundtrip evsel->name' test
        perf tests: Add hybrid cases for 'Parse event definition strings' test
        perf record: Uniquify hybrid event name
        perf stat: Warn group events from different hybrid PMU
        perf stat: Filter out unmatched aggregation for hybrid event
        ...
      10a3efd0
    • David Howells's avatar
      afs: Fix speculative status fetches · 22650f14
      David Howells authored
      The generic/464 xfstest causes kAFS to emit occasional warnings of the
      form:
      
              kAFS: vnode modified {100055:8a} 30->31 YFS.StoreData64 (c=6015)
      
      This indicates that the data version received back from the server did not
      match the expected value (the DV should be incremented monotonically for
      each individual modification op committed to a vnode).
      
      What is happening is that a lookup call is doing a bulk status fetch
      speculatively on a bunch of vnodes in a directory besides getting the
      status of the vnode it's actually interested in.  This is racing with a
      StoreData operation (though it could also occur with, say, a MakeDir op).
      
      On the client, a modification operation locks the vnode, but the bulk
      status fetch only locks the parent directory, so no ordering is imposed
      there (thereby avoiding an avenue to deadlock).
      
      On the server, the StoreData op handler doesn't lock the vnode until it's
      received all the request data, and downgrades the lock after committing the
      data until it has finished sending change notifications to other clients -
      which allows the status fetch to occur before it has finished.
      
      This means that:
      
       - a status fetch can access the target vnode either side of the exclusive
         section of the modification
      
       - the status fetch could start before the modification, yet finish after,
         and vice-versa.
      
       - the status fetch and the modification RPCs can complete in either order.
      
       - the status fetch can return either the before or the after DV from the
         modification.
      
       - the status fetch might regress the locally cached DV.
      
      Some of these are handled by the previous fix[1], but that's not sufficient
      because it checks the DV it received against the DV it cached at the start
      of the op, but the DV might've been updated in the meantime by a locally
      generated modification op.
      
      Fix this by the following means:
      
       (1) Keep track of when we're performing a modification operation on a
           vnode.  This is done by marking vnode parameters with a 'modification'
           note that causes the AFS_VNODE_MODIFYING flag to be set on the vnode
           for the duration.
      
       (2) Alter the speculation race detection to ignore speculative status
           fetches if either the vnode is marked as being modified or the data
           version number is not what we expected.
      
      Note that whilst the "vnode modified" warning does get recovered from as it
      causes the client to refetch the status at the next opportunity, it will
      also invalidate the pagecache, so changes might get lost.
      
      Fixes: a9e5c87c
      
       ("afs: Fix speculative status fetch going out of order wrt to modifications")
      Reported-by: default avatarMarc Dionne <marc.dionne@auristor.com>
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Tested-and-reviewed-by: default avatarMarc Dionne <marc.dionne@auristor.com>
      cc: linux-afs@lists.infradead.org
      Link: https://lore.kernel.org/r/160605082531.252452.14708077925602709042.stgit@warthog.procyon.org.uk/ [1]
      Link: https://lore.kernel.org/linux-fsdevel/161961335926.39335.2552653972195467566.stgit@warthog.procyon.org.uk/
      
       # v1
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      22650f14