13 Oct, 2019

1 commit


09 Oct, 2019

2 commits

  • Out of the three nc implementations widely in use, at least two (BSD netcat
    and nmap-ncat) do not support -l combined with -s. Modify the nc invocation
    to be accepted by all of them.

    Fixes: 17a90a788473 ("selftests/bpf: test that GSO works in lwt_ip_encap")
    Signed-off-by: Jiri Benc
    Signed-off-by: Daniel Borkmann
    Link: https://lore.kernel.org/bpf/9f177682c387f3f943bb64d849e6c6774df3c5b4.1570539863.git.jbenc@redhat.com

    Jiri Benc
     
  • Many distributions enable rp_filter. However, the flow dissector test
    generates packets that have 1.1.1.1 set as (inner) source address without
    this address being reachable. This causes the selftest to fail.

    The selftests should not assume a particular initial configuration. Switch
    off rp_filter.

    Fixes: 50b3ed57dee9 ("selftests/bpf: test bpf flow dissection")
    Signed-off-by: Jiri Benc
    Signed-off-by: Daniel Borkmann
    Acked-by: Petar Penkov
    Link: https://lore.kernel.org/bpf/513a298f53e99561d2f70b2e60e2858ea6cda754.1570539863.git.jbenc@redhat.com

    Jiri Benc
     

05 Oct, 2019

3 commits

  • 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
     
  • nettest is missing from gitignore.

    Fixes: acda655fefae ("selftests: Add nettest")
    Signed-off-by: Jakub Kicinski
    Signed-off-by: David S. Miller

    Jakub Kicinski
     
  • Pull KVM fixes from Paolo Bonzini:
    "ARM and x86 bugfixes of all kinds.

    The most visible one is that migrating a nested hypervisor has always
    been busted on Broadwell and newer processors, and that has finally
    been fixed"

    * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (22 commits)
    KVM: x86: omit "impossible" pmu MSRs from MSR list
    KVM: nVMX: Fix consistency check on injected exception error code
    KVM: x86: omit absent pmu MSRs from MSR list
    selftests: kvm: Fix libkvm build error
    kvm: vmx: Limit guest PMCs to those supported on the host
    kvm: x86, powerpc: do not allow clearing largepages debugfs entry
    KVM: selftests: x86: clarify what is reported on KVM_GET_MSRS failure
    KVM: VMX: Set VMENTER_L1D_FLUSH_NOT_REQUIRED if !X86_BUG_L1TF
    selftests: kvm: add test for dirty logging inside nested guests
    KVM: x86: fix nested guest live migration with PML
    KVM: x86: assign two bits to track SPTE kinds
    KVM: x86: Expose XSAVEERPTR to the guest
    kvm: x86: Enumerate support for CLZERO instruction
    kvm: x86: Use AMD CPUID semantics for AMD vCPUs
    kvm: x86: Improve emulation of CPUID leaves 0BH and 1FH
    KVM: X86: Fix userspace set invalid CR4
    kvm: x86: Fix a spurious -E2BIG in __do_cpuid_func
    KVM: LAPIC: Loosen filter for adaptive tuning of lapic_timer_advance_ns
    KVM: arm/arm64: vgic: Use the appropriate TRACE_INCLUDE_PATH
    arm64: KVM: Kill hyp_alternate_select()
    ...

    Linus Torvalds
     

03 Oct, 2019

