14 Mar, 2021

1 commit

  • There's a runtime failure when running HW_TAGS-enabled kernel built with
    GCC on hardware that doesn't support MTE. GCC-built kernels always have
    CONFIG_KASAN_STACK enabled, even though stack instrumentation isn't
    supported by HW_TAGS. Having that config enabled causes KASAN to issue
    MTE-only instructions to unpoison kernel stacks, which causes the failure.

    Fix the issue by disallowing CONFIG_KASAN_STACK when HW_TAGS is used.

    (The commit that introduced CONFIG_KASAN_HW_TAGS specified proper
    dependency for CONFIG_KASAN_STACK_ENABLE but not for CONFIG_KASAN_STACK.)

    Link: https://lkml.kernel.org/r/59e75426241dbb5611277758c8d4d6f5f9298dac.1615215441.git.andreyknvl@google.com
    Fixes: 6a63a63ff1ac ("kasan: introduce CONFIG_KASAN_HW_TAGS")
    Signed-off-by: Andrey Konovalov
    Reported-by: Catalin Marinas
    Cc:
    Cc: Will Deacon
    Cc: Vincenzo Frascino
    Cc: Dmitry Vyukov
    Cc: Andrey Ryabinin
    Cc: Alexander Potapenko
    Cc: Marco Elver
    Cc: Peter Collingbourne
    Cc: Evgenii Stepanov
    Cc: Branislav Rankov
    Cc: Kevin Brodsky
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrey Konovalov
     

09 Mar, 2021

1 commit

  • Pull sparc updates from David Miller:
    "Just some more random bits from Al, including a conversion over to
    generic extables"

    * git://git.kernel.org:/pub/scm/linux/kernel/git/davem/sparc:
    sparc32: take ->thread.flags out
    sparc32: get rid of fake_swapper_regs
    sparc64: get rid of fake_swapper_regs
    sparc32: switch to generic extables
    sparc32: switch copy_user.S away from range exception table entries
    sparc32: get rid of range exception table entries in checksum_32.S
    sparc32: switch __bzero() away from range exception table entries
    sparc32: kill lookup_fault()
    sparc32: don't bother with lookup_fault() in __bzero()

    Linus Torvalds
     

02 Mar, 2021

1 commit

  • Pull kmap conversion updates from David Sterba:
    "This contains changes regarding kmap API use and eg conversion from
    kmap_atomic to kmap_local_page.

    The API belongs to memory management but to save cross-tree
    dependency headaches we've agreed to take it through the btrfs tree
    because there are some trivial conversions possible, while the rest
    will need some time and getting the easy cases out of the way would be
    convenient.

    The changes can be grouped:

    - function exports, new helpers

    - new VM_BUG_ON for additional verification; it's been discussed if
    it should be VM_BUG_ON or BUG_ON, the former was chosen due to
    performance reasons

    - code replaced by relevant helpers"

    [ This is an updated version of a request that originally came in during
    the merge window, but I asked for some updates:

    https://lore.kernel.org/lkml/cover.1614090658.git.dsterba@suse.com/

    which is why this got merge after the merge window closed. - Linus ]

    * 'kmap-conversion-for-5.12' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux:
    btrfs: use copy_highpage() instead of 2 kmaps()
    btrfs: use memcpy_[to|from]_page() and kmap_local_page()
    mm/highmem: Add VM_BUG_ON() to mem*_page() calls
    mm/highmem: Introduce memcpy_page(), memmove_page(), and memset_page()
    mm/highmem: Convert memcpy_[to|from]_page() to kmap_local_page()
    mm/highmem: Lift memcpy_[to|from]_page to core

    Linus Torvalds
     

27 Feb, 2021

13 commits

  • David S. Miller
     
  • Since GCC 8.0 -fsanitize=signed-integer-overflow doesn't work with
    -fwrapv. -fwrapv makes signed overflows defines and GCC essentially
    disables ubsan checks. On GCC < 8.0 -fwrapv doesn't have influence on
    -fsanitize=signed-integer-overflow setting, so it kinda works but
    generates false-positves and violates uaccess rules:

    lib/iov_iter.o: warning: objtool: iovec_from_user()+0x22d: call to
    __ubsan_handle_add_overflow() with UACCESS enabled

    Disable signed overflow checks to avoid these problems. Remove unsigned
    overflow checks as well. Unsigned overflow appeared as side effect of
    commit cdf8a76fda4a ("ubsan: move cc-option tests into Kconfig"), but it
    never worked (kernel doesn't boot). And unsigned overflows are allowed by
    C standard, so it just pointless.

    Link: https://lkml.kernel.org/r/20210209232348.20510-1-ryabinin.a.a@gmail.com
    Signed-off-by: Andrey Ryabinin
    Acked-by: Peter Zijlstra (Intel)
    Cc: Josh Poimboeuf
    Cc: Randy Dunlap
    Cc: Stephen Rothwell
    Cc: Dmitry Vyukov
    Cc: Kees Cook
    Cc: Alexander Viro
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrey Ryabinin
     
  • The local variable 'next' is unneeded because you can simply advance the
    existing pointer 'args'.

    Link: https://lkml.kernel.org/r/20210201014707.3828753-1-masahiroy@kernel.org
    Signed-off-by: Masahiro Yamada
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Masahiro Yamada
     
  • Fix the below ignoring return value warning for kstrtobool in
    is_stack_depot_disabled function.

    lib/stackdepot.c: In function 'is_stack_depot_disabled':
    lib/stackdepot.c:154:2: warning: ignoring return value of 'kstrtobool'
    declared with attribute 'warn_unused_result' [-Wunused-result]

    Link: https://lkml.kernel.org/r/1612163048-28026-1-git-send-email-vjitta@codeaurora.org
    Fixes: b9779abb09a8 ("lib: stackdepot: add support to disable stack depot")
    Signed-off-by: Vijayanand Jitta
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Vijayanand Jitta
     
  • Add a kernel parameter stack_depot_disable to disable stack depot. So
    that stack hash table doesn't consume any memory when stack depot is
    disabled.

    The use case is CONFIG_PAGE_OWNER without page_owner=on. Without this
    patch, stackdepot will consume the memory for the hashtable. By default,
    it's 8M which is never trivial.

    With this option, in CONFIG_PAGE_OWNER configured system, page_owner=off,
    stack_depot_disable in kernel command line, we could save the wasted
    memory for the hashtable.

    [akpm@linux-foundation.org: fix CONFIG_STACKDEPOT=n build]

    Link: https://lkml.kernel.org/r/1611749198-24316-2-git-send-email-vjitta@codeaurora.org
    Signed-off-by: Vinayak Menon
    Signed-off-by: Vijayanand Jitta
    Cc: Alexander Potapenko
    Cc: Minchan Kim
    Cc: Yogesh Lal
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Vijayanand Jitta
     
  • Use CONFIG_STACK_HASH_ORDER to configure STACK_HASH_SIZE.

    Aim is to have configurable value for STACK_HASH_SIZE,
    so depend on use case one can configure it.

    One example is of Page Owner, CONFIG_PAGE_OWNER works only if
    page_owner=on via kernel parameter on CONFIG_PAGE_OWNER configured system.
    Thus, unless admin enable it via command line option, the stackdepot will
    just waste 8M memory without any customer.

    Making it configurable and use lower value helps to enable features like
    CONFIG_PAGE_OWNER without any significant overhead.

    Link: https://lkml.kernel.org/r/1611749198-24316-1-git-send-email-vjitta@codeaurora.org
    Signed-off-by: Yogesh Lal
    Signed-off-by: Vinayak Menon
    Signed-off-by: Vijayanand Jitta
    Reviewed-by: Minchan Kim
    Reviewed-by: Alexander Potapenko
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Yogesh Lal
     
  • Just as bitmap_clear_ll(), change return type to unsigned long
    for bitmap_set_ll to avoid the possible overflow in future.

    Link: https://lkml.kernel.org/r/20210105031644.2771-1-sjhuang@iluvatar.ai
    Signed-off-by: Huang Shijie
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Huang Shijie
     
  • Currently, if krealloc() is called on a freed object with KASAN enabled,
    it allocates and returns a new object, but doesn't copy any memory from
    the old one as ksize() returns 0. This makes the caller believe that
    krealloc() succeeded (KASAN report is printed though).

    This patch adds an accessibility check into __do_krealloc(). If the check
    fails, krealloc() returns NULL. This check duplicates the one in ksize();
    this is fixed in the following patch.

    This patch also adds a KASAN-KUnit test to check krealloc() behaviour when
    it's called on a freed object.

    Link: https://lkml.kernel.org/r/cbcf7b02be0a1ca11de4f833f2ff0b3f2c9b00c8.1612546384.git.andreyknvl@google.com
    Signed-off-by: Andrey Konovalov
    Reviewed-by: Marco Elver
    Cc: Alexander Potapenko
    Cc: Andrey Ryabinin
    Cc: Branislav Rankov
    Cc: Catalin Marinas
    Cc: Dmitry Vyukov
    Cc: Evgenii Stepanov
    Cc: Kevin Brodsky
    Cc: Peter Collingbourne
    Cc: Vincenzo Frascino
    Cc: Will Deacon
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrey Konovalov
     
  • This patch reworks KASAN-KUnit tests for krealloc() to:

    1. Check both slab and page_alloc based krealloc() implementations.
    2. Allow at least one full granule to fit between old and new sizes for
    each KASAN mode, and check accesses to that granule accordingly.

    Link: https://lkml.kernel.org/r/c707f128a2bb9f2f05185d1eb52192cf179cf4fa.1612546384.git.andreyknvl@google.com
    Signed-off-by: Andrey Konovalov
    Reviewed-by: Marco Elver
    Cc: Alexander Potapenko
    Cc: Andrey Ryabinin
    Cc: Branislav Rankov
    Cc: Catalin Marinas
    Cc: Dmitry Vyukov
    Cc: Evgenii Stepanov
    Cc: Kevin Brodsky
    Cc: Peter Collingbourne
    Cc: Vincenzo Frascino
    Cc: Will Deacon
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrey Konovalov
     
  • Add KFENCE test suite, testing various error detection scenarios. Makes
    use of KUnit for test organization. Since KFENCE's interface to obtain
    error reports is via the console, the test verifies that KFENCE outputs
    expected reports to the console.

    [elver@google.com: fix typo in test]
    Link: https://lkml.kernel.org/r/X9lHQExmHGvETxY4@elver.google.com
    [elver@google.com: show access type in report]
    Link: https://lkml.kernel.org/r/20210111091544.3287013-2-elver@google.com

    Link: https://lkml.kernel.org/r/20201103175841.3495947-9-elver@google.com
    Signed-off-by: Alexander Potapenko
    Signed-off-by: Marco Elver
    Reviewed-by: Dmitry Vyukov
    Co-developed-by: Alexander Potapenko
    Reviewed-by: Jann Horn
    Cc: Andrey Konovalov
    Cc: Andrey Ryabinin
    Cc: Andy Lutomirski
    Cc: Borislav Petkov
    Cc: Catalin Marinas
    Cc: Christopher Lameter
    Cc: Dave Hansen
    Cc: David Rientjes
    Cc: Eric Dumazet
    Cc: Greg Kroah-Hartman
    Cc: Hillf Danton
    Cc: "H. Peter Anvin"
    Cc: Ingo Molnar
    Cc: Joern Engel
    Cc: Jonathan Corbet
    Cc: Joonsoo Kim
    Cc: Kees Cook
    Cc: Mark Rutland
    Cc: Paul E. McKenney
    Cc: Pekka Enberg
    Cc: Peter Zijlstra
    Cc: SeongJae Park
    Cc: Thomas Gleixner
    Cc: Vlastimil Babka
    Cc: Will Deacon
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Marco Elver
     
  • Add KFENCE documentation in dev-tools/kfence.rst, and add to index.

    [elver@google.com: add missing copyright header to documentation]
    Link: https://lkml.kernel.org/r/20210118092159.145934-4-elver@google.com

    Link: https://lkml.kernel.org/r/20201103175841.3495947-8-elver@google.com
    Signed-off-by: Alexander Potapenko
    Signed-off-by: Marco Elver
    Reviewed-by: Dmitry Vyukov
    Co-developed-by: Alexander Potapenko
    Reviewed-by: Jann Horn
    Cc: Andrey Konovalov
    Cc: Andrey Ryabinin
    Cc: Andy Lutomirski
    Cc: Borislav Petkov
    Cc: Catalin Marinas
    Cc: Christopher Lameter
    Cc: Dave Hansen
    Cc: David Rientjes
    Cc: Eric Dumazet
    Cc: Greg Kroah-Hartman
    Cc: Hillf Danton
    Cc: "H. Peter Anvin"
    Cc: Ingo Molnar
    Cc: Joern Engel
    Cc: Jonathan Corbet
    Cc: Joonsoo Kim
    Cc: Kees Cook
    Cc: Mark Rutland
    Cc: Paul E. McKenney
    Cc: Pekka Enberg
    Cc: Peter Zijlstra
    Cc: SeongJae Park
    Cc: Thomas Gleixner
    Cc: Vlastimil Babka
    Cc: Will Deacon
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Marco Elver
     
  • Make KFENCE compatible with KASAN. Currently this helps test KFENCE
    itself, where KASAN can catch potential corruptions to KFENCE state, or
    other corruptions that may be a result of freepointer corruptions in the
    main allocators.

    [akpm@linux-foundation.org: merge fixup]
    [andreyknvl@google.com: untag addresses for KFENCE]
    Link: https://lkml.kernel.org/r/9dc196006921b191d25d10f6e611316db7da2efc.1611946152.git.andreyknvl@google.com

    Link: https://lkml.kernel.org/r/20201103175841.3495947-7-elver@google.com
    Signed-off-by: Marco Elver
    Signed-off-by: Alexander Potapenko
    Signed-off-by: Andrey Konovalov
    Reviewed-by: Dmitry Vyukov
    Reviewed-by: Jann Horn
    Co-developed-by: Marco Elver
    Cc: Andrey Konovalov
    Cc: Andrey Ryabinin
    Cc: Andy Lutomirski
    Cc: Borislav Petkov
    Cc: Catalin Marinas
    Cc: Christopher Lameter
    Cc: Dave Hansen
    Cc: David Rientjes
    Cc: Eric Dumazet
    Cc: Greg Kroah-Hartman
    Cc: Hillf Danton
    Cc: "H. Peter Anvin"
    Cc: Ingo Molnar
    Cc: Joern Engel
    Cc: Jonathan Corbet
    Cc: Joonsoo Kim
    Cc: Kees Cook
    Cc: Mark Rutland
    Cc: Paul E. McKenney
    Cc: Pekka Enberg
    Cc: Peter Zijlstra
    Cc: SeongJae Park
    Cc: Thomas Gleixner
    Cc: Vlastimil Babka
    Cc: Will Deacon
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexander Potapenko
     
  • Patch series "KFENCE: A low-overhead sampling-based memory safety error detector", v7.

    This adds the Kernel Electric-Fence (KFENCE) infrastructure. KFENCE is a
    low-overhead sampling-based memory safety error detector of heap
    use-after-free, invalid-free, and out-of-bounds access errors. This
    series enables KFENCE for the x86 and arm64 architectures, and adds
    KFENCE hooks to the SLAB and SLUB allocators.

    KFENCE is designed to be enabled in production kernels, and has near
    zero performance overhead. Compared to KASAN, KFENCE trades performance
    for precision. The main motivation behind KFENCE's design, is that with
    enough total uptime KFENCE will detect bugs in code paths not typically
    exercised by non-production test workloads. One way to quickly achieve a
    large enough total uptime is when the tool is deployed across a large
    fleet of machines.

    KFENCE objects each reside on a dedicated page, at either the left or
    right page boundaries. The pages to the left and right of the object
    page are "guard pages", whose attributes are changed to a protected
    state, and cause page faults on any attempted access to them. Such page
    faults are then intercepted by KFENCE, which handles the fault
    gracefully by reporting a memory access error.

    Guarded allocations are set up based on a sample interval (can be set
    via kfence.sample_interval). After expiration of the sample interval,
    the next allocation through the main allocator (SLAB or SLUB) returns a
    guarded allocation from the KFENCE object pool. At this point, the timer
    is reset, and the next allocation is set up after the expiration of the
    interval.

    To enable/disable a KFENCE allocation through the main allocator's
    fast-path without overhead, KFENCE relies on static branches via the
    static keys infrastructure. The static branch is toggled to redirect the
    allocation to KFENCE.

    The KFENCE memory pool is of fixed size, and if the pool is exhausted no
    further KFENCE allocations occur. The default config is conservative
    with only 255 objects, resulting in a pool size of 2 MiB (with 4 KiB
    pages).

    We have verified by running synthetic benchmarks (sysbench I/O,
    hackbench) and production server-workload benchmarks that a kernel with
    KFENCE (using sample intervals 100-500ms) is performance-neutral
    compared to a non-KFENCE baseline kernel.

    KFENCE is inspired by GWP-ASan [1], a userspace tool with similar
    properties. The name "KFENCE" is a homage to the Electric Fence Malloc
    Debugger [2].

    For more details, see Documentation/dev-tools/kfence.rst added in the
    series -- also viewable here:

    https://raw.githubusercontent.com/google/kasan/kfence/Documentation/dev-tools/kfence.rst

    [1] http://llvm.org/docs/GwpAsan.html
    [2] https://linux.die.net/man/3/efence

    This patch (of 9):

    This adds the Kernel Electric-Fence (KFENCE) infrastructure. KFENCE is a
    low-overhead sampling-based memory safety error detector of heap
    use-after-free, invalid-free, and out-of-bounds access errors.

    KFENCE is designed to be enabled in production kernels, and has near
    zero performance overhead. Compared to KASAN, KFENCE trades performance
    for precision. The main motivation behind KFENCE's design, is that with
    enough total uptime KFENCE will detect bugs in code paths not typically
    exercised by non-production test workloads. One way to quickly achieve a
    large enough total uptime is when the tool is deployed across a large
    fleet of machines.

    KFENCE objects each reside on a dedicated page, at either the left or
    right page boundaries. The pages to the left and right of the object
    page are "guard pages", whose attributes are changed to a protected
    state, and cause page faults on any attempted access to them. Such page
    faults are then intercepted by KFENCE, which handles the fault
    gracefully by reporting a memory access error. To detect out-of-bounds
    writes to memory within the object's page itself, KFENCE also uses
    pattern-based redzones. The following figure illustrates the page
    layout:

    ---+-----------+-----------+-----------+-----------+-----------+---
    | xxxxxxxxx | O : | xxxxxxxxx | : O | xxxxxxxxx |
    | xxxxxxxxx | B : | xxxxxxxxx | : B | xxxxxxxxx |
    | x GUARD x | J : RED- | x GUARD x | RED- : J | x GUARD x |
    | xxxxxxxxx | E : ZONE | xxxxxxxxx | ZONE : E | xxxxxxxxx |
    | xxxxxxxxx | C : | xxxxxxxxx | : C | xxxxxxxxx |
    | xxxxxxxxx | T : | xxxxxxxxx | : T | xxxxxxxxx |
    ---+-----------+-----------+-----------+-----------+-----------+---

    Guarded allocations are set up based on a sample interval (can be set
    via kfence.sample_interval). After expiration of the sample interval, a
    guarded allocation from the KFENCE object pool is returned to the main
    allocator (SLAB or SLUB). At this point, the timer is reset, and the
    next allocation is set up after the expiration of the interval.

    To enable/disable a KFENCE allocation through the main allocator's
    fast-path without overhead, KFENCE relies on static branches via the
    static keys infrastructure. The static branch is toggled to redirect the
    allocation to KFENCE. To date, we have verified by running synthetic
    benchmarks (sysbench I/O, hackbench) that a kernel compiled with KFENCE
    is performance-neutral compared to the non-KFENCE baseline.

    For more details, see Documentation/dev-tools/kfence.rst (added later in
    the series).

    [elver@google.com: fix parameter description for kfence_object_start()]
    Link: https://lkml.kernel.org/r/20201106092149.GA2851373@elver.google.com
    [elver@google.com: avoid stalling work queue task without allocations]
    Link: https://lkml.kernel.org/r/CADYN=9J0DQhizAGB0-jz4HOBBh+05kMBXb4c0cXMS7Qi5NAJiw@mail.gmail.com
    Link: https://lkml.kernel.org/r/20201110135320.3309507-1-elver@google.com
    [elver@google.com: fix potential deadlock due to wake_up()]
    Link: https://lkml.kernel.org/r/000000000000c0645805b7f982e4@google.com
    Link: https://lkml.kernel.org/r/20210104130749.1768991-1-elver@google.com
    [elver@google.com: add option to use KFENCE without static keys]
    Link: https://lkml.kernel.org/r/20210111091544.3287013-1-elver@google.com
    [elver@google.com: add missing copyright and description headers]
    Link: https://lkml.kernel.org/r/20210118092159.145934-1-elver@google.com

    Link: https://lkml.kernel.org/r/20201103175841.3495947-2-elver@google.com
    Signed-off-by: Marco Elver
    Signed-off-by: Alexander Potapenko
    Reviewed-by: Dmitry Vyukov
    Reviewed-by: SeongJae Park
    Co-developed-by: Marco Elver
    Reviewed-by: Jann Horn
    Cc: "H. Peter Anvin"
    Cc: Paul E. McKenney
    Cc: Andrey Konovalov
    Cc: Andrey Ryabinin
    Cc: Andy Lutomirski
    Cc: Borislav Petkov
    Cc: Catalin Marinas
    Cc: Christopher Lameter
    Cc: Dave Hansen
    Cc: David Rientjes
    Cc: Eric Dumazet
    Cc: Greg Kroah-Hartman
    Cc: Hillf Danton
    Cc: Ingo Molnar
    Cc: Jonathan Corbet
    Cc: Joonsoo Kim
    Cc: Joern Engel
    Cc: Kees Cook
    Cc: Mark Rutland
    Cc: Pekka Enberg
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: Vlastimil Babka
    Cc: Will Deacon
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexander Potapenko
     

26 Feb, 2021

2 commits

  • Pull Kbuild updates from Masahiro Yamada:

    - Fix false-positive build warnings for ARCH=ia64 builds

    - Optimize dictionary size for module compression with xz

    - Check the compiler and linker versions in Kconfig

    - Fix misuse of extra-y

    - Support DWARF v5 debug info

    - Clamp SUBLEVEL to 255 because stable releases 4.4.x and 4.9.x
    exceeded the limit

    - Add generic syscall{tbl,hdr}.sh for cleanups across arches

    - Minor cleanups of genksyms

    - Minor cleanups of Kconfig

    * tag 'kbuild-v5.12' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (38 commits)
    initramfs: Remove redundant dependency of RD_ZSTD on BLK_DEV_INITRD
    kbuild: remove deprecated 'always' and 'hostprogs-y/m'
    kbuild: parse C= and M= before changing the working directory
    kbuild: reuse this-makefile to define abs_srctree
    kconfig: unify rule of config, menuconfig, nconfig, gconfig, xconfig
    kconfig: omit --oldaskconfig option for 'make config'
    kconfig: fix 'invalid option' for help option
    kconfig: remove dead code in conf_askvalue()
    kconfig: clean up nested if-conditionals in check_conf()
    kconfig: Remove duplicate call to sym_get_string_value()
    Makefile: Remove # characters from compiler string
    Makefile: reuse CC_VERSION_TEXT
    kbuild: check the minimum linker version in Kconfig
    kbuild: remove ld-version macro
    scripts: add generic syscallhdr.sh
    scripts: add generic syscalltbl.sh
    arch: syscalls: remove $(srctree)/ prefix from syscall tables
    arch: syscalls: add missing FORCE and fix 'targets' to make if_changed work
    gen_compile_commands: prune some directories
    kbuild: simplify access to the kernel's version
    ...

    Linus Torvalds
     
  • Pull PCI updates from Bjorn Helgaas:
    "Enumeration:
    - Remove unnecessary locking around _OSC (Bjorn Helgaas)
    - Clarify message about _OSC failure (Bjorn Helgaas)
    - Remove notification of PCIe bandwidth changes (Bjorn Helgaas)
    - Tidy checking of syscall user config accessors (Heiner Kallweit)

    Resource management:
    - Decline to resize resources if boot config must be preserved (Ard
    Biesheuvel)
    - Fix pci_register_io_range() memory leak (Geert Uytterhoeven)

    Error handling (Keith Busch):
    - Clear error status from the correct device
    - Retain error recovery status so drivers can use it after reset
    - Log the type of Port (Root or Switch Downstream) that we reset
    - Always request a reset for Downstream Ports in frozen state

    Endpoint framework and NTB (Kishon Vijay Abraham I):
    - Make *_get_first_free_bar() take into account 64 bit BAR
    - Add helper API to get the 'next' unreserved BAR
    - Make *_free_bar() return error codes on failure
    - Remove unused pci_epf_match_device()
    - Add support to associate secondary EPC with EPF
    - Add support in configfs to associate two EPCs with EPF
    - Add pci_epc_ops to map MSI IRQ
    - Add pci_epf_ops to expose function-specific attrs
    - Allow user to create sub-directory of 'EPF Device' directory
    - Implement ->msi_map_irq() ops for cadence
    - Configure LM_EP_FUNC_CFG based on epc->function_num_map for cadence
    - Add EP function driver to provide NTB functionality
    - Add support for EPF PCI Non-Transparent Bridge
    - Add specification for PCI NTB function device
    - Add PCI endpoint NTB function user guide
    - Add configfs binding documentation for pci-ntb endpoint function

    Broadcom STB PCIe controller driver:
    - Add support for BCM4908 and external PERST# signal controller
    (Rafał Miłecki)

    Cadence PCIe controller driver:
    - Retrain Link to work around Gen2 training defect (Nadeem Athani)
    - Fix merge botch in cdns_pcie_host_map_dma_ranges() (Krzysztof
    Wilczyński)

    Freescale Layerscape PCIe controller driver:
    - Add LX2160A rev2 EP mode support (Hou Zhiqiang)
    - Convert to builtin_platform_driver() (Michael Walle)

    MediaTek PCIe controller driver:
    - Fix OF node reference leak (Krzysztof Wilczyński)

    Microchip PolarFlare PCIe controller driver:
    - Add Microchip PolarFire PCIe controller driver (Daire McNamara)

    Qualcomm PCIe controller driver:
    - Use PHY_REFCLK_USE_PAD only for ipq8064 (Ansuel Smith)
    - Add support for ddrss_sf_tbu clock for sm8250 (Dmitry Baryshkov)

    Renesas R-Car PCIe controller driver:
    - Drop PCIE_RCAR config option (Lad Prabhakar)
    - Always allocate MSI addresses in 32bit space (Marek Vasut)

    Rockchip PCIe controller driver:
    - Add FriendlyARM NanoPi M4B DT binding (Chen-Yu Tsai)
    - Make 'ep-gpios' DT property optional (Chen-Yu Tsai)

    Synopsys DesignWare PCIe controller driver:
    - Work around ECRC configuration hardware defect (Vidya Sagar)
    - Drop support for config space in DT 'ranges' (Rob Herring)
    - Change size to u64 for EP outbound iATU (Shradha Todi)
    - Add upper limit address for outbound iATU (Shradha Todi)
    - Make dw_pcie ops optional (Jisheng Zhang)
    - Remove unnecessary dw_pcie_ops from al driver (Jisheng Zhang)

    Xilinx Versal CPM PCIe controller driver:
    - Fix OF node reference leak (Pan Bian)

    Miscellaneous:
    - Remove tango host controller driver (Arnd Bergmann)
    - Remove IRQ handler & data together (altera-msi, brcmstb, dwc)
    (Martin Kaiser)
    - Fix xgene-msi race in installing chained IRQ handler (Martin
    Kaiser)
    - Apply CONFIG_PCI_DEBUG to entire drivers/pci hierarchy (Junhao He)
    - Fix pci-bridge-emul array overruns (Russell King)
    - Remove obsolete uses of WARN_ON(in_interrupt()) (Sebastian Andrzej
    Siewior)"

    * tag 'pci-v5.12-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: (69 commits)
    PCI: qcom: Use PHY_REFCLK_USE_PAD only for ipq8064
    PCI: qcom: Add support for ddrss_sf_tbu clock
    dt-bindings: PCI: qcom: Document ddrss_sf_tbu clock for sm8250
    PCI: al: Remove useless dw_pcie_ops
    PCI: dwc: Don't assume the ops in dw_pcie always exist
    PCI: dwc: Add upper limit address for outbound iATU
    PCI: dwc: Change size to u64 for EP outbound iATU
    PCI: dwc: Drop support for config space in 'ranges'
    PCI: layerscape: Convert to builtin_platform_driver()
    PCI: layerscape: Add LX2160A rev2 EP mode support
    dt-bindings: PCI: layerscape: Add LX2160A rev2 compatible strings
    PCI: dwc: Work around ECRC configuration issue
    PCI/portdrv: Report reset for frozen channel
    PCI/AER: Specify the type of Port that was reset
    PCI/ERR: Retain status from error notification
    PCI/AER: Clear AER status from Root Port when resetting Downstream Port
    PCI/ERR: Clear status of the reporting device
    dt-bindings: arm: rockchip: Add FriendlyARM NanoPi M4B
    PCI: rockchip: Make 'ep-gpios' DT property optional
    Documentation: PCI: Add PCI endpoint NTB function user guide
    ...

    Linus Torvalds
     

25 Feb, 2021

12 commits

  • Don't run KASAN tests when it's disabled with kasan.mode=off to avoid
    corrupting kernel memory.

    Link: https://linux-review.googlesource.com/id/I6447af436a69a94bfc35477f6bf4e2122948355e
    Link: https://lkml.kernel.org/r/25bd4fb5cae7b421d806a1f33fb633edd313f0c7.1610733117.git.andreyknvl@google.com
    Signed-off-by: Andrey Konovalov
    Reviewed-by: Marco Elver
    Reviewed-by: Alexander Potapenko
    Cc: Andrey Ryabinin
    Cc: Branislav Rankov
    Cc: Catalin Marinas
    Cc: Dmitry Vyukov
    Cc: Evgenii Stepanov
    Cc: Kevin Brodsky
    Cc: Peter Collingbourne
    Cc: Vincenzo Frascino
    Cc: Will Deacon
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrey Konovalov
     
  • Add a test for kmem_cache_alloc/free_bulk to make sure there are no
    false-positives when these functions are used.

    Link: https://linux-review.googlesource.com/id/I2a8bf797aecf81baeac61380c567308f319e263d
    Link: https://lkml.kernel.org/r/418122ebe4600771ac81e9ca6eab6740cf8dcfa1.1610733117.git.andreyknvl@google.com
    Signed-off-by: Andrey Konovalov
    Reviewed-by: Marco Elver
    Reviewed-by: Alexander Potapenko
    Cc: Andrey Ryabinin
    Cc: Branislav Rankov
    Cc: Catalin Marinas
    Cc: Dmitry Vyukov
    Cc: Evgenii Stepanov
    Cc: Kevin Brodsky
    Cc: Peter Collingbourne
    Cc: Vincenzo Frascino
    Cc: Will Deacon
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrey Konovalov
     
  • The currently existing page allocator tests rely on kmalloc fallback
    with large sizes that is only present for SLUB. Add proper tests that
    use alloc/free_pages().

    Link: https://linux-review.googlesource.com/id/Ia173d5a1b215fe6b2548d814ef0f4433cf983570
    Link: https://lkml.kernel.org/r/a2648930e55ff75b8e700f2e0d905c2b55a67483.1610733117.git.andreyknvl@google.com
    Signed-off-by: Andrey Konovalov
    Reviewed-by: Marco Elver
    Reviewed-by: Alexander Potapenko
    Cc: Andrey Ryabinin
    Cc: Branislav Rankov
    Cc: Catalin Marinas
    Cc: Dmitry Vyukov
    Cc: Evgenii Stepanov
    Cc: Kevin Brodsky
    Cc: Peter Collingbourne
    Cc: Vincenzo Frascino
    Cc: Will Deacon
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrey Konovalov
     
  • The currently existing kasan_check_read/write() annotations are intended
    to be used for kernel modules that have KASAN compiler instrumentation
    disabled. Thus, they are only relevant for the software KASAN modes that
    rely on compiler instrumentation.

    However there's another use case for these annotations: ksize() checks
    that the object passed to it is indeed accessible before unpoisoning the
    whole object. This is currently done via __kasan_check_read(), which is
    compiled away for the hardware tag-based mode that doesn't rely on
    compiler instrumentation. This leads to KASAN missing detecting some
    memory corruptions.

    Provide another annotation called kasan_check_byte() that is available
    for all KASAN modes. As the implementation rename and reuse
    kasan_check_invalid_free(). Use this new annotation in ksize().
    To avoid having ksize() as the top frame in the reported stack trace
    pass _RET_IP_ to __kasan_check_byte().

    Also add a new ksize_uaf() test that checks that a use-after-free is
    detected via ksize() itself, and via plain accesses that happen later.

    Link: https://linux-review.googlesource.com/id/Iaabf771881d0f9ce1b969f2a62938e99d3308ec5
    Link: https://lkml.kernel.org/r/f32ad74a60b28d8402482a38476f02bb7600f620.1610733117.git.andreyknvl@google.com
    Signed-off-by: Andrey Konovalov
    Reviewed-by: Marco Elver
    Reviewed-by: Alexander Potapenko
    Cc: Andrey Ryabinin
    Cc: Branislav Rankov
    Cc: Catalin Marinas
    Cc: Dmitry Vyukov
    Cc: Evgenii Stepanov
    Cc: Kevin Brodsky
    Cc: Peter Collingbourne
    Cc: Vincenzo Frascino
    Cc: Will Deacon
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrey Konovalov
     
  • Since the hardware tag-based KASAN mode might not have a redzone that
    comes after an allocated object (when kasan.mode=prod is enabled), the
    kasan_bitops_tags() test ends up corrupting the next object in memory.

    Change the test so it always accesses the redzone that lies within the
    allocated object's boundaries.

    Link: https://linux-review.googlesource.com/id/I67f51d1ee48f0a8d0fe2658c2a39e4879fe0832a
    Link: https://lkml.kernel.org/r/7d452ce4ae35bb1988d2c9244dfea56cf2cc9315.1610733117.git.andreyknvl@google.com
    Signed-off-by: Andrey Konovalov
    Reviewed-by: Marco Elver
    Reviewed-by: Alexander Potapenko
    Cc: Andrey Ryabinin
    Cc: Branislav Rankov
    Cc: Catalin Marinas
    Cc: Dmitry Vyukov
    Cc: Evgenii Stepanov
    Cc: Kevin Brodsky
    Cc: Peter Collingbourne
    Cc: Vincenzo Frascino
    Cc: Will Deacon
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrey Konovalov
     
  • In the kmalloc_uaf2() test, the pointers to the two allocated memory
    blocks might happen to be the same, and the test will fail. With the
    software tag-based mode, the probability of the that is 1/254, so it's
    hard to observe the failure. For the hardware tag-based mode though,
    the probablity is 1/14, which is quite noticable.

    Allow up to 16 attempts at generating different tags for the tag-based
    modes.

    Link: https://linux-review.googlesource.com/id/Ibfa458ef2804ff465d8eb07434a300bf36388d55
    Link: https://lkml.kernel.org/r/9cd5cf2f633dcbf55cab801cd26845d2b075cec7.1610733117.git.andreyknvl@google.com
    Signed-off-by: Andrey Konovalov
    Reviewed-by: Marco Elver
    Reviewed-by: Alexander Potapenko
    Cc: Andrey Ryabinin
    Cc: Branislav Rankov
    Cc: Catalin Marinas
    Cc: Dmitry Vyukov
    Cc: Evgenii Stepanov
    Cc: Kevin Brodsky
    Cc: Peter Collingbourne
    Cc: Vincenzo Frascino
    Cc: Will Deacon
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrey Konovalov
     
  • It might not be obvious to the compiler that the expression must be
    executed between writing and reading to fail_data. In this case, the
    compiler might reorder or optimize away some of the accesses, and
    the tests will fail.

    Add compiler barriers around the expression in KUNIT_EXPECT_KASAN_FAIL
    and use READ/WRITE_ONCE() for accessing fail_data fields.

    Link: https://linux-review.googlesource.com/id/I046079f48641a1d36fe627fc8827a9249102fd50
    Link: https://lkml.kernel.org/r/6f11596f367d8ae8f71d800351e9a5d91eda19f6.1610733117.git.andreyknvl@google.com
    Signed-off-by: Andrey Konovalov
    Reviewed-by: Marco Elver
    Reviewed-by: Alexander Potapenko
    Cc: Andrey Ryabinin
    Cc: Branislav Rankov
    Cc: Catalin Marinas
    Cc: Dmitry Vyukov
    Cc: Evgenii Stepanov
    Cc: Kevin Brodsky
    Cc: Peter Collingbourne
    Cc: Vincenzo Frascino
    Cc: Will Deacon
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrey Konovalov
     
  • Rename CONFIG_TEST_KASAN_MODULE to CONFIG_KASAN_MODULE_TEST.

    This naming is more consistent with the existing CONFIG_KASAN_KUNIT_TEST.

    Link: https://linux-review.googlesource.com/id/Id347dfa5fe8788b7a1a189863e039f409da0ae5f
    Link: https://lkml.kernel.org/r/f08250246683981bcf8a094fbba7c361995624d2.1610733117.git.andreyknvl@google.com
    Signed-off-by: Andrey Konovalov
    Reviewed-by: Marco Elver
    Reviewed-by: Alexander Potapenko
    Cc: Andrey Ryabinin
    Cc: Branislav Rankov
    Cc: Catalin Marinas
    Cc: Dmitry Vyukov
    Cc: Evgenii Stepanov
    Cc: Kevin Brodsky
    Cc: Peter Collingbourne
    Cc: Vincenzo Frascino
    Cc: Will Deacon
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrey Konovalov
     
  • On a high level, this patch allows running KUnit KASAN tests with the
    hardware tag-based KASAN mode.

    Internally, this change reenables tag checking at the end of each KASAN
    test that triggers a tag fault and leads to tag checking being disabled.

    Also simplify is_write calculation in report_tag_fault.

    With this patch KASAN tests are still failing for the hardware tag-based
    mode; fixes come in the next few patches.

    [andreyknvl@google.com: export HW_TAGS symbols for KUnit tests]
    Link: https://lkml.kernel.org/r/e7eeb252da408b08f0c81b950a55fb852f92000b.1613155970.git.andreyknvl@google.com

    Link: https://linux-review.googlesource.com/id/Id94dc9eccd33b23cda4950be408c27f879e474c8
    Link: https://lkml.kernel.org/r/51b23112cf3fd62b8f8e9df81026fa2b15870501.1610733117.git.andreyknvl@google.com
    Signed-off-by: Andrey Konovalov
    Reviewed-by: Catalin Marinas
    Reviewed-by: Vincenzo Frascino
    Cc: Alexander Potapenko
    Cc: Andrey Ryabinin
    Cc: Branislav Rankov
    Cc: Dmitry Vyukov
    Cc: Evgenii Stepanov
    Cc: Kevin Brodsky
    Cc: Marco Elver
    Cc: Peter Collingbourne
    Cc: Will Deacon
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrey Konovalov
     
  • Add 3 new tests for tag-based KASAN modes:

    1. Check that match-all pointer tag is not assigned randomly.
    2. Check that 0xff works as a match-all pointer tag.
    3. Check that there are no match-all memory tags.

    Note, that test #3 causes a significant number (255) of KASAN reports
    to be printed during execution for the SW_TAGS mode.

    [arnd@arndb.de: export kasan_poison]
    Link: https://lkml.kernel.org/r/20210125112831.2156212-1-arnd@kernel.org
    [akpm@linux-foundation.org: s/EXPORT_SYMBOL_GPL/EXPORT_SYMBOL/, per Andrey]

    Link: https://linux-review.googlesource.com/id/I78f1375efafa162b37f3abcb2c5bc2f3955dfd8e
    Link: https://lkml.kernel.org/r/da841a5408e2204bf25f3b23f70540a65844e8a4.1610733117.git.andreyknvl@google.com
    Signed-off-by: Andrey Konovalov
    Signed-off-by: Arnd Bergmann
    Reviewed-by: Marco Elver
    Reviewed-by: Alexander Potapenko
    Cc: Andrey Ryabinin
    Cc: Branislav Rankov
    Cc: Catalin Marinas
    Cc: Dmitry Vyukov
    Cc: Evgenii Stepanov
    Cc: Kevin Brodsky
    Cc: Peter Collingbourne
    Cc: Vincenzo Frascino
    Cc: Will Deacon
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrey Konovalov
     
  • Some KASAN tests require specific kernel configs to be enabled.
    Instead of copy-pasting the checks for these configs add a few helper
    macros and use them.

    Link: https://linux-review.googlesource.com/id/I237484a7fddfedf4a4aae9cc61ecbcdbe85a0a63
    Link: https://lkml.kernel.org/r/6a0fcdb9676b7e869cfc415893ede12d916c246c.1610733117.git.andreyknvl@google.com
    Signed-off-by: Andrey Konovalov
    Suggested-by: Alexander Potapenko
    Reviewed-by: Marco Elver
    Reviewed-by: Alexander Potapenko
    Cc: Andrey Ryabinin
    Cc: Branislav Rankov
    Cc: Catalin Marinas
    Cc: Dmitry Vyukov
    Cc: Evgenii Stepanov
    Cc: Kevin Brodsky
    Cc: Peter Collingbourne
    Cc: Vincenzo Frascino
    Cc: Will Deacon
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrey Konovalov
     
  • Clarify and update comments in KASAN tests.

    Link: https://linux-review.googlesource.com/id/I6c816c51fa1e0eb7aa3dead6bda1f339d2af46c8
    Link: https://lkml.kernel.org/r/ba6db104d53ae0e3796f80ef395f6873c1c1282f.1610733117.git.andreyknvl@google.com
    Signed-off-by: Andrey Konovalov
    Reviewed-by: Marco Elver
    Reviewed-by: Alexander Potapenko
    Cc: Andrey Ryabinin
    Cc: Branislav Rankov
    Cc: Catalin Marinas
    Cc: Dmitry Vyukov
    Cc: Evgenii Stepanov
    Cc: Kevin Brodsky
    Cc: Peter Collingbourne
    Cc: Vincenzo Frascino
    Cc: Will Deacon
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrey Konovalov
     

24 Feb, 2021

1 commit

  • Pull module updates from Jessica Yu:

    - Retire EXPORT_UNUSED_SYMBOL() and EXPORT_SYMBOL_GPL_FUTURE(). These
    export types were introduced between 2006 - 2008. All the of the
    unused symbols have been long removed and gpl future symbols were
    converted to gpl quite a long time ago, and I don't believe these
    export types have been used ever since. So, I think it should be safe
    to retire those export types now (Christoph Hellwig)

    - Refactor and clean up some aged code cruft in the module loader
    (Christoph Hellwig)

    - Build {,module_}kallsyms_on_each_symbol only when livepatching is
    enabled, as it is the only caller (Christoph Hellwig)

    - Unexport find_module() and module_mutex and fix the last module
    callers to not rely on these anymore. Make module_mutex internal to
    the module loader (Christoph Hellwig)

    - Harden ELF checks on module load and validate ELF structures before
    checking the module signature (Frank van der Linden)

    - Fix undefined symbol warning for clang (Fangrui Song)

    - Fix smatch warning (Dan Carpenter)

    * tag 'modules-for-v5.12' of git://git.kernel.org/pub/scm/linux/kernel/git/jeyu/linux:
    module: potential uninitialized return in module_kallsyms_on_each_symbol()
    module: remove EXPORT_UNUSED_SYMBOL*
    module: remove EXPORT_SYMBOL_GPL_FUTURE
    module: move struct symsearch to module.c
    module: pass struct find_symbol_args to find_symbol
    module: merge each_symbol_section into find_symbol
    module: remove each_symbol_in_section
    module: mark module_mutex static
    kallsyms: only build {,module_}kallsyms_on_each_symbol when required
    kallsyms: refactor {,module_}kallsyms_on_each_symbol
    module: use RCU to synchronize find_module
    module: unexport find_module and module_mutex
    drm: remove drm_fb_helper_modinit
    powerpc/powernv: remove get_cxl_module
    module: harden ELF info handling
    module: Ignore _GLOBAL_OFFSET_TABLE_ when warning for undefined symbols

    Linus Torvalds
     

23 Feb, 2021

6 commits

  • Pull isofs, udf, and quota updates from Jan Kara:
    "Several udf, isofs, and quota fixes"

    * tag 'fs_for_v5.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
    parser: Fix kernel-doc markups
    udf: handle large user and group ID
    isofs: handle large user and group ID
    parser: add unsigned int parser
    udf: fix silent AED tagLocation corruption
    isofs: release buffer head before return
    quota: Fix memory leak when handling corrupted quota file

    Linus Torvalds
     
  • Pull printk updates from Petr Mladek:

    - New "no_hash_pointers" kernel parameter causes that %p shows raw
    pointer values instead of hashed ones. It is intended only for
    debugging purposes. Misuse is prevented by a fat warning message that
    is inspired by trace_printk().

    - Prevent a possible deadlock when flushing printk_safe buffers during
    panic().

    - Fix performance regression caused by the lockless printk ringbuffer.
    It was visible with huge log buffer and long messages.

    - Documentation fix-up.

    * tag 'printk-for-5.12' of git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux:
    lib/vsprintf: no_hash_pointers prints all addresses as unhashed
    kselftest: add support for skipped tests
    lib: use KSTM_MODULE_GLOBALS macro in kselftest drivers
    printk: avoid prb_first_valid_seq() where possible
    printk: fix deadlock when kernel panic
    printk: rectify kernel-doc for prb_rec_init_wr()

    Linus Torvalds
     
  • …/kernel/git/shuah/linux-kselftest

    Pull KUnit updates from Shuah Khan

    - support for filtering test suites using glob from Daniel Latypov.

    "kunit_filter.glob" command line option is passed to the UML
    kernel, which currently only supports filtering by suite name.
    This support allows running different subsets of tests, e.g.

    $ ./tools/testing/kunit/kunit.py build
    $ ./tools/testing/kunit/kunit.py exec 'list*'
    $ ./tools/testing/kunit/kunit.py exec 'kunit*'

    - several fixes and cleanups also from Daniel Latypov.

    * tag 'linux-kselftest-kunit-5.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest:
    kunit: tool: fix unintentional statefulness in run_kernel()
    kunit: tool: add support for filtering suites by glob
    kunit: add kunit.filter_glob cmdline option to filter suites
    kunit: don't show `1 == 1` in failed assertion messages
    kunit: make kunit_tool accept optional path to .kunitconfig fragment
    Documentation: kunit: add tips.rst for small examples
    KUnit: Docs: make start.rst example Kconfig follow style.rst
    kunit: tool: simplify kconfig is_subset_of() logic
    minor: kunit: tool: fix unit test so it can run from non-root dir
    kunit: tool: use `with open()` in unit test
    kunit: tool: stop using bare asserts in unit test
    kunit: tool: fix unit test cleanup handling

    Linus Torvalds
     
  • Pull documentation updates from Jonathan Corbet:
    "It has been a relatively quiet cycle in docsland.

    - As promised, the minimum Sphinx version to build the docs is now
    1.7, and we have dropped support for Python 2 entirely. That
    allowed the removal of a bunch of compatibility code.

    - A set of treewide warning fixups from Mauro that I applied after it
    became clear nobody else was going to deal with them.

    - The automarkup mechanism can now create cross-references from
    relative paths to RST files.

    - More translations, typo fixes, and warning fixes"

    * tag 'docs-5.12' of git://git.lwn.net/linux: (75 commits)
    docs: kernel-hacking: be more civil
    docs: Remove the Microsoft rhetoric
    Documentation/admin-guide: kernel-parameters: Update nohlt section
    doc/admin-guide: fix spelling mistake: "perfomance" -> "performance"
    docs: Document cross-referencing using relative path
    docs: Enable usage of relative paths to docs on automarkup
    docs: thermal: fix spelling mistakes
    Documentation: admin-guide: Update kvm/xen config option
    docs: Make syscalls' helpers naming consistent
    coding-style.rst: Avoid comma statements
    Documentation: /proc/loadavg: add 3 more field descriptions
    Documentation/submitting-patches: Add blurb about backtraces in commit messages
    Docs: drop Python 2 support
    Move our minimum Sphinx version to 1.7
    Documentation: input: define ABS_PRESSURE/ABS_MT_PRESSURE resolution as grams
    scripts/kernel-doc: add internal hyperlink to DOC: sections
    Update Documentation/admin-guide/sysctl/fs.rst
    docs: Update DTB format references
    docs: zh_CN: add iio index.rst translation
    docs/zh_CN: add iio ep93xx_adc.rst translation
    ...

    Linus Torvalds
     
  • Pull gpio updates from Bartosz Golaszewski:
    "It's been a relatively calm release cycle and we're actually removing
    more code than we're adding.

    Summary:

    - new driver for the Toshiba Visconti platform

    - rework of interrupt handling in gpio-tegra

    - updates for GPIO selftests: we're now using the character device to
    perform the subsystem checks

    - support for a new rcar variant + some code refactoring

    - refactoring of gpio-ep93xx

    - SPDX License identifier has been updated in the uapi header so that
    userspace programs bundling it can become fully REUSE-compliant

    - improvements to pwm handling in gpio-mvebu

    - support for interrupt handling and power management for gpio-xilinx
    as well as some code refactoring

    - support for a new chip variant in gpio-pca953x

    - removal of drivers: zte xs & intel-mid and removal of leftovers
    from intel-msic

    - impovements to intel drivers pulled from Andy Shevchenko

    - improvements to the gpio-aggregator virtual GPIO driver

    - and several minor tweaks and fixes to code and documentation all
    over the place"

    * tag 'gpio-updates-for-v5.12' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux: (71 commits)
    gpio: pcf857x: Fix missing first interrupt
    gpio: ep93xx: refactor base IRQ number
    gpio: ep93xx: refactor ep93xx_gpio_add_bank
    gpio: ep93xx: Fix typo s/hierarchial/hierarchical
    gpio: ep93xx: drop to_irq binding
    gpio: ep93xx: Fix wrong irq numbers in port F
    gpio: uapi: use the preferred SPDX license identifier
    gpio: gpio-xilinx: Add check if width exceeds 32
    gpio: gpio-xilinx: Add support for suspend and resume
    gpio: gpio-xilinx: Add interrupt support
    gpio: gpio-xilinx: Reduce spinlock array to array
    gpio: gpio-xilinx: Simplify with dev_err_probe()
    gpio: msic: Drop driver from Makefile
    gpio: wcove: Split out to_ireg() helper and deduplicate the code
    gpio: wcove: Switch to use regmap_set_bits(), regmap_clear_bits()
    gpio: wcove: Get rid of error prone casting in IRQ handler
    gpio: intel-mid: Remove driver for deprecated platform
    gpio: msic: Remove driver for deprecated platform
    gpio: aggregator: Remove trailing comma in terminator entries
    gpio: aggregator: Use compound literal from the header
    ...

    Linus Torvalds
     
  • Pull regulator updates from Mark Brown:
    "Quite an active release for driver specific updates but very little
    going on at the subsystem level this time for the regulator API.

    Summary:

    - Overhaul of the Qualcomm LABIBB driver.

    - Allow use of regulator_sync_voltage() on coupled regulators.

    - Support for Action ATC260x, Mediatek DVSRC and MT6315, Qualcomm
    PCM8180/c and PM8009-1 and Richtek RT4831

    - Removal of the AB3100 driver"

    * tag 'regulator-v5.12' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: (49 commits)
    regulator: bd718x7, bd71828, Fix dvs voltage levels
    regulator: pca9450: Add sd-vsel GPIO
    regulator: pca9450: Enable system reset on WDOG_B assertion
    regulator: pca9450: Add SD_VSEL GPIO for LDO5
    regulator: qcom-rpmh: fix pm8009 ldo7
    regulator: mt6315: Add support for MT6315 regulator
    regulator: document binding for MT6315 regulator
    regulator: dt-bindings: Document charger-supply for max8997
    regulator: qcom-labibb: Use disable_irq_nosync from isr
    regulator: pf8x00: Fix typo for PF8200 chip name
    regulator: pf8x00: set ramp_delay for bucks
    regulator: core: Avoid debugfs: Directory ... already present! error
    regulator: pf8x00: Add suspend support
    regulator: Make regulator_sync_voltage() usable by coupled regulators
    regulator: s5m8767: Drop regulators OF node reference
    regulator: qcom-rpmh: Add pmc8180 and pmc8180c
    regulator: qcom-rpmh: Add pmc8180 and pmc8180c
    regulator: s5m8767: Fix reference count leak
    regulator: remove ab3100 driver
    regulator: axp20x: Fix reference cout leak
    ...

    Linus Torvalds
     

22 Feb, 2021

3 commits

  • Pull crypto update from Herbert Xu:
    "API:
    - Restrict crypto_cipher to internal API users only.

    Algorithms:
    - Add x86 aesni acceleration for cts.
    - Improve x86 aesni acceleration for xts.
    - Remove x86 acceleration of some uncommon algorithms.
    - Remove RIPE-MD, Tiger and Salsa20.
    - Remove tnepres.
    - Add ARM acceleration for BLAKE2s and BLAKE2b.

    Drivers:
    - Add Keem Bay OCS HCU driver.
    - Add Marvell OcteonTX2 CPT PF driver.
    - Remove PicoXcell driver.
    - Remove mediatek driver"

    * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (154 commits)
    hwrng: timeriomem - Use device-managed registration API
    crypto: hisilicon/qm - fix printing format issue
    crypto: hisilicon/qm - do not reset hardware when CE happens
    crypto: hisilicon/qm - update irqflag
    crypto: hisilicon/qm - fix the value of 'QM_SQC_VFT_BASE_MASK_V2'
    crypto: hisilicon/qm - fix request missing error
    crypto: hisilicon/qm - removing driver after reset
    crypto: octeontx2 - fix -Wpointer-bool-conversion warning
    crypto: hisilicon/hpre - enable Elliptic curve cryptography
    crypto: hisilicon - PASID fixed on Kunpeng 930
    crypto: hisilicon/qm - fix use of 'dma_map_single'
    crypto: hisilicon/hpre - tiny fix
    crypto: hisilicon/hpre - adapt the number of clusters
    crypto: cpt - remove casting dma_alloc_coherent
    crypto: keembay-ocs-aes - Fix 'q' assignment during CCM B0 generation
    crypto: xor - Fix typo of optimization
    hwrng: optee - Use device-managed registration API
    crypto: arm64/crc-t10dif - move NEON yield to C code
    crypto: arm64/aes-ce-mac - simplify NEON yield
    crypto: arm64/aes-neonbs - remove NEON yield calls
    ...

    Linus Torvalds
     
  • Pull media updates from Mauro Carvalho Chehab:

    - some core fixes in VB2 mem2mem support

    - some improvements and cleanups in V4L2 async kAPI

    - newer controls in V4L2 API for H-264 and HEVC codecs

    - allegro-dvt driver was promoted from staging

    - new i2c sendor drivers: imx334, ov5648, ov8865

    - new automobile camera module: rdacm21

    - ipu3 cio2 driver started gained support for some ACPI BIOSes

    - new ATSC frontend: MaxLinear mxl692 VSB tuner/demod

    - the SMIA/CCS driver gained more support for CSS standard

    - several driver fixes, updates and improvements

    * tag 'media/v5.12-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (362 commits)
    media: v4l: async: Fix kerneldoc documentation for async functions
    media: i2c: max9271: Add MODULE_* macros
    media: i2c: Kconfig: Make MAX9271 a module
    media: imx334: 'ret' is uninitialized, should have been PTR_ERR()
    media: i2c: Add imx334 camera sensor driver
    media: dt-bindings: media: Add bindings for imx334
    media: ov8856: Configure sensor for GRBG Bayer for all modes
    media: i2c: imx219: Implement V4L2_CID_LINK_FREQ control
    media: ov5675: fix vflip/hflip control
    media: ipu3-cio2: Build bridge only if ACPI is enabled
    media: Remove the legacy v4l2-clk API
    media: ov6650: Use the generic clock framework
    media: mt9m111: Use the generic clock framework
    media: ov9640: Use the generic clock framework
    media: pxa_camera: Drop the v4l2-clk clock register
    media: mach-pxa: Register the camera sensor fixed-rate clock
    media: i2c: imx258: get clock from device properties and enable it via runtime PM
    media: i2c: imx258: simplify getting state container
    media: i2c: imx258: add support for binding via device tree
    media: dt-bindings: media: imx258: add bindings for IMX258 sensor
    ...

    Linus Torvalds
     
  • Pull scheduler updates from Ingo Molnar:
    "Core scheduler updates:

    - Add CONFIG_PREEMPT_DYNAMIC: this in its current form adds the
    preempt=none/voluntary/full boot options (default: full), to allow
    distros to build a PREEMPT kernel but fall back to close to
    PREEMPT_VOLUNTARY (or PREEMPT_NONE) runtime scheduling behavior via
    a boot time selection.

    There's also the /debug/sched_debug switch to do this runtime.

    This feature is implemented via runtime patching (a new variant of
    static calls).

    The scope of the runtime patching can be best reviewed by looking
    at the sched_dynamic_update() function in kernel/sched/core.c.

    ( Note that the dynamic none/voluntary mode isn't 100% identical,
    for example preempt-RCU is available in all cases, plus the
    preempt count is maintained in all models, which has runtime
    overhead even with the code patching. )

    The PREEMPT_VOLUNTARY/PREEMPT_NONE models, used by the vast
    majority of distributions, are supposed to be unaffected.

    - Fix ignored rescheduling after rcu_eqs_enter(). This is a bug that
    was found via rcutorture triggering a hang. The bug is that
    rcu_idle_enter() may wake up a NOCB kthread, but this happens after
    the last generic need_resched() check. Some cpuidle drivers fix it
    by chance but many others don't.

    In true 2020 fashion the original bug fix has grown into a 5-patch
    scheduler/RCU fix series plus another 16 RCU patches to address the
    underlying issue of missed preemption events. These are the initial
    fixes that should fix current incarnations of the bug.

    - Clean up rbtree usage in the scheduler, by providing & using the
    following consistent set of rbtree APIs:

    partial-order; less() based:
    - rb_add(): add a new entry to the rbtree
    - rb_add_cached(): like rb_add(), but for a rb_root_cached

    total-order; cmp() based:
    - rb_find(): find an entry in an rbtree
    - rb_find_add(): find an entry, and add if not found

    - rb_find_first(): find the first (leftmost) matching entry
    - rb_next_match(): continue from rb_find_first()
    - rb_for_each(): iterate a sub-tree using the previous two

    - Improve the SMP/NUMA load-balancer: scan for an idle sibling in a
    single pass. This is a 4-commit series where each commit improves
    one aspect of the idle sibling scan logic.

    - Improve the cpufreq cooling driver by getting the effective CPU
    utilization metrics from the scheduler

    - Improve the fair scheduler's active load-balancing logic by
    reducing the number of active LB attempts & lengthen the
    load-balancing interval. This improves stress-ng mmapfork
    performance.

    - Fix CFS's estimated utilization (util_est) calculation bug that can
    result in too high utilization values

    Misc updates & fixes:

    - Fix the HRTICK reprogramming & optimization feature

    - Fix SCHED_SOFTIRQ raising race & warning in the CPU offlining code

    - Reduce dl_add_task_root_domain() overhead

    - Fix uprobes refcount bug

    - Process pending softirqs in flush_smp_call_function_from_idle()

    - Clean up task priority related defines, remove *USER_*PRIO and
    USER_PRIO()

    - Simplify the sched_init_numa() deduplication sort

    - Documentation updates

    - Fix EAS bug in update_misfit_status(), which degraded the quality
    of energy-balancing

    - Smaller cleanups"

    * tag 'sched-core-2021-02-17' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (51 commits)
    sched,x86: Allow !PREEMPT_DYNAMIC
    entry/kvm: Explicitly flush pending rcuog wakeup before last rescheduling point
    entry: Explicitly flush pending rcuog wakeup before last rescheduling point
    rcu/nocb: Trigger self-IPI on late deferred wake up before user resume
    rcu/nocb: Perform deferred wake up before last idle's need_resched() check
    rcu: Pull deferred rcuog wake up to rcu_eqs_enter() callers
    sched/features: Distinguish between NORMAL and DEADLINE hrtick
    sched/features: Fix hrtick reprogramming
    sched/deadline: Reduce rq lock contention in dl_add_task_root_domain()
    uprobes: (Re)add missing get_uprobe() in __find_uprobe()
    smp: Process pending softirqs in flush_smp_call_function_from_idle()
    sched: Harden PREEMPT_DYNAMIC
    static_call: Allow module use without exposing static_call_key
    sched: Add /debug/sched_preempt
    preempt/dynamic: Support dynamic preempt with preempt= boot option
    preempt/dynamic: Provide irqentry_exit_cond_resched() static call
    preempt/dynamic: Provide preempt_schedule[_notrace]() static calls
    preempt/dynamic: Provide cond_resched() and might_resched() static calls
    preempt: Introduce CONFIG_PREEMPT_DYNAMIC
    static_call: Provide DEFINE_STATIC_CALL_RET0()
    ...

    Linus Torvalds