03 Nov, 2019

1 commit

  • Alexei Starovoitov says:

    ====================
    pull-request: bpf-next 2019-11-02

    The following pull-request contains BPF updates for your *net-next* tree.

    We've added 30 non-merge commits during the last 7 day(s) which contain
    a total of 41 files changed, 1864 insertions(+), 474 deletions(-).

    The main changes are:

    1) Fix long standing user vs kernel access issue by introducing
    bpf_probe_read_user() and bpf_probe_read_kernel() helpers, from Daniel.

    2) Accelerated xskmap lookup, from Björn and Maciej.

    3) Support for automatic map pinning in libbpf, from Toke.

    4) Cleanup of BTF-enabled raw tracepoints, from Alexei.

    5) Various fixes to libbpf and selftests.
    ====================

    Signed-off-by: David S. Miller

    David S. Miller
     

30 Oct, 2019

2 commits

  • Following reports of skb_segment() hitting a BUG_ON when working on
    GROed skbs which have their gso_size mangled (e.g. after a
    bpf_skb_change_proto call), add a reproducer test that mimics the
    input skbs that lead to the mentioned BUG_ON as in [1] and validates the
    fix submitted in [2].

    [1] https://lists.openwall.net/netdev/2019/08/26/110
    [2] commit 3dcbdb134f32 ("net: gso: Fix skb_segment splat when splitting gso_size mangled skb having linear-headed frag_list")

    Signed-off-by: Shmulik Ladkani
    Signed-off-by: Daniel Borkmann
    Link: https://lore.kernel.org/bpf/20191025134223.2761-3-shmulik.ladkani@gmail.com

    Shmulik Ladkani
     
  • Currently, test_skb_segment() builds a single test skb and runs
    skb_segment() on it.

    Extend test_skb_segment() so it processes an array of numerous
    skb/feature pairs to test.

    Signed-off-by: Shmulik Ladkani
    Signed-off-by: Daniel Borkmann
    Link: https://lore.kernel.org/bpf/20191025134223.2761-2-shmulik.ladkani@gmail.com

    Shmulik Ladkani
     

23 Oct, 2019

1 commit

  • A recent commit removed the NULL pointer check from the clock_getres()
    implementation causing a test case to fault.

    POSIX requires an explicit NULL pointer check for clock_getres() aside of
    the validity check of the clock_id argument for obscure reasons.

    Add it back for both 32bit and 64bit.

    Note, this is only a partial revert of the offending commit which does not
    bring back the broken fallback invocation in the the 32bit compat
    implementations of clock_getres() and clock_gettime().

    Fixes: a9446a906f52 ("lib/vdso/32: Remove inconsistent NULL pointer checks")
    Reported-by: Andreas Schwab
    Signed-off-by: Thomas Gleixner
    Tested-by: Christophe Leroy
    Cc: stable@vger.kernel.org
    Link: https://lkml.kernel.org/r/alpine.DEB.2.21.1910211202260.1904@nanos.tec.linutronix.de

    Thomas Gleixner
     

19 Oct, 2019

1 commit

  • …kernel/git/brauner/linux

    Pull usercopy test fixlets from Christian Brauner:
    "This contains two improvements for the copy_struct_from_user() tests:

    - a coding style change to get rid of the ugly "if ((ret |= test()))"
    pointed out when pulling the original patchset.

    - avoid a soft lockups when running the usercopy tests on machines
    with large page sizes by scanning only a 1024 byte region"

    * tag 'copy-struct-from-user-v5.4-rc4' of gitolite.kernel.org:pub/scm/linux/kernel/git/brauner/linux:
    usercopy: Avoid soft lockups in test_check_nonzero_user()
    lib: test_user_copy: style cleanup

    Linus Torvalds
     

16 Oct, 2019

1 commit

  • On a machine with a 64K PAGE_SIZE, the nested for loops in
    test_check_nonzero_user() can lead to soft lockups, eg:

    watchdog: BUG: soft lockup - CPU#4 stuck for 22s! [modprobe:611]
    Modules linked in: test_user_copy(+) vmx_crypto gf128mul crc32c_vpmsum virtio_balloon ip_tables x_tables autofs4
    CPU: 4 PID: 611 Comm: modprobe Tainted: G L 5.4.0-rc1-gcc-8.2.0-00001-gf5a1a536fa14-dirty #1151
    ...
    NIP __might_sleep+0x20/0xc0
    LR __might_fault+0x40/0x60
    Call Trace:
    check_zeroed_user+0x12c/0x200
    test_user_copy_init+0x67c/0x1210 [test_user_copy]
    do_one_initcall+0x60/0x340
    do_init_module+0x7c/0x2f0
    load_module+0x2d94/0x30e0
    __do_sys_finit_module+0xc8/0x150
    system_call+0x5c/0x68

    Even with a 4K PAGE_SIZE the test takes multiple seconds. Instead
    tweak it to only scan a 1024 byte region, but make it cross the
    page boundary.

    Fixes: f5a1a536fa14 ("lib: introduce copy_struct_from_user() helper")
    Suggested-by: Aleksa Sarai
    Signed-off-by: Michael Ellerman
    Reviewed-by: Aleksa Sarai
    Acked-by: Christian Brauner
    Link: https://lore.kernel.org/r/20191016122732.13467-1-mpe@ellerman.id.au
    Signed-off-by: Christian Brauner

    Michael Ellerman
     

15 Oct, 2019

2 commits

  • Make sure allocations from kmem_cache_alloc_bulk() and
    kmem_cache_free_bulk() are properly initialized.

    Link: http://lkml.kernel.org/r/20191007091605.30530-2-glider@google.com
    Signed-off-by: Alexander Potapenko
    Cc: Kees Cook
    Cc: Christoph Lameter
    Cc: Laura Abbott
    Cc: Thibaut Sautereau
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexander Potapenko
     
  • Kmemleak is falsely reporting a leak of the slab allocation in
    sctp_stream_init_ext():

    BUG: memory leak
    unreferenced object 0xffff8881114f5d80 (size 96):
    comm "syz-executor934", pid 7160, jiffies 4294993058 (age 31.950s)
    hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    backtrace:
    [] kmemleak_alloc_recursive include/linux/kmemleak.h:55 [inline]
    [] slab_post_alloc_hook mm/slab.h:439 [inline]
    [] slab_alloc mm/slab.c:3326 [inline]
    [] kmem_cache_alloc_trace+0x13d/0x280 mm/slab.c:3553
    [] kmalloc include/linux/slab.h:547 [inline]
    [] kzalloc include/linux/slab.h:742 [inline]
    [] sctp_stream_init_ext+0x2b/0xa0 net/sctp/stream.c:157
    [] sctp_sendmsg_to_asoc+0x946/0xa00 net/sctp/socket.c:1882
    [] sctp_sendmsg+0x2a8/0x990 net/sctp/socket.c:2102
    [...]

    But it's freed later. Kmemleak misses the allocation because its
    pointer is stored in the generic radix tree sctp_stream::out, and the
    generic radix tree uses raw pages which aren't tracked by kmemleak.

    Fix this by adding the kmemleak hooks to the generic radix tree code.

    Link: http://lkml.kernel.org/r/20191004065039.727564-1-ebiggers@kernel.org
    Signed-off-by: Eric Biggers
    Reported-by:
    Reviewed-by: Marcelo Ricardo Leitner
    Acked-by: Neil Horman
    Reviewed-by: Catalin Marinas
    Cc: Kent Overstreet
    Cc: Vlad Yasevich
    Cc: Xin Long
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Eric Biggers
     

13 Oct, 2019

1 commit

  • Pull x86 fixes from Ingo Molnar:
    "A handful of fixes: a kexec linking fix, an AMD MWAITX fix, a vmware
    guest support fix when built under Clang, and new CPU model number
    definitions"

    * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    x86/cpu: Add Comet Lake to the Intel CPU models header
    lib/string: Make memzero_explicit() inline instead of external
    x86/cpu/vmware: Use the full form of INL in VMWARE_PORT
    x86/asm: Fix MWAITX C-state hint value

    Linus Torvalds
     

10 Oct, 2019

1 commit

  • Pull arm64 fixes from Will Deacon:
    "A larger-than-usual batch of arm64 fixes for -rc3.

    The bulk of the fixes are dealing with a bunch of issues with the
    build system from the compat vDSO, which unfortunately led to some
    significant Makefile rework to manage the horrible combinations of
    toolchains that we can end up needing to drive simultaneously.

    We came close to disabling the thing entirely, but Vincenzo was quick
    to spin up some patches and I ended up picking up most of the bits
    that were left [*]. Future work will look at disentangling the header
    files properly.

    Other than that, we have some important fixes all over, including one
    papering over the miscompilation fallout from forcing
    CONFIG_OPTIMIZE_INLINING=y, which I'm still unhappy about. Harumph.

    We've still got a couple of open issues, so I'm expecting to have some
    more fixes later this cycle.

    Summary:

    - Numerous fixes to the compat vDSO build system, especially when
    combining gcc and clang

    - Fix parsing of PAR_EL1 in spurious kernel fault detection

    - Partial workaround for Neoverse-N1 erratum #1542419

    - Fix IRQ priority masking on entry from compat syscalls

    - Fix advertisment of FRINT HWCAP to userspace

    - Attempt to workaround inlining breakage with '__always_inline'

    - Fix accidental freeing of parent SVE state on fork() error path

    - Add some missing NULL pointer checks in instruction emulation init

    - Some formatting and comment fixes"

    [*] Will's final fixes were

    Reviewed-by: Vincenzo Frascino
    Tested-by: Vincenzo Frascino

    but they were already in linux-next by then and he didn't rebase
    just to add those.

    * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: (21 commits)
    arm64: armv8_deprecated: Checking return value for memory allocation
    arm64: Kconfig: Make CONFIG_COMPAT_VDSO a proper Kconfig option
    arm64: vdso32: Rename COMPATCC to CC_COMPAT
    arm64: vdso32: Pass '--target' option to clang via VDSO_CAFLAGS
    arm64: vdso32: Don't use KBUILD_CPPFLAGS unconditionally
    arm64: vdso32: Move definition of COMPATCC into vdso32/Makefile
    arm64: Default to building compat vDSO with clang when CONFIG_CC_IS_CLANG
    lib: vdso: Remove CROSS_COMPILE_COMPAT_VDSO
    arm64: vdso32: Remove jump label config option in Makefile
    arm64: vdso32: Detect binutils support for dmb ishld
    arm64: vdso: Remove stale files from old assembly implementation
    arm64: vdso32: Fix broken compat vDSO build warnings
    arm64: mm: fix spurious fault detection
    arm64: ftrace: Ensure synchronisation in PLT setup for Neoverse-N1 #1542419
    arm64: Fix incorrect irqflag restore for priority masking for compat
    arm64: mm: avoid virt_to_phys(init_mm.pgd)
    arm64: cpufeature: Effectively expose FRINT capability to userspace
    arm64: Mark functions using explicit register variables as '__always_inline'
    docs: arm64: Fix indentation and doc formatting
    arm64/sve: Fix wrong free for task->thread.sve_state
    ...

    Linus Torvalds
     

08 Oct, 2019

1 commit

  • With the use of the barrier implied by barrier_data(), there is no need
    for memzero_explicit() to be extern. Making it inline saves the overhead
    of a function call, and allows the code to be reused in arch/*/purgatory
    without having to duplicate the implementation.

    Tested-by: Hans de Goede
    Signed-off-by: Arvind Sankar
    Reviewed-by: Hans de Goede
    Cc: Ard Biesheuvel
    Cc: Borislav Petkov
    Cc: H . Peter Anvin
    Cc: Herbert Xu
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Stephan Mueller
    Cc: Thomas Gleixner
    Cc: linux-crypto@vger.kernel.org
    Cc: linux-s390@vger.kernel.org
    Fixes: 906a4bb97f5d ("crypto: sha256 - Use get/put_unaligned_be32 to get input, memzero_explicit")
    Link: https://lkml.kernel.org/r/20191007220000.GA408752@rani.riverdale.lan
    Signed-off-by: Ingo Molnar

    Arvind Sankar
     

07 Oct, 2019

2 commits

  • arm64 was the last architecture using CROSS_COMPILE_COMPAT_VDSO config
    option. With this patch series the dependency in the architecture has
    been removed.

    Remove CROSS_COMPILE_COMPAT_VDSO from the Unified vDSO library code.

    Cc: Thomas Gleixner
    Cc: Andy Lutomirski
    Signed-off-by: Vincenzo Frascino
    Signed-off-by: Will Deacon

    Vincenzo Frascino
     
  • While writing the tests for copy_struct_from_user(), I used a construct
    that Linus doesn't appear to be too fond of:

    On 2019-10-04, Linus Torvalds wrote:
    > Hmm. That code is ugly, both before and after the fix.
    >
    > This just doesn't make sense for so many reasons:
    >
    > if ((ret |= test(umem_src == NULL, "kmalloc failed")))
    >
    > where the insanity comes from
    >
    > - why "|=" when you know that "ret" was zero before (and it had to
    > be, for the test to make sense)
    >
    > - why do this as a single line anyway?
    >
    > - don't do the stupid "double parenthesis" to hide a warning. Make it
    > use an actual comparison if you add a layer of parentheses.

    So instead, use a bog-standard check that isn't nearly as ugly.

    Fixes: 341115822f88 ("usercopy: Add parentheses around assignment in test_copy_struct_from_user")
    Fixes: f5a1a536fa14 ("lib: introduce copy_struct_from_user() helper")
    Signed-off-by: Aleksa Sarai
    Reviewed-by: Nathan Chancellor
    Reviewed-by: Christian Brauner
    Link: https://lore.kernel.org/r/20191005233028.18566-1-cyphar@cyphar.com
    Signed-off-by: Christian Brauner

    Aleksa Sarai
     

05 Oct, 2019

1 commit

  • Pull networking fixes from David Miller:

    1) Fix ieeeu02154 atusb driver use-after-free, from Johan Hovold.

    2) Need to validate TCA_CBQ_WRROPT netlink attributes, from Eric
    Dumazet.

    3) txq null deref in mac80211, from Miaoqing Pan.

    4) ionic driver needs to select NET_DEVLINK, from Arnd Bergmann.

    5) Need to disable bh during nft_connlimit GC, from Pablo Neira Ayuso.

    6) Avoid division by zero in taprio scheduler, from Vladimir Oltean.

    7) Various xgmac fixes in stmmac driver from Jose Abreu.

    8) Avoid 64-bit division in mlx5 leading to link errors on 32-bit from
    Michal Kubecek.

    9) Fix bad VLAN check in rtl8366 DSA driver, from Linus Walleij.

    10) Fix sleep while atomic in sja1105, from Vladimir Oltean.

    11) Suspend/resume deadlock in stmmac, from Thierry Reding.

    12) Various UDP GSO fixes from Josh Hunt.

    13) Fix slab out of bounds access in tcp_zerocopy_receive(), from Eric
    Dumazet.

    14) Fix OOPS in __ipv6_ifa_notify(), from David Ahern.

    15) Memory leak in NFC's llcp_sock_bind, from Eric Dumazet.

    * git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (72 commits)
    selftests/net: add nettest to .gitignore
    net: qlogic: Fix memory leak in ql_alloc_large_buffers
    nfc: fix memory leak in llcp_sock_bind()
    sch_dsmark: fix potential NULL deref in dsmark_init()
    net: phy: at803x: use operating parameters from PHY-specific status
    net: phy: extract pause mode
    net: phy: extract link partner advertisement reading
    net: phy: fix write to mii-ctrl1000 register
    ipv6: Handle missing host route in __ipv6_ifa_notify
    net: phy: allow for reset line to be tied to a sleepy GPIO controller
    net: ipv4: avoid mixed n_redirects and rate_tokens usage
    r8152: Set macpassthru in reset_resume callback
    cxgb4:Fix out-of-bounds MSI-X info array access
    Revert "ipv6: Handle race in addrconf_dad_work"
    net: make sock_prot_memory_pressure() return "const char *"
    rxrpc: Fix rxrpc_recvmsg tracepoint
    qmi_wwan: add support for Cinterion CLS8 devices
    tcp: fix slab-out-of-bounds in tcp_zerocopy_receive()
    lib: textsearch: fix escapes in example code
    udp: only do GSO if # of segs > 1
    ...

    Linus Torvalds
     

04 Oct, 2019

2 commits

  • Clang warns:

    lib/test_user_copy.c:96:10: warning: using the result of an assignment
    as a condition without parentheses [-Wparentheses]
    if (ret |= test(umem_src == NULL, "kmalloc failed"))
    ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    lib/test_user_copy.c:96:10: note: place parentheses around the
    assignment to silence this warning
    if (ret |= test(umem_src == NULL, "kmalloc failed"))
    ^
    ( )
    lib/test_user_copy.c:96:10: note: use '!=' to turn this compound
    assignment into an inequality comparison
    if (ret |= test(umem_src == NULL, "kmalloc failed"))
    ^~
    !=

    Add the parentheses as it suggests because this is intentional.

    Fixes: f5a1a536fa14 ("lib: introduce copy_struct_from_user() helper")
    Link: https://github.com/ClangBuiltLinux/linux/issues/731
    Signed-off-by: Nathan Chancellor
    Acked-by: Aleksa Sarai
    Acked-by: Christian Brauner
    Link: https://lore.kernel.org/r/20191003171121.2723619-1-natechancellor@gmail.com
    Signed-off-by: Christian Brauner

    Nathan Chancellor
     
  • This textsearch code example does not need the '\' escapes and they can
    be misleading to someone reading the example. Also, gcc and sparse warn
    that the "\%d" is an unknown escape sequence.

    Fixes: 5968a70d7af5 ("textsearch: fix kernel-doc warnings and add kernel-api section")
    Signed-off-by: Randy Dunlap
    Cc: "David S. Miller"
    Cc: netdev@vger.kernel.org
    Signed-off-by: David S. Miller

    Randy Dunlap
     

01 Oct, 2019

1 commit

  • A common pattern for syscall extensions is increasing the size of a
    struct passed from userspace, such that the zero-value of the new fields
    result in the old kernel behaviour (allowing for a mix of userspace and
    kernel vintages to operate on one another in most cases).

    While this interface exists for communication in both directions, only
    one interface is straightforward to have reasonable semantics for
    (userspace passing a struct to the kernel). For kernel returns to
    userspace, what the correct semantics are (whether there should be an
    error if userspace is unaware of a new extension) is very
    syscall-dependent and thus probably cannot be unified between syscalls
    (a good example of this problem is [1]).

    Previously there was no common lib/ function that implemented
    the necessary extension-checking semantics (and different syscalls
    implemented them slightly differently or incompletely[2]). Future
    patches replace common uses of this pattern to make use of
    copy_struct_from_user().

    Some in-kernel selftests that insure that the handling of alignment and
    various byte patterns are all handled identically to memchr_inv() usage.

    [1]: commit 1251201c0d34 ("sched/core: Fix uclamp ABI bug, clean up and
    robustify sched_read_attr() ABI logic and code")

    [2]: For instance {sched_setattr,perf_event_open,clone3}(2) all do do
    similar checks to copy_struct_from_user() while rt_sigprocmask(2)
    always rejects differently-sized struct arguments.

    Suggested-by: Rasmus Villemoes
    Signed-off-by: Aleksa Sarai
    Reviewed-by: Kees Cook
    Reviewed-by: Christian Brauner
    Link: https://lore.kernel.org/r/20191001011055.19283-2-cyphar@cyphar.com
    Signed-off-by: Christian Brauner

    Aleksa Sarai
     

29 Sep, 2019

1 commit

  • Pull networking fixes from David Miller:

    1) Sanity check URB networking device parameters to avoid divide by
    zero, from Oliver Neukum.

    2) Disable global multicast filter in NCSI, otherwise LLDP and IPV6
    don't work properly. Longer term this needs a better fix tho. From
    Vijay Khemka.

    3) Small fixes to selftests (use ping when ping6 is not present, etc.)
    from David Ahern.

    4) Bring back rt_uses_gateway member of struct rtable, it's semantics
    were not well understood and trying to remove it broke things. From
    David Ahern.

    5) Move usbnet snaity checking, ignore endpoints with invalid
    wMaxPacketSize. From Bjørn Mork.

    6) Missing Kconfig deps for sja1105 driver, from Mao Wenan.

    7) Various small fixes to the mlx5 DR steering code, from Alaa Hleihel,
    Alex Vesker, and Yevgeny Kliteynik

    8) Missing CAP_NET_RAW checks in various places, from Ori Nimron.

    9) Fix crash when removing sch_cbs entry while offloading is enabled,
    from Vinicius Costa Gomes.

    10) Signedness bug fixes, generally in looking at the result given by
    of_get_phy_mode() and friends. From Dan Crapenter.

    11) Disable preemption around BPF_PROG_RUN() calls, from Eric Dumazet.

    12) Don't create VRF ipv6 rules if ipv6 is disabled, from David Ahern.

    13) Fix quantization code in tcp_bbr, from Kevin Yang.

    * git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (127 commits)
    net: tap: clean up an indentation issue
    nfp: abm: fix memory leak in nfp_abm_u32_knode_replace
    tcp: better handle TCP_USER_TIMEOUT in SYN_SENT state
    sk_buff: drop all skb extensions on free and skb scrubbing
    tcp_bbr: fix quantization code to not raise cwnd if not probing bandwidth
    mlxsw: spectrum_flower: Fail in case user specifies multiple mirror actions
    Documentation: Clarify trap's description
    mlxsw: spectrum: Clear VLAN filters during port initialization
    net: ena: clean up indentation issue
    NFC: st95hf: clean up indentation issue
    net: phy: micrel: add Asym Pause workaround for KSZ9021
    net: socionext: ave: Avoid using netdev_err() before calling register_netdev()
    ptp: correctly disable flags on old ioctls
    lib: dimlib: fix help text typos
    net: dsa: microchip: Always set regmap stride to 1
    nfp: flower: fix memory leak in nfp_flower_spawn_vnic_reprs
    nfp: flower: prevent memory leak in nfp_flower_spawn_phy_reprs
    net/sched: Set default of CONFIG_NET_TC_SKB_EXT to N
    vrf: Do not attempt to create IPv6 mcast rule if IPv6 is disabled
    net: sched: sch_sfb: don't call qdisc_put() while holding tree lock
    ...

    Linus Torvalds
     

28 Sep, 2019

1 commit

  • Fix help text typos for DIMLIB.

    Fixes: 4f75da3666c0 ("linux/dim: Move implementation to .c files")
    Signed-off-by: Randy Dunlap
    Cc: Uwe Kleine-König
    Cc: Tal Gilboa
    Cc: Saeed Mahameed
    Acked-by: Uwe Kleine-König
    Signed-off-by: David S. Miller

    Randy Dunlap
     

27 Sep, 2019

1 commit

  • According to Tal Gilboa the only benefit from DIM comes from a driver
    that uses it. So it doesn't make sense to make this symbol user visible,
    instead all drivers that use it should select it (as is already the case
    AFAICT).

    Signed-off-by: Uwe Kleine-König
    Acked-by: Randy Dunlap
    Signed-off-by: David S. Miller

    Uwe Kleine-König
     

26 Sep, 2019

10 commits

  • Patch series "arm64: untag user pointers passed to the kernel", v19.

    === Overview

    arm64 has a feature called Top Byte Ignore, which allows to embed pointer
    tags into the top byte of each pointer. Userspace programs (such as
    HWASan, a memory debugging tool [1]) might use this feature and pass
    tagged user pointers to the kernel through syscalls or other interfaces.

    Right now the kernel is already able to handle user faults with tagged
    pointers, due to these patches:

    1. 81cddd65 ("arm64: traps: fix userspace cache maintenance emulation on a
    tagged pointer")
    2. 7dcd9dd8 ("arm64: hw_breakpoint: fix watchpoint matching for tagged
    pointers")
    3. 276e9327 ("arm64: entry: improve data abort handling of tagged
    pointers")

    This patchset extends tagged pointer support to syscall arguments.

    As per the proposed ABI change [3], tagged pointers are only allowed to be
    passed to syscalls when they point to memory ranges obtained by anonymous
    mmap() or sbrk() (see the patchset [3] for more details).

    For non-memory syscalls this is done by untaging user pointers when the
    kernel performs pointer checking to find out whether the pointer comes
    from userspace (most notably in access_ok). The untagging is done only
    when the pointer is being checked, the tag is preserved as the pointer
    makes its way through the kernel and stays tagged when the kernel
    dereferences the pointer when perfoming user memory accesses.

    The mmap and mremap (only new_addr) syscalls do not currently accept
    tagged addresses. Architectures may interpret the tag as a background
    colour for the corresponding vma.

    Other memory syscalls (mprotect, etc.) don't do user memory accesses but
    rather deal with memory ranges, and untagged pointers are better suited to
    describe memory ranges internally. Thus for memory syscalls we untag
    pointers completely when they enter the kernel.

    === Other approaches

    One of the alternative approaches to untagging that was considered is to
    completely strip the pointer tag as the pointer enters the kernel with
    some kind of a syscall wrapper, but that won't work with the countless
    number of different ioctl calls. With this approach we would need a
    custom wrapper for each ioctl variation, which doesn't seem practical.

    An alternative approach to untagging pointers in memory syscalls prologues
    is to inspead allow tagged pointers to be passed to find_vma() (and other
    vma related functions) and untag them there. Unfortunately, a lot of
    find_vma() callers then compare or subtract the returned vma start and end
    fields against the pointer that was being searched. Thus this approach
    would still require changing all find_vma() callers.

    === Testing

    The following testing approaches has been taken to find potential issues
    with user pointer untagging:

    1. Static testing (with sparse [2] and separately with a custom static
    analyzer based on Clang) to track casts of __user pointers to integer
    types to find places where untagging needs to be done.

    2. Static testing with grep to find parts of the kernel that call
    find_vma() (and other similar functions) or directly compare against
    vm_start/vm_end fields of vma.

    3. Static testing with grep to find parts of the kernel that compare
    user pointers with TASK_SIZE or other similar consts and macros.

    4. Dynamic testing: adding BUG_ON(has_tag(addr)) to find_vma() and running
    a modified syzkaller version that passes tagged pointers to the kernel.

    Based on the results of the testing the requried patches have been added
    to the patchset.

    === Notes

    This patchset is meant to be merged together with "arm64 relaxed ABI" [3].

    This patchset is a prerequisite for ARM's memory tagging hardware feature
    support [4].

    This patchset has been merged into the Pixel 2 & 3 kernel trees and is
    now being used to enable testing of Pixel phones with HWASan.

    Thanks!

    [1] http://clang.llvm.org/docs/HardwareAssistedAddressSanitizerDesign.html

    [2] https://github.com/lucvoo/sparse-dev/commit/5f960cb10f56ec2017c128ef9d16060e0145f292

    [3] https://lkml.org/lkml/2019/6/12/745

    [4] https://community.arm.com/processors/b/blog/posts/arm-a-profile-architecture-2018-developments-armv85a

    This patch (of 11)

    This patch is a part of a series that extends kernel ABI to allow to pass
    tagged user pointers (with the top byte set to something else other than
    0x00) as syscall arguments.

    strncpy_from_user and strnlen_user accept user addresses as arguments, and
    do not go through the same path as copy_from_user and others, so here we
    need to handle the case of tagged user addresses separately.

    Untag user pointers passed to these functions.

    Note, that this patch only temporarily untags the pointers to perform
    validity checks, but then uses them as is to perform user memory accesses.

    [andreyknvl@google.com: fix sparc4 build]
    Link: http://lkml.kernel.org/r/CAAeHK+yx4a-P0sDrXTUxMvO2H0CJZUFPffBrg_cU7oJOZyC7ew@mail.gmail.com
    Link: http://lkml.kernel.org/r/c5a78bcad3e94d6cda71fcaa60a423231ae71e4c.1563904656.git.andreyknvl@google.com
    Signed-off-by: Andrey Konovalov
    Reviewed-by: Vincenzo Frascino
    Reviewed-by: Khalid Aziz
    Acked-by: Kees Cook
    Reviewed-by: Catalin Marinas
    Cc: Al Viro
    Cc: Dave Hansen
    Cc: Eric Auger
    Cc: Felix Kuehling
    Cc: Jens Wiklander
    Cc: Mauro Carvalho Chehab
    Cc: Mike Rapoport
    Cc: Will Deacon
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrey Konovalov
     
  • Fix an unaligned access which breaks on platforms where this is not
    permitted (e.g., Sparc).

    Link: http://lkml.kernel.org/r/20190912145502.35229-1-dave.rodgman@arm.com
    Signed-off-by: Dave Rodgman
    Cc: Dave Rodgman
    Cc: Markus F.X.J. Oberhumer
    Cc: Minchan Kim
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dave Rodgman
     
  • The original clean up of "cut here" missed the WARN_ON() case (that does
    not have a printk message), which was fixed recently by adding an explicit
    printk of "cut here". This had the downside of adding a printk() to every
    WARN_ON() caller, which reduces the utility of using an instruction
    exception to streamline the resulting code. By making this a new BUGFLAG,
    all of these can be removed and "cut here" can be handled by the exception
    handler.

    This was very pronounced on PowerPC, but the effect can be seen on x86 as
    well. The resulting text size of a defconfig build shows some small
    savings from this patch:

    text data bss dec hex filename
    19691167 5134320 1646664 26472151 193eed7 vmlinux.before
    19676362 5134260 1663048 26473670 193f4c6 vmlinux.after

    This change also opens the door for creating something like BUG_MSG(),
    where a custom printk() before issuing BUG(), without confusing the "cut
    here" line.

    Link: http://lkml.kernel.org/r/201908200943.601DD59DCE@keescook
    Fixes: 6b15f678fb7d ("include/asm-generic/bug.h: fix "cut here" for WARN_ON for __WARN_TAINT architectures")
    Signed-off-by: Kees Cook
    Reported-by: Christophe Leroy
    Cc: Peter Zijlstra
    Cc: Christophe Leroy
    Cc: Drew Davenport
    Cc: Arnd Bergmann
    Cc: "Steven Rostedt (VMware)"
    Cc: Feng Tang
    Cc: Petr Mladek
    Cc: Mauro Carvalho Chehab
    Cc: Borislav Petkov
    Cc: YueHaibing
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kees Cook
     
  • Commit 9012d011660e ("compiler: allow all arches to enable
    CONFIG_OPTIMIZE_INLINING") allowed all architectures to enable this
    option. A couple of build errors were reported by randconfig, but all of
    them have been ironed out.

    Towards the goal of removing CONFIG_OPTIMIZE_INLINING entirely (and it
    will simplify the 'inline' macro in compiler_types.h), this commit changes
    it to always-on option. Going forward, the compiler will always be
    allowed to not inline functions marked 'inline'.

    This is not a problem for x86 since it has been long used by
    arch/x86/configs/{x86_64,i386}_defconfig.

    I am keeping the config option just in case any problem crops up for other
    architectures.

    The code clean-up will be done after confirming this is solid.

    Link: http://lkml.kernel.org/r/20190830034304.24259-1-yamada.masahiro@socionext.com
    Signed-off-by: Masahiro Yamada
    Acked-by: Nick Desaulniers
    Cc: Ingo Molnar
    Cc: Borislav Petkov
    Cc: Miguel Ojeda
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Masahiro Yamada
     
  • I'm seeing a bunch of debug prints from a user of print_hex_dump_bytes()
    in my kernel logs, but I don't have CONFIG_DYNAMIC_DEBUG enabled nor do I
    have DEBUG defined in my build. The problem is that
    print_hex_dump_bytes() calls a wrapper function in lib/hexdump.c that
    calls print_hex_dump() with KERN_DEBUG level. There are three cases to
    consider here

    1. CONFIG_DYNAMIC_DEBUG=y --> call dynamic_hex_dum()
    2. CONFIG_DYNAMIC_DEBUG=n && DEBUG --> call print_hex_dump()
    3. CONFIG_DYNAMIC_DEBUG=n && !DEBUG --> stub it out

    Right now, that last case isn't detected and we still call
    print_hex_dump() from the stub wrapper.

    Let's make print_hex_dump_bytes() only call print_hex_dump_debug() so that
    it works properly in all cases.

    Case #1, print_hex_dump_debug() calls dynamic_hex_dump() and we get same
    behavior. Case #2, print_hex_dump_debug() calls print_hex_dump() with
    KERN_DEBUG and we get the same behavior. Case #3, print_hex_dump_debug()
    is a nop, changing behavior to what we want, i.e. print nothing.

    Link: http://lkml.kernel.org/r/20190816235624.115280-1-swboyd@chromium.org
    Signed-off-by: Stephen Boyd
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Stephen Boyd
     
  • When building with W=1, a number of warnings are issued:

    CC lib/extable.o
    lib/extable.c:63:6: warning: no previous prototype for 'sort_extable' [-Wmissing-prototypes]
    63 | void sort_extable(struct exception_table_entry *start,
    | ^~~~~~~~~~~~
    lib/extable.c:75:6: warning: no previous prototype for 'trim_init_extable' [-Wmissing-prototypes]
    75 | void trim_init_extable(struct module *m)
    | ^~~~~~~~~~~~~~~~~
    lib/extable.c:115:1: warning: no previous prototype for 'search_extable' [-Wmissing-prototypes]
    115 | search_extable(const struct exception_table_entry *base,
    | ^~~~~~~~~~~~~~

    Add the missing #include for the prototypes.

    Link: http://lkml.kernel.org/r/45574.1565235784@turing-police
    Signed-off-by: Valdis Kletnieks
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Valdis Kletnieks
     
  • When building with W=1, we get some warnings:

    l CC lib/generic-radix-tree.o
    lib/generic-radix-tree.c:39:10: warning: no previous prototype for 'genradix_root_to_depth' [-Wmissing-prototypes]
    39 | unsigned genradix_root_to_depth(struct genradix_root *r)
    | ^~~~~~~~~~~~~~~~~~~~~~
    lib/generic-radix-tree.c:44:23: warning: no previous prototype for 'genradix_root_to_node' [-Wmissing-prototypes]
    44 | struct genradix_node *genradix_root_to_node(struct genradix_root *r)
    | ^~~~~~~~~~~~~~~~~~~~~

    They're not used anywhere else, so make them static inline.

    Link: http://lkml.kernel.org/r/46923.1565236485@turing-police
    Signed-off-by: Valdis Kletnieks
    Cc: Kent Overstreet
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Valdis Kletnieks
     
  • As already done for snprintf(), add a check in strscpy() for giant (i.e.
    likely negative and/or miscalculated) copy sizes, WARN, and error out.

    Link: http://lkml.kernel.org/r/201907260928.23DE35406@keescook
    Signed-off-by: Kees Cook
    Cc: Joe Perches
    Cc: Rasmus Villemoes
    Cc: Yann Droneaud
    Cc: David Laight
    Cc: Jonathan Corbet
    Cc: Stephen Kitt
    Cc: Jann Horn
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kees Cook
     
  • core-api should show all the various string functions including the newly
    added stracpy and stracpy_pad.

    Miscellanea:

    o Update the Returns: value for strscpy
    o fix a defect with %NUL)

    [joe@perches.com: correct return of -E2BIG descriptions]
    Link: http://lkml.kernel.org/r/29f998b4c1a9d69fbeae70500ba0daa4b340c546.1563889130.git.joe@perches.com
    Link: http://lkml.kernel.org/r/224a6ebf39955f4107c0c376d66155d970e46733.1563841972.git.joe@perches.com
    Signed-off-by: Joe Perches
    Reviewed-by: Kees Cook
    Cc: Jonathan Corbet
    Cc: Stephen Kitt
    Cc: Nitin Gote
    Cc: Rasmus Villemoes
    Cc: Jann Horn
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • Add RB_DECLARE_CALLBACKS_MAX, which generates augmented rbtree callbacks
    for the case where the augmented value is a scalar whose definition
    follows a max(f(node)) pattern. This actually covers all present uses of
    RB_DECLARE_CALLBACKS, and saves some (source) code duplication in the
    various RBCOMPUTE function definitions.

    [walken@google.com: fix mm/vmalloc.c]
    Link: http://lkml.kernel.org/r/CANN689FXgK13wDYNh1zKxdipeTuALG4eKvKpsdZqKFJ-rvtGiQ@mail.gmail.com
    [walken@google.com: re-add check to check_augmented()]
    Link: http://lkml.kernel.org/r/20190727022027.GA86863@google.com
    Link: http://lkml.kernel.org/r/20190703040156.56953-3-walken@google.com
    Signed-off-by: Michel Lespinasse
    Acked-by: Peter Zijlstra (Intel)
    Cc: David Howells
    Cc: Davidlohr Bueso
    Cc: Uladzislau Rezki
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Michel Lespinasse
     

25 Sep, 2019

7 commits

  • Patch series "mm: remove quicklist page table caches".

    A while ago Nicholas proposed to remove quicklist page table caches [1].

    I've rebased his patch on the curren upstream and switched ia64 and sh to
    use generic versions of PTE allocation.

    [1] https://lore.kernel.org/linux-mm/20190711030339.20892-1-npiggin@gmail.com

    This patch (of 3):

    Remove page table allocator "quicklists". These have been around for a
    long time, but have not got much traction in the last decade and are only
    used on ia64 and sh architectures.

    The numbers in the initial commit look interesting but probably don't
    apply anymore. If anybody wants to resurrect this it's in the git
    history, but it's unhelpful to have this code and divergent allocator
    behaviour for minor archs.

    Also it might be better to instead make more general improvements to page
    allocator if this is still so slow.

    Link: http://lkml.kernel.org/r/1565250728-21721-2-git-send-email-rppt@linux.ibm.com
    Signed-off-by: Nicholas Piggin
    Signed-off-by: Mike Rapoport
    Cc: Tony Luck
    Cc: Yoshinori Sato
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Nicholas Piggin
     
  • Patch series "Make working with compound pages easier", v2.

    These three patches add three helpers and convert the appropriate
    places to use them.

    This patch (of 3):

    It's unnecessarily hard to find out the size of a potentially huge page.
    Replace 'PAGE_SIZE << compound_order(page)' with page_size(page).

    Link: http://lkml.kernel.org/r/20190721104612.19120-2-willy@infradead.org
    Signed-off-by: Matthew Wilcox (Oracle)
    Acked-by: Michal Hocko
    Reviewed-by: Andrew Morton
    Reviewed-by: Ira Weiny
    Acked-by: Kirill A. Shutemov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Matthew Wilcox (Oracle)
     
  • In several places we need to be able to operate on pointers which have
    gone via a roundtrip:

    virt -> {phys,page} -> virt

    With KASAN_SW_TAGS, we can't preserve the tag for SLUB objects, and the
    {phys,page} -> virt conversion will use KASAN_TAG_KERNEL.

    This patch adds tests to ensure that this works as expected, without
    false positives which have recently been spotted [1,2] in testing.

    [1] https://lore.kernel.org/linux-arm-kernel/20190819114420.2535-1-walter-zh.wu@mediatek.com/
    [2] https://lore.kernel.org/linux-arm-kernel/20190819132347.GB9927@lakrids.cambridge.arm.com/

    [akpm@linux-foundation.org: coding-style fixes]
    Link: http://lkml.kernel.org/r/20190821153927.28630-1-mark.rutland@arm.com
    Signed-off-by: Mark Rutland
    Reviewed-by: Andrey Konovalov
    Tested-by: Andrey Konovalov
    Acked-by: Andrey Ryabinin
    Cc: Alexander Potapenko
    Cc: Dmitry Vyukov
    Cc: Will Deacon
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mark Rutland
     
  • Add memory corruption identification at bug report for software tag-based
    mode. The report shows whether it is "use-after-free" or "out-of-bound"
    error instead of "invalid-access" error. This will make it easier for
    programmers to see the memory corruption problem.

    We extend the slab to store five old free pointer tag and free backtrace,
    we can check if the tagged address is in the slab record and make a good
    guess if the object is more like "use-after-free" or "out-of-bound".
    therefore every slab memory corruption can be identified whether it's
    "use-after-free" or "out-of-bound".

    [aryabinin@virtuozzo.com: simplify & clenup code]
    Link: https://lkml.kernel.org/r/3318f9d7-a760-3cc8-b700-f06108ae745f@virtuozzo.com]
    Link: http://lkml.kernel.org/r/20190821180332.11450-1-aryabinin@virtuozzo.com
    Signed-off-by: Walter Wu
    Signed-off-by: Andrey Ryabinin
    Acked-by: Andrey Konovalov
    Cc: Dmitry Vyukov
    Cc: Alexander Potapenko
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Walter Wu
     
  • There are some machines with slow disk and fast CPUs. When they are under
    memory pressure, it could take a long time to swap before the OOM kicks in
    to free up some memory. As the results, it needs a large mem pool for
    kmemleak or suffering from higher chance of a kmemleak metadata allocation
    failure. 524288 proves to be the good number for all architectures here.
    Increase the upper bound to 1M to leave some room for the future.

    Link: http://lkml.kernel.org/r/1565807572-26041-1-git-send-email-cai@lca.pw
    Signed-off-by: Qian Cai
    Acked-by: Catalin Marinas
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Qian Cai
     
  • Currently kmemleak uses a static early_log buffer to trace all memory
    allocation/freeing before the slab allocator is initialised. Such early
    log is replayed during kmemleak_init() to properly initialise the kmemleak
    metadata for objects allocated up that point. With a memory pool that
    does not rely on the slab allocator, it is possible to skip this early log
    entirely.

    In order to remove the early logging, consider kmemleak_enabled == 1 by
    default while the kmem_cache availability is checked directly on the
    object_cache and scan_area_cache variables. The RCU callback is only
    invoked after object_cache has been initialised as we wouldn't have any
    concurrent list traversal before this.

    In order to reduce the number of callbacks before kmemleak is fully
    initialised, move the kmemleak_init() call to mm_init().

    [akpm@linux-foundation.org: coding-style fixes]
    [akpm@linux-foundation.org: remove WARN_ON(), per Catalin]
    Link: http://lkml.kernel.org/r/20190812160642.52134-4-catalin.marinas@arm.com
    Signed-off-by: Catalin Marinas
    Cc: Matthew Wilcox
    Cc: Michal Hocko
    Cc: Qian Cai
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Catalin Marinas
     
  • The current default value (400) is too low on many systems (e.g. some
    ARM64 platform takes up 1000+ entries).

    syzbot uses 16000 as default value, and has proved to be enough on beefy
    configurations, so let's pick that value.

    This consumes more RAM on boot (each entry is 160 bytes, so in total
    ~2.5MB of RAM), but the memory would later be freed (early_log is
    __initdata).

    Link: http://lkml.kernel.org/r/20190730154027.101525-1-drinkcat@chromium.org
    Signed-off-by: Nicolas Boichat
    Suggested-by: Dmitry Vyukov
    Acked-by: Catalin Marinas
    Acked-by: Dmitry Vyukov
    Cc: Masahiro Yamada
    Cc: Kees Cook
    Cc: Petr Mladek
    Cc: Thomas Gleixner
    Cc: Tetsuo Handa
    Cc: Joe Lawrence
    Cc: Uladzislau Rezki
    Cc: Andy Shevchenko
    Cc: Stephen Rothwell
    Cc: Andrey Ryabinin
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Nicolas Boichat
     

23 Sep, 2019

1 commit

  • Pull modules updates from Jessica Yu:
    "The main bulk of this pull request introduces a new exported symbol
    namespaces feature. The number of exported symbols is increasingly
    growing with each release (we're at about 31k exports as of 5.3-rc7)
    and we currently have no way of visualizing how these symbols are
    "clustered" or making sense of this huge export surface.

    Namespacing exported symbols allows kernel developers to more
    explicitly partition and categorize exported symbols, as well as more
    easily limiting the availability of namespaced symbols to other parts
    of the kernel. For starters, we have introduced the USB_STORAGE
    namespace to demonstrate the API's usage. I have briefly summarized
    the feature and its main motivations in the tag below.

    Summary:

    - Introduce exported symbol namespaces.

    This new feature allows subsystem maintainers to partition and
    categorize their exported symbols into explicit namespaces. Module
    authors are now required to import the namespaces they need.

    Some of the main motivations of this feature include: allowing
    kernel developers to better manage the export surface, allow
    subsystem maintainers to explicitly state that usage of some
    exported symbols should only be limited to certain users (think:
    inter-module or inter-driver symbols, debugging symbols, etc), as
    well as more easily limiting the availability of namespaced symbols
    to other parts of the kernel.

    With the module import requirement, it is also easier to spot the
    misuse of exported symbols during patch review.

    Two new macros are introduced: EXPORT_SYMBOL_NS() and
    EXPORT_SYMBOL_NS_GPL(). The API is thoroughly documented in
    Documentation/kbuild/namespaces.rst.

    - Some small code and kbuild cleanups here and there"

    * tag 'modules-for-v5.4' of git://git.kernel.org/pub/scm/linux/kernel/git/jeyu/linux:
    module: Remove leftover '#undef' from export header
    module: remove unneeded casts in cmp_name()
    module: move CONFIG_UNUSED_SYMBOLS to the sub-menu of MODULES
    module: remove redundant 'depends on MODULES'
    module: Fix link failure due to invalid relocation on namespace offset
    usb-storage: export symbols in USB_STORAGE namespace
    usb-storage: remove single-use define for debugging
    docs: Add documentation for Symbol Namespaces
    scripts: Coccinelle script for namespace dependencies.
    modpost: add support for generating namespace dependencies
    export: allow definition default namespaces in Makefiles or sources
    module: add config option MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS
    modpost: add support for symbol namespaces
    module: add support for symbol namespaces.
    export: explicitly align struct kernel_symbol
    module: support reading multiple values per modinfo tag

    Linus Torvalds
     

22 Sep, 2019

2 commits

  • Pull asm inline support from Miguel Ojeda:
    "Make use of gcc 9's "asm inline()" (Rasmus Villemoes):

    gcc 9+ (and gcc 8.3, 7.5) provides a way to override the otherwise
    crude heuristic that gcc uses to estimate the size of the code
    represented by an asm() statement. From the gcc docs

    If you use 'asm inline' instead of just 'asm', then for inlining
    purposes the size of the asm is taken as the minimum size, ignoring
    how many instructions GCC thinks it is.

    For compatibility with older compilers, we obviously want a

    #if [understands asm inline]
    #define asm_inline asm inline
    #else
    #define asm_inline asm
    #endif

    But since we #define the identifier inline to attach some attributes,
    we have to use an alternate spelling of that keyword. gcc provides
    both __inline__ and __inline, and we currently #define both to inline,
    so they all have the same semantics.

    We have to free up one of __inline__ and __inline, and the latter is
    by far the easiest.

    The two x86 changes cause smaller code gen differences than I'd
    expect, but I think we do want the asm_inline thing available sooner
    or later, so this is just to get the ball rolling"

    * tag 'compiler-attributes-for-linus-v5.4' of git://github.com/ojeda/linux:
    x86: bug.h: use asm_inline in _BUG_FLAGS definitions
    x86: alternative.h: use asm_inline for all alternative variants
    compiler-types.h: add asm_inline definition
    compiler_types.h: don't #define __inline
    lib/zstd/mem.h: replace __inline by inline
    staging: rtl8723bs: replace __inline by inline

    Linus Torvalds
     
  • Pull printk updates from Petr Mladek:

    - Fix off-by-one error when calculating messages that might fit into
    kmsg buffer. It causes occasional omitting of the last message.

    - Add missing pointer check in %pD format modifier handling.

    - Some clean up

    * tag 'printk-for-5.4' of git://git.kernel.org/pub/scm/linux/kernel/git/pmladek/printk:
    ABI: Update dev-kmsg documentation to match current kernel behaviour
    printk: Replace strncmp() with str_has_prefix()
    lib/test_printf: Remove obvious comments from %pd and %pD tests
    lib/test_printf: Add test of null/invalid pointer dereference for dentry
    vsprintf: Prevent crash when dereferencing invalid pointers for %pD
    printk: Do not lose last line in kmsg buffer dump

    Linus Torvalds