2 commits

  • Prior to this change an application sending 1 even
    if the application has enabled segmentation. I've also updated the
    relevant udpgso selftests.

    Fixes: bec1f6f69736 ("udp: generate gso with UDP_SEGMENT")
    Signed-off-by: Josh Hunt
    Reviewed-by: Willem de Bruijn
    Reviewed-by: Alexander Duyck
    Signed-off-by: David S. Miller

    Josh Hunt
     
  • Fix the following build error from "make TARGETS=kvm kselftest":

    libkvm.a(assert.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIC

    This error is seen when build is done from the main Makefile using
    kselftest target. In this case KBUILD_CPPFLAGS and CC_OPTION_CFLAGS
    are defined.

    When build is invoked using:

    "make -C tools/testing/selftests/kvm" KBUILD_CPPFLAGS and CC_OPTION_CFLAGS
    aren't defined.

    There is no need to pass in KBUILD_CPPFLAGS and CC_OPTION_CFLAGS for the
    check to determine if --no-pie is necessary, which is the case when these
    two aren't defined when "make -C tools/testing/selftests/kvm" runs.

    Fix it by simplifying the no-pie-option logic. With this change, both
    build variations work.

    "make TARGETS=kvm kselftest"
    "make -C tools/testing/selftests/kvm"

    Signed-off-by: Shuah Khan
    Signed-off-by: Paolo Bonzini

    Shuah Khan
     

02 Oct, 2019

2 commits


01 Oct, 2019

3 commits

  • bcc uses libbpf repo as a submodule. It brings in libbpf source
    code and builds everything together to produce shared libraries.
    With latest libbpf, I got the following errors:
    /bin/ld: libbcc_bpf.so.0.10.0: version node not found for symbol xsk_umem__create@LIBBPF_0.0.2
    /bin/ld: failed to set dynamic section sizes: Bad value
    collect2: error: ld returned 1 exit status
    make[2]: *** [src/cc/libbcc_bpf.so.0.10.0] Error 1

    In xsk.c, we have
    asm(".symver xsk_umem__create_v0_0_2, xsk_umem__create@LIBBPF_0.0.2");
    asm(".symver xsk_umem__create_v0_0_4, xsk_umem__create@@LIBBPF_0.0.4");
    The linker thinks the built is for LIBBPF but cannot find proper version
    LIBBPF_0.0.2/4, so emit errors.

    I also confirmed that using libbpf.a to produce a shared library also
    has issues:
    -bash-4.4$ cat t.c
    extern void *xsk_umem__create;
    void * test() { return xsk_umem__create; }
    -bash-4.4$ gcc -c -fPIC t.c
    -bash-4.4$ gcc -shared t.o libbpf.a -o t.so
    /bin/ld: t.so: version node not found for symbol xsk_umem__create@LIBBPF_0.0.2
    /bin/ld: failed to set dynamic section sizes: Bad value
    collect2: error: ld returned 1 exit status
    -bash-4.4$

    Symbol versioning does happens in commonly used libraries, e.g., elfutils
    and glibc. For static libraries, for a versioned symbol, the old definitions
    will be ignored, and the symbol will be an alias to the latest definition.
    For example, glibc sched_setaffinity is versioned.
    -bash-4.4$ readelf -s /usr/lib64/libc.so.6 | grep sched_setaffinity
    756: 000000000013d3d0 13 FUNC GLOBAL DEFAULT 13 sched_setaffinity@GLIBC_2.3.3
    757: 00000000000e2e70 455 FUNC GLOBAL DEFAULT 13 sched_setaffinity@@GLIBC_2.3.4
    1800: 0000000000000000 0 FILE LOCAL DEFAULT ABS sched_setaffinity.c
    4228: 00000000000e2e70 455 FUNC LOCAL DEFAULT 13 __sched_setaffinity_new
    4648: 000000000013d3d0 13 FUNC LOCAL DEFAULT 13 __sched_setaffinity_old
    7338: 000000000013d3d0 13 FUNC GLOBAL DEFAULT 13 sched_setaffinity@GLIBC_2
    7380: 00000000000e2e70 455 FUNC GLOBAL DEFAULT 13 sched_setaffinity@@GLIBC_
    -bash-4.4$
    For static library, the definition of sched_setaffinity aliases to the new definition.
    -bash-4.4$ readelf -s /usr/lib64/libc.a | grep sched_setaffinity
    File: /usr/lib64/libc.a(sched_setaffinity.o)
    8: 0000000000000000 455 FUNC GLOBAL DEFAULT 1 __sched_setaffinity_new
    12: 0000000000000000 455 FUNC WEAK DEFAULT 1 sched_setaffinity

    For both elfutils and glibc, additional macros are used to control different handling
    of symbol versioning w.r.t static and shared libraries.
    For elfutils, the macro is SYMBOL_VERSIONING
    (https://sourceware.org/git/?p=elfutils.git;a=blob;f=lib/eu-config.h).
    For glibc, the macro is SHARED
    (https://sourceware.org/git/?p=glibc.git;a=blob;f=include/shlib-compat.h;hb=refs/heads/master)

    This patch used SHARED as the macro name. After this patch, the libbpf.a has
    -bash-4.4$ readelf -s libbpf.a | grep xsk_umem__create
    372: 0000000000017145 1190 FUNC GLOBAL DEFAULT 1 xsk_umem__create_v0_0_4
    405: 0000000000017145 1190 FUNC GLOBAL DEFAULT 1 xsk_umem__create
    499: 00000000000175eb 103 FUNC GLOBAL DEFAULT 1 xsk_umem__create_v0_0_2
    -bash-4.4$
    No versioned symbols for xsk_umem__create.
    The libbpf.a can be used to build a shared library succesfully.
    -bash-4.4$ cat t.c
    extern void *xsk_umem__create;
    void * test() { return xsk_umem__create; }
    -bash-4.4$ gcc -c -fPIC t.c
    -bash-4.4$ gcc -shared t.o libbpf.a -o t.so
    -bash-4.4$

    Fixes: 10d30e301732 ("libbpf: add flags to umem config")
    Cc: Kevin Laatz
    Cc: Arnaldo Carvalho de Melo
    Cc: Andrii Nakryiko
    Acked-by: Andrii Nakryiko
    Signed-off-by: Yonghong Song
    Signed-off-by: Alexei Starovoitov

    Yonghong Song
     
  • Fix build failure:

    undefined reference to `pthread_create'
    collect2: error: ld returned 1 exit status

    Fix CFLAGS to include pthread correctly.

    Fixes: 740378dc7834 ("pidfd: add polling selftests")
    Signed-off-by: Shuah Khan
    Reviewed-by: Christian Brauner
    Cc:
    Link: https://lore.kernel.org/r/20190924195237.30519-1-skhan@linuxfoundation.org
    Signed-off-by: Christian Brauner

    Shuah Khan
     
  • Pull tracing fixes from Steven Rostedt:
    "A few more tracing fixes:

    - Fix a buffer overflow by checking nr_args correctly in probes

    - Fix a warning that is reported by clang

    - Fix a possible memory leak in error path of filter processing

    - Fix the selftest that checks for failures, but wasn't failing

    - Minor clean up on call site output of a memory trace event"

    * tag 'trace-v5.4-3' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
    selftests/ftrace: Fix same probe error test
    mm, tracing: Print symbol name for call_site in trace events
    tracing: Have error path in predicate_parse() free its allocated memory
    tracing: Fix clang -Wint-in-bool-context warnings in IF_ASSIGN macro
    tracing/probe: Fix to check the difference of nr_args before adding probe

    Linus Torvalds
     

30 Sep, 2019

2 commits

  • make TARGETS=bpf kselftest fails with:

    Makefile:127: tools/build/Makefile.include: No such file or directory

    When the bpf tool make is invoked from tools Makefile, srctree is
    cleared and the current logic check for srctree equals to empty
    string to determine srctree location from CURDIR.

    When the build in invoked from selftests/bpf Makefile, the srctree
    is set to "." and the same logic used for srctree equals to empty is
    needed to determine srctree.

    Check building_out_of_srctree undefined as the condition for both
    cases to fix "make TARGETS=bpf kselftest" build failure.

    Signed-off-by: Shuah Khan
    Signed-off-by: Daniel Borkmann
    Acked-by: Song Liu
    Link: https://lore.kernel.org/bpf/20190927011344.4695-1-skhan@linuxfoundation.org

    Shuah Khan
     
  • More libnvdimm updates from Dan Williams:

    - Complete the reworks to interoperate with powerpc dynamic huge page
    sizes

    - Fix a crash due to missed accounting for the powerpc 'struct
    page'-memmap mapping granularity

    - Fix badblock initialization for volatile (DRAM emulated) pmem ranges

    - Stop triggering request_key() notifications to userspace when
    NVDIMM-security is disabled / not present

    - Miscellaneous small fixups

    * tag 'libnvdimm-fixes-5.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm:
    libnvdimm/region: Enable MAP_SYNC for volatile regions
    libnvdimm: prevent nvdimm from requesting key when security is disabled
    libnvdimm/region: Initialize bad block for volatile namespaces
    libnvdimm/nfit_test: Fix acpi_handle redefinition
    libnvdimm/altmap: Track namespace boundaries in altmap
    libnvdimm: Fix endian conversion issues 
    libnvdimm/dax: Pick the right alignment default when creating dax devices
    powerpc/book3s64: Export has_transparent_hugepage() related functions.

    Linus Torvalds
     

29 Sep, 2019

4 commits

  • 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
     
  • The "same probe" selftest that tests that adding the same probe fails
    doesn't add the same probe and passes, which fails the test.

    Fixes: b78b94b82122 ("selftests/ftrace: Update kprobe event error testcase")
    Signed-off-by: Steven Rostedt (VMware)

    Steven Rostedt (VMware)
     
  • Pull powerpc fixes from Michael Ellerman:
    "An assortment of fixes that were either missed by me, or didn't arrive
    quite in time for the first v5.4 pull.

    - Most notable is a fix for an issue with tlbie (broadcast TLB
    invalidation) on Power9, when using the Radix MMU. The tlbie can
    race with an mtpid (move to PID register, essentially MMU context
    switch) on another thread of the core, which can cause stores to
    continue to go to a page after it's unmapped.

    - A fix in our KVM code to add a missing barrier, the lack of which
    has been observed to cause missed IPIs and subsequently stuck CPUs
    in the host.

    - A change to the way we initialise PCR (Processor Compatibility
    Register) to make it forward compatible with future CPUs.

    - On some older PowerVM systems our H_BLOCK_REMOVE support could
    oops, fix it to detect such systems and fallback to the old
    invalidation method.

    - A fix for an oops seen on some machines when using KASAN on 32-bit.

    - A handful of other minor fixes, and two new selftests.

    Thanks to: Alistair Popple, Aneesh Kumar K.V, Christophe Leroy,
    Gustavo Romero, Joel Stanley, Jordan Niethe, Laurent Dufour, Michael
    Roth, Oliver O'Halloran"

    * tag 'powerpc-5.4-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
    powerpc/eeh: Fix eeh eeh_debugfs_break_device() with SRIOV devices
    powerpc/nvdimm: use H_SCM_QUERY hcall on H_OVERLAP error
    powerpc/nvdimm: Use HCALL error as the return value
    selftests/powerpc: Add test case for tlbie vs mtpidr ordering issue
    powerpc/mm: Fixup tlbie vs mtpidr/mtlpidr ordering issue on POWER9
    powerpc/book3s64/radix: Rename CPU_FTR_P9_TLBIE_BUG feature flag
    powerpc/book3s64/mm: Don't do tlbie fixup for some hardware revisions
    powerpc/pseries: Call H_BLOCK_REMOVE when supported
    powerpc/pseries: Read TLB Block Invalidate Characteristics
    KVM: PPC: Book3S HV: use smp_mb() when setting/clearing host_ipi flag
    powerpc/mm: Fix an Oops in kasan_mmu_init()
    powerpc/mm: Add a helper to select PAGE_KERNEL_RO or PAGE_READONLY
    powerpc/64s: Set reserved PCR bits
    powerpc: Fix definition of PCR bits to work with old binutils
    powerpc/book3s64/radix: Remove WARN_ON in destroy_context()
    powerpc/tm: Add tm-poison test

    Linus Torvalds
     
  • Pull scheduler fixes from Ingo Molnar:

    - Apply a number of membarrier related fixes and cleanups, which fixes
    a use-after-free race in the membarrier code

    - Introduce proper RCU protection for tasks on the runqueue - to get
    rid of the subtle task_rcu_dereference() interface that was easy to
    get wrong

    - Misc fixes, but also an EAS speedup

    * 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    sched/fair: Avoid redundant EAS calculation
    sched/core: Remove double update_max_interval() call on CPU startup
    sched/core: Fix preempt_schedule() interrupt return comment
    sched/fair: Fix -Wunused-but-set-variable warnings
    sched/core: Fix migration to invalid CPU in __set_cpus_allowed_ptr()
    sched/membarrier: Return -ENOMEM to userspace on memory allocation failure
    sched/membarrier: Skip IPIs when mm->mm_users == 1
    selftests, sched/membarrier: Add multi-threaded test
    sched/membarrier: Fix p->mm->membarrier_state racy load
    sched/membarrier: Call sync_core only before usermode for same mm
    sched/membarrier: Remove redundant check
    sched/membarrier: Fix private expedited registration check
    tasks, sched/core: RCUify the assignment of rq->curr
    tasks, sched/core: With a grace period after finish_task_switch(), remove unnecessary code
    tasks, sched/core: Ensure tasks are available for a grace period after leaving the runqueue
    tasks: Add a count of task RCU users
    sched/core: Convert vcpu_is_preempted() from macro to an inline function
    sched/fair: Remove unused cfs_rq_clock_task() function

    Linus Torvalds
     

28 Sep, 2019

4 commits

  • Pull integrity updates from Mimi Zohar:
    "The major feature in this time is IMA support for measuring and
    appraising appended file signatures. In addition are a couple of bug
    fixes and code cleanup to use struct_size().

    In addition to the PE/COFF and IMA xattr signatures, the kexec kernel
    image may be signed with an appended signature, using the same
    scripts/sign-file tool that is used to sign kernel modules.

    Similarly, the initramfs may contain an appended signature.

    This contained a lot of refactoring of the existing appended signature
    verification code, so that IMA could retain the existing framework of
    calculating the file hash once, storing it in the IMA measurement list
    and extending the TPM, verifying the file's integrity based on a file
    hash or signature (eg. xattrs), and adding an audit record containing
    the file hash, all based on policy. (The IMA support for appended
    signatures patch set was posted and reviewed 11 times.)

    The support for appended signature paves the way for adding other
    signature verification methods, such as fs-verity, based on a single
    system-wide policy. The file hash used for verifying the signature and
    the signature, itself, can be included in the IMA measurement list"

    * 'next-integrity' of git://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-integrity:
    ima: ima_api: Use struct_size() in kzalloc()
    ima: use struct_size() in kzalloc()
    sefltest/ima: support appended signatures (modsig)
    ima: Fix use after free in ima_read_modsig()
    MODSIGN: make new include file self contained
    ima: fix freeing ongoing ahash_request
    ima: always return negative code for error
    ima: Store the measurement again when appraising a modsig
    ima: Define ima-modsig template
    ima: Collect modsig
    ima: Implement support for module-style appended signatures
    ima: Factor xattr_verify() out of ima_appraise_measurement()
    ima: Add modsig appraise_type option for module-style appended signatures
    integrity: Select CONFIG_KEYS instead of depending on it
    PKCS#7: Introduce pkcs7_get_digest()
    PKCS#7: Refactor verify_pkcs7_signature()
    MODSIGN: Export module signature definitions
    ima: initialize the "template" field with the default template

    Linus Torvalds
     
  • Pull more KVM updates from Paolo Bonzini:
    "x86 KVM changes:

    - The usual accuracy improvements for nested virtualization

    - The usual round of code cleanups from Sean

    - Added back optimizations that were prematurely removed in 5.2 (the
    bare minimum needed to fix the regression was in 5.3-rc8, here
    comes the rest)

    - Support for UMWAIT/UMONITOR/TPAUSE

    - Direct L2->L0 TLB flushing when L0 is Hyper-V and L1 is KVM

    - Tell Windows guests if SMT is disabled on the host

    - More accurate detection of vmexit cost

    - Revert a pvqspinlock pessimization"

    * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (56 commits)
    KVM: nVMX: cleanup and fix host 64-bit mode checks
    KVM: vmx: fix build warnings in hv_enable_direct_tlbflush() on i386
    KVM: x86: Don't check kvm_rebooting in __kvm_handle_fault_on_reboot()
    KVM: x86: Drop ____kvm_handle_fault_on_reboot()
    KVM: VMX: Add error handling to VMREAD helper
    KVM: VMX: Optimize VMX instruction error and fault handling
    KVM: x86: Check kvm_rebooting in kvm_spurious_fault()
    KVM: selftests: fix ucall on x86
    Revert "locking/pvqspinlock: Don't wait if vCPU is preempted"
    kvm: nvmx: limit atomic switch MSRs
    kvm: svm: Intercept RDPRU
    kvm: x86: Add "significant index" flag to a few CPUID leaves
    KVM: x86/mmu: Skip invalid pages during zapping iff root_count is zero
    KVM: x86/mmu: Explicitly track only a single invalid mmu generation
    KVM: x86/mmu: Revert "KVM: x86/mmu: Remove is_obsolete() call"
    KVM: x86/mmu: Revert "Revert "KVM: MMU: reclaim the zapped-obsolete page first""
    KVM: x86/mmu: Revert "Revert "KVM: MMU: collapse TLB flushes when zap all pages""
    KVM: x86/mmu: Revert "Revert "KVM: MMU: zap pages in batch""
    KVM: x86/mmu: Revert "Revert "KVM: MMU: add tracepoint for kvm_mmu_invalidate_all_pages""
    KVM: x86/mmu: Revert "Revert "KVM: MMU: show mmu_valid_gen in shadow page related tracepoints""
    ...

    Linus Torvalds
     
  • When a port is created, its VLAN filters are not cleared by the
    firmware. This causes tagged packets to be later dropped by the ingress
    STP filters, which default to DISCARD state.

    The above did not matter much until commit b5ce611fd96e ("mlxsw:
    spectrum: Add devlink-trap support") where we exposed the drop reason to
    users.

    Without this patch, the drop reason users will see is not consistent. If
    a port is enslaved to a VLAN-aware bridge and a packet with an invalid
    VLAN tries to ingress the bridge, it will be dropped due to ingress STP
    filter. If the VLAN is later enabled and then disabled, the packet will
    be dropped by the ingress VLAN filter despite the above being a
    seemingly NOP operation.

    Fix this by clearing all the VLAN filters during port initialization.
    Adjust the test accordingly.

    Fixes: b5ce611fd96e ("mlxsw: spectrum: Add devlink-trap support")
    Reported-by: Alex Kushnarov
    Tested-by: Alex Kushnarov
    Acked-by: Jiri Pirko
    Signed-off-by: Ido Schimmel
    Signed-off-by: David S. Miller

    Ido Schimmel
     
  • When KVM_GET_MSRS fail the report looks like

    ==== Test Assertion Failure ====
    lib/x86_64/processor.c:1089: r == nmsrs
    pid=28775 tid=28775 - Argument list too long
    1 0x000000000040a55f: vcpu_save_state at processor.c:1088 (discriminator 3)
    2 0x00000000004010e3: main at state_test.c:171 (discriminator 4)
    3 0x00007fb8e69223d4: ?? ??:0
    4 0x0000000000401287: _start at ??:?
    Unexpected result from KVM_GET_MSRS, r: 36 (failed at 194)

    and it's not obvious that '194' here is the failed MSR index and that
    it's printed in hex. Change that.

    Suggested-by: Sean Christopherson
    Signed-off-by: Vitaly Kuznetsov
    Signed-off-by: Paolo Bonzini

    Vitaly Kuznetsov
     

27 Sep, 2019

6 commits

  • Daniel Borkmann says:

    ====================
    pull-request: bpf 2019-09-27

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

    The main changes are:

    1) Fix libbpf's BTF dumper to not skip anonymous enum definitions, from Andrii.

    2) Fix BTF verifier issues when handling the BTF of vmlinux, from Alexei.

    3) Fix nested calls into bpf_event_output() from TCP sockops BPF
    programs, from Allan.

    4) Fix NULL pointer dereference in AF_XDP's xsk map creation when
    allocation fails, from Jonathan.

    5) Remove unneeded 64 byte alignment requirement of the AF_XDP UMEM
    headroom, from Bjorn.

    6) Remove unused XDP_OPTIONS getsockopt() call which results in an error
    on older kernels, from Toke.

    7) Fix a client/server race in tcp_rtt BPF kselftest case, from Stanislav.

    8) Fix indentation issue in BTF's btf_enum_check_kflag_member(), from Colin.
    ====================

    Signed-off-by: David S. Miller

    David S. Miller
     
  • Check that accesses by nested guests are logged according to the
    L1 physical addresses rather than L2.

    Most of the patch is really adding EPT support to the testing
    framework.

    Signed-off-by: Paolo Bonzini

    Paolo Bonzini
     
  • Pull more perf updates from Ingo Molnar:
    "The only kernel change is comment typo fixes.

    The rest is mostly tooling fixes, but also new vendor event additions
    and updates, a bigger libperf/libtraceevent library and a header files
    reorganization that came in a bit late"

    * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (108 commits)
    perf unwind: Fix libunwind build failure on i386 systems
    perf parser: Remove needless include directives
    perf build: Add detection of java-11-openjdk-devel package
    perf jvmti: Include JVMTI support for s390
    perf vendor events: Remove P8 HW events which are not supported
    perf evlist: Fix access of freed id arrays
    perf stat: Fix free memory access / memory leaks in metrics
    perf tools: Replace needless mmap.h with what is needed, event.h
    perf evsel: Move config terms to a separate header
    perf evlist: Remove unused perf_evlist__fprintf() method
    perf evsel: Introduce evsel_fprintf.h
    perf evsel: Remove need for symbol_conf in evsel_fprintf.c
    perf copyfile: Move copyfile routines to separate files
    libperf: Add perf_evlist__poll() function
    libperf: Add perf_evlist__add_pollfd() function
    libperf: Add perf_evlist__alloc_pollfd() function
    libperf: Add libperf_init() call to the tests
    libperf: Merge libperf_set_print() into libperf_init()
    libperf: Add libperf dependency for tests targets
    libperf: Use sys/types.h to get ssize_t, not unistd.h
    ...

    Linus Torvalds
     
  • Naresh Kamboju reported, that on the i386 build pr_err()
    doesn't get defined properly due to header ordering:

    perf-in.o: In function `libunwind__x86_reg_id':
    tools/perf/util/libunwind/../../arch/x86/util/unwind-libunwind.c:109:
    undefined reference to `pr_err'

    Reported-by: Naresh Kamboju
    Signed-off-by: Arnaldo Carvalho de Melo
    Cc: David Ahern
    Cc: Jiri Olsa
    Cc: Linus Torvalds
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: linux-kernel@vger.kernel.org
    Signed-off-by: Ingo Molnar

    Arnaldo Carvalho de Melo
     
  • …el/git/shuah/linux-kselftest

    Pull Kselftest updates from Shuah Khan:
    "Fixes to existing tests"

    * tag 'linux-kselftest-5.4-rc1.1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest:
    selftests: tpm2: install python files
    selftests: livepatch: add missing fragments to config
    selftests: watchdog: cleanup whitespace in usage options
    selftest/ftrace: Fix typo in trigger-snapshot.tc
    selftests: watchdog: Add optional file argument
    selftests/seccomp: fix build on older kernels
    selftests: use "$(MAKE)" instead of "make"

    Linus Torvalds
     
  • Merge more updates from Andrew Morton:

    - almost all of the rest of -mm

    - various other subsystems

    Subsystems affected by this patch series:
    memcg, misc, core-kernel, lib, checkpatch, reiserfs, fat, fork,
    cpumask, kexec, uaccess, kconfig, kgdb, bug, ipc, lzo, kasan, madvise,
    cleanups, pagemap

    * emailed patches from Andrew Morton : (77 commits)
    arch/sparc/include/asm/pgtable_64.h: fix build
    mm: treewide: clarify pgtable_page_{ctor,dtor}() naming
    ntfs: remove (un)?likely() from IS_ERR() conditions
    IB/hfi1: remove unlikely() from IS_ERR*() condition
    xfs: remove unlikely() from WARN_ON() condition
    wimax/i2400m: remove unlikely() from WARN*() condition
    fs: remove unlikely() from WARN_ON() condition
    xen/events: remove unlikely() from WARN() condition
    checkpatch: check for nested (un)?likely() calls
    hexagon: drop empty and unused free_initrd_mem
    mm: factor out common parts between MADV_COLD and MADV_PAGEOUT
    mm: introduce MADV_PAGEOUT
    mm: change PAGEREF_RECLAIM_CLEAN with PAGE_REFRECLAIM
    mm: introduce MADV_COLD
    mm: untag user pointers in mmap/munmap/mremap/brk
    vfio/type1: untag user pointers in vaddr_get_pfn
    tee/shm: untag user pointers in tee_shm_register
    media/v4l2-core: untag user pointers in videobuf_dma_contig_user_get
    drm/radeon: untag user pointers in radeon_gem_userptr_ioctl
    drm/amdgpu: untag user pointers
    ...

    Linus Torvalds
     

26 Sep, 2019

11 commits

  • BTF-to-C converter previously skipped anonymous enums in an assumption
    that those are embedded in struct's field definitions. This is not
    always the case and a lot of kernel constants are defined as part of
    anonymous enums. This change fixes the logic by eagerly marking all
    types as either referenced by any other type or not. This is enough to
    distinguish two classes of anonymous enums and emit previously omitted
    enum definitions.

    Signed-off-by: Andrii Nakryiko
    Signed-off-by: Daniel Borkmann
    Link: https://lore.kernel.org/bpf/20190925203745.3173184-1-andriin@fb.com

    Andrii Nakryiko
     
  • Commit 7d9e5f422150 removed references from certain dsts, but accounting
    for this never translated down into the fib6 suppression code. This bug
    was triggered by WireGuard users who use wg-quick(8), which uses the
    "suppress-prefix" directive to ip-rule(8) for routing all of their
    internet traffic without routing loops. The test case added here
    causes the reference underflow by causing packets to evaluate a suppress
    rule.

    Fixes: 7d9e5f422150 ("ipv6: convert major tx path to use RT6_LOOKUP_F_DST_NOREF")
    Signed-off-by: Jason A. Donenfeld
    Acked-by: Wei Wang
    Signed-off-by: David S. Miller

    Jason A. Donenfeld
     
  • Change the definition of the RBCOMPUTE function. The propagate callback
    repeatedly calls RBCOMPUTE as it moves from leaf to root. it wants to
    stop recomputing once the augmented subtree information doesn't change.
    This was previously checked using the == operator, but that only works
    when the augmented subtree information is a scalar field. This commit
    modifies the RBCOMPUTE function so that it now sets the augmented subtree
    information instead of returning it, and returns a boolean value
    indicating if the propagate callback should stop.

    The motivation for this change is that I want to introduce augmented
    rbtree uses where the augmented data for the subtree is a struct instead
    of a scalar.

    Link: http://lkml.kernel.org/r/20190703040156.56953-4-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
     
  • 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
     
  • Patch series "make RB_DECLARE_CALLBACKS more generic", v3.

    These changes are intended to make the RB_DECLARE_CALLBACKS macro more
    generic (allowing the aubmented subtree information to be a struct instead
    of a scalar).

    I have verified the compiled lib/interval_tree.o and mm/mmap.o files to
    check that they didn't change. This held as expected for interval_tree.o;
    mmap.o did have some changes which could be reverted by marking
    __vma_link_rb as noinline. I did not add such a change to the patchset; I
    felt it was reasonable enough to leave the inlining decision up to the
    compiler.

    This patch (of 3):

    Add a short comment summarizing the arguments to RB_DECLARE_CALLBACKS.
    The arguments are also now capitalized. This copies the style of the
    INTERVAL_TREE_DEFINE macro.

    No functional changes in this commit, only comments and capitalization.

    Link: http://lkml.kernel.org/r/20190703040156.56953-2-walken@google.com
    Signed-off-by: Michel Lespinasse
    Acked-by: Davidlohr Bueso
    Acked-by: Peter Zijlstra (Intel)
    Cc: David Howells
    Cc: Uladzislau Rezki
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Michel Lespinasse
     
  • As was already noted in rbtree.h, the logic to cache rb_first (or
    rb_last) can easily be implemented externally to the core rbtree api.

    This commit takes the changes applied to the include/linux/ and lib/
    rbtree files in 9f973cb38088 ("lib/rbtree: avoid generating code twice
    for the cached versions"), and applies these to the
    tools/include/linux/ and tools/lib/ files as well to keep them
    synchronized.

    Link: http://lkml.kernel.org/r/20190703034812.53002-1-walken@google.com
    Signed-off-by: Michel Lespinasse
    Cc: David Howells
    Cc: Davidlohr Bueso
    Cc: Peter Zijlstra (Intel)
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Michel Lespinasse
     
  • Some recent changes in latest Clang started causing the following
    warning when unrolling strobemeta test case main loop:

    progs/strobemeta.h:416:2: warning: loop not unrolled: the optimizer was
    unable to perform the requested transformation; the transformation might
    be disabled or specified as part of an unsupported transformation
    ordering [-Wpass-failed=transform-warning]

    This patch simplifies loop's exit condition to depend only on constant
    max iteration number (STROBE_MAX_MAP_ENTRIES), while moving early
    termination logic inside the loop body. The changes are equivalent from
    program logic standpoint, but fixes the warning. It also appears to
    improve generated BPF code, as it fixes previously failing non-unrolled
    strobemeta test cases.

    Cc: Alexei Starovoitov
    Signed-off-by: Andrii Nakryiko
    Signed-off-by: Daniel Borkmann

    Andrii Nakryiko
     
  • Remove no longer used variables and avoid compiler warnings.

    Signed-off-by: Andrii Nakryiko
    Signed-off-by: Daniel Borkmann

    Andrii Nakryiko
     
  • Some compilers emit warning for potential uninitialized next_id usage.
    The code is correct, but control flow is too complicated for some
    compilers to figure this out. Re-initialize next_id to satisfy
    compiler.

    Signed-off-by: Andrii Nakryiko
    Signed-off-by: Daniel Borkmann

    Andrii Nakryiko
     
  • This is the same problem I found earlier in test_sockopt_inherit:
    there is a race between server thread doing accept() and client
    thread doing connect(). Let's explicitly synchronize them via
    pthread conditional variable.

    v2:
    * don't exit from server_thread without signaling condvar,
    fixes possible issue where main() would wait forever (Andrii Nakryiko)

    Fixes: b55873984dab ("selftests/bpf: test BPF_SOCK_OPS_RTT_CB")
    Signed-off-by: Stanislav Fomichev
    Signed-off-by: Daniel Borkmann

    Stanislav Fomichev
     
  • They go on accumulating there like the debug.h one, that was introduced
    here:

    f23610245c1a ("perf list: Add debug support for outputing alias string")

    But then, when that need is removed via:

    2073ad3326b7 ("perf tools: Factor out PMU matching in parser")

    The thing stays there, so continue the house cleaning spree...

    list.h not needed, no macros from there are used, and 'struct
    list_head' is in linux/types.h, ditto for util.h, no need for that as
    well.

    Cc: Adrian Hunter
    Cc: Andi Kleen
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Link: https://lkml.kernel.org/n/tip-zkxr3mf6inun8m5mbnil4u0d@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo