20 Jan, 2021

2 commits

  • commit fab336b42441e0b2eb1d81becedb45fbdf99606e upstream.

    Fix nft_conntrack_helper.sh false fail report:

    1) Conntrack tool need "-f ipv6" parameter to show out ipv6 traffic items.

    2) Sleep 1 second after background nc send packet, to make sure check
    is after this statement executed.

    False report:
    FAIL: ns1-lkjUemYw did not show attached helper ip set via ruleset
    PASS: ns1-lkjUemYw connection on port 2121 has ftp helper attached
    ...

    After fix:
    PASS: ns1-2hUniwU2 connection on port 2121 has ftp helper attached
    PASS: ns2-2hUniwU2 connection on port 2121 has ftp helper attached
    ...

    Fixes: 619ae8e0697a6 ("selftests: netfilter: add test case for conntrack helper assignment")
    Signed-off-by: Chen Yi
    Signed-off-by: Pablo Neira Ayuso
    Signed-off-by: Greg Kroah-Hartman

    Chen Yi
     
  • [ Upstream commit 3503ee6c0bec5f173d606359e6384a5ef85492fb ]

    The udpgro.sh will always return 0 (unless the bpf selftest was not
    build first) even if there are some failed sub test-cases.

    Therefore the kselftest framework will report this case is OK.

    Check and return the exit status of each test to make it easier to
    spot real failures.

    Signed-off-by: Po-Hsu Lin
    Signed-off-by: David S. Miller
    Signed-off-by: Sasha Levin

    Po-Hsu Lin
     

17 Jan, 2021

3 commits

  • commit a5c9ca76a1c61fb5e4c35de8eb25aa925b03c9e4 upstream.

    For IPv6 traffic, mausezahn needs to be invoked with '-6'. Otherwise an
    error is returned:

    # ip netns exec me mausezahn veth1 -B 2001:db8:101::2 -A 2001:db8:91::1 -c 0 -t tcp "dp=1-1023, flags=syn"
    Failed to set source IPv4 address. Please check if source is set to a valid IPv4 address.
    Invalid command line parameters!

    Fixes: 7c741868ceab ("selftests: Add torture tests to nexthop tests")
    Signed-off-by: Ido Schimmel
    Reviewed-by: Petr Machata
    Reviewed-by: David Ahern
    Signed-off-by: Jakub Kicinski
    Signed-off-by: Greg Kroah-Hartman

    Ido Schimmel
     
  • commit 1a3449c19407a28f7019a887cdf0d6ba2444751a upstream.

    If Makefile cannot find any of the vmlinux's in its VMLINUX_BTF_PATHS list,
    it tries to run btftool incorrectly, with VMLINUX_BTF unset:

    bpftool btf dump file $(VMLINUX_BTF) format c

    Such that the keyword 'format' is misinterpreted as the path to vmlinux.
    The resulting build error message is fairly cryptic:

    GEN vmlinux.h
    Error: failed to load BTF from format: No such file or directory

    This patch makes the failure reason clearer by yielding this instead:

    Makefile:...: *** Cannot find a vmlinux for VMLINUX_BTF at any of
    "{paths}". Stop.

    Fixes: acbd06206bbb ("selftests/bpf: Add vmlinux.h selftest exercising tracing of syscalls")
    Signed-off-by: Kamal Mostafa
    Signed-off-by: Andrii Nakryiko
    Link: https://lore.kernel.org/bpf/20201215182011.15755-1-kamal@canonical.com
    Signed-off-by: Greg Kroah-Hartman

    Kamal Mostafa
     
  • [ Upstream commit 5316a7c0130acf09bfc8bb0092407006010fcccc ]

    Adds new 2 new tests to the PTMU script: pmtu_ipv4/6_route_change.

    These tests explicitly test for a recently discovered problem in the
    IPv6 routing framework where PMTU exceptions were not properly released
    when replacing a route via "ip route change ...".

    After creating PMTU exceptions, the route from the device A to R1 will be
    replaced with a new route, then device A will be deleted. If the PMTU
    exceptions were properly cleaned up by the kernel, this device deletion
    will succeed. Otherwise, the unregistration of the device will stall, and
    messages such as the following will be logged in dmesg:

    unregister_netdevice: waiting for veth_A-R1 to become free. Usage count = 4

    Signed-off-by: Sean Tranchetti
    Reviewed-by: David Ahern
    Link: https://lore.kernel.org/r/1609892546-11389-2-git-send-email-stranche@quicinc.com
    Signed-off-by: Jakub Kicinski
    Signed-off-by: Greg Kroah-Hartman

    Sean Tranchetti
     

13 Jan, 2021

2 commits

  • [ Upstream commit 7cf22a1c88c05ea3807f95b1edfebb729016ae52 ]

    Commit d8cbe8bfa7d ("tools/testing/selftests/vm: fix build error") tried
    to include a ARCH check for powerpc, however ARCH is not defined in the
    Makefile before including lib.mk. This makes test building to skip on
    both x86 and powerpc.

    Fix the arch check by replacing it using machine type as it is already
    defined and used in the test.

    Link: https://lkml.kernel.org/r/20201215100402.257376-1-harish@linux.ibm.com
    Fixes: d8cbe8bfa7d ("tools/testing/selftests/vm: fix build error")
    Signed-off-by: Harish
    Reviewed-by: Sandipan Das
    Cc: Shuah Khan
    Cc: Sandipan Das
    Cc: John Hubbard
    Cc: Dave Hansen
    Cc: Kirill A. Shutemov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds
    Signed-off-by: Sasha Levin

    Harish
     
  • [ Upstream commit 2ff2c7e274392871bfdee00ff2adbb8ebae5d240 ]

    The test was setting the headroom size of the wrong port. This was not
    visible because of a firmware bug that canceled this bug.

    Set the headroom size of the correct port, so that the test will pass
    with both old and new firmware versions.

    Fixes: bfa804784e32 ("selftests: mlxsw: Add a PFC test")
    Signed-off-by: Ido Schimmel
    Reviewed-by: Petr Machata
    Link: https://lore.kernel.org/r/20201230114251.394009-1-idosch@idosch.org
    Signed-off-by: Jakub Kicinski
    Signed-off-by: Greg Kroah-Hartman

    Ido Schimmel
     

30 Dec, 2020

6 commits

  • [ Upstream commit eceae70bdeaeb6b8ceb662983cf663ff352fbc96 ]

    strncat()'s third argument is how many bytes will be added *in addition* to
    already existing bytes in destination. Plus extra zero byte will be added
    after that. So existing use in test_sockmap has many opportunities to overflow
    the string and cause memory corruptions. And in this case, GCC complains for
    a good reason.

    Fixes: 16962b2404ac ("bpf: sockmap, add selftests")
    Fixes: 73563aa3d977 ("selftests/bpf: test_sockmap, print additional test options")
    Fixes: 1ade9abadfca ("bpf: test_sockmap, add options for msg_pop_data() helper")
    Fixes: 463bac5f1ca7 ("bpf, selftests: Add test for ktls with skb bpf ingress policy")
    Fixes: e9dd904708c4 ("bpf: add tls support for testing in test_sockmap")
    Fixes: 753fb2ee0934 ("bpf: sockmap, add msg_peek tests to test_sockmap")
    Signed-off-by: Andrii Nakryiko
    Signed-off-by: Alexei Starovoitov
    Link: https://lore.kernel.org/bpf/20201203235440.2302137-2-andrii@kernel.org
    Signed-off-by: Sasha Levin

    Andrii Nakryiko
     
  • [ Upstream commit 2c07343abd8932200a45ff7b10950e71081e9e77 ]

    seccomp_bpf.c uses unshare(CLONE_NEWPID), which requires CONFIG_PID_NS
    to be set.

    Cc: Kees Cook
    Cc: Shuah Khan
    Fixes: 6a21cc50f0c7 ("seccomp: add a return code to trap to userspace")
    Signed-off-by: Mickaël Salaün
    Acked-by: Tycho Andersen
    Signed-off-by: Kees Cook
    Link: https://lore.kernel.org/r/20201202162643.249276-1-mic@digikod.net
    Signed-off-by: Sasha Levin

    Mickaël Salaün
     
  • [ Upstream commit 6016df8fe874e1cf36f6357d71438b384198ce06 ]

    The selftests/bpf Makefile includes system include directories from
    the host, when building BPF programs. On RISC-V glibc requires that
    __riscv_xlen is defined. This is not the case for "clang -target bpf",
    which messes up __WORDSIZE (errno.h -> ... -> wordsize.h) and breaks
    the build.

    By explicitly defining __risc_xlen correctly for riscv, we can
    workaround this.

    Fixes: 167381f3eac0 ("selftests/bpf: Makefile fix "missing" headers on build with -idirafter")
    Signed-off-by: Björn Töpel
    Signed-off-by: Andrii Nakryiko
    Acked-by: Luke Nelson
    Link: https://lore.kernel.org/bpf/20201118071640.83773-2-bjorn.topel@gmail.com
    Signed-off-by: Sasha Levin

    Björn Töpel
     
  • [ Upstream commit 58cfa49c2ba7f815adccc27a775e7cf8a8f7f539 ]

    In comment 173ca26e9b51 ("samples/bpf: add comprehensive ipip, ipip6,
    ip6ip6 test") we added ip6ip6 test for bpf tunnel testing. But in commit
    933a741e3b82 ("selftests/bpf: bpf tunnel test.") when we moved it to
    the current folder, we didn't add it.

    This patch add the ip6ip6 test back to bpf tunnel test. Update the ipip6's
    topology for both IPv4 and IPv6 testing. Since iperf test is removed as
    currect framework simplified it in purpose, I also removed unused tcp
    checkings in test_tunnel_kern.c.

    Fixes: 933a741e3b82 ("selftests/bpf: bpf tunnel test.")
    Signed-off-by: Hangbin Liu
    Signed-off-by: Alexei Starovoitov
    Link: https://lore.kernel.org/bpf/20201110015013.1570716-2-liuhangbin@gmail.com
    Signed-off-by: Sasha Levin

    Hangbin Liu
     
  • [ Upstream commit 93f20eff0cca972d74cb554a2e8b47730228be16 ]

    Should be -d instead of -n for dry-run.

    Fixes: 5da1918446a1 ("selftests/run_kselftest.sh: Make each test individually selectable")
    Signed-off-by: Hangbin Liu
    Signed-off-by: Shuah Khan
    Signed-off-by: Sasha Levin

    Hangbin Liu
     
  • [ Upstream commit f0e5ba0bc481df77cf0afac2b33e420b33eeb463 ]

    The {inode,sk}_storage_result checking if the correct value was retrieved
    was being clobbered unconditionally by the return value of the
    bpf_{inode,sk}_storage_delete call.

    Also, consistently use the newly added BPF_LOCAL_STORAGE_GET_F_CREATE
    flag.

    Fixes: cd324d7abb3d ("bpf: Add selftests for local_storage")
    Signed-off-by: KP Singh
    Signed-off-by: Alexei Starovoitov
    Acked-by: Song Liu
    Link: https://lore.kernel.org/bpf/20201106103747.2780972-7-kpsingh@chromium.org
    Signed-off-by: Sasha Levin

    KP Singh
     

21 Dec, 2020

2 commits

  • commit 170f4869e66275f498ae4736106fb54c0fdcd036 upstream.

    The logic for truncating the log file for emailing based on the
    MAIL_MAX_SIZE option is confusing and incorrect. Simplify it and have the
    tail of the log file truncated to the max size specified in the config.

    Cc: stable@vger.kernel.org
    Fixes: 855d8abd2e8ff ("ktest.pl: Change the logic to control the size of the log file emailed")
    Signed-off-by: Steven Rostedt (VMware)
    Signed-off-by: Greg Kroah-Hartman

    Steven Rostedt (VMware)
     
  • commit 8cd6bc0359deebd8500e6de95899a8a78d3ec4ba upstream.

    If the size of the error log is too big to send via email, and the sending
    fails, it wont email any result. This can be confusing for the user who is
    waiting for an email on the completion of the tests.

    If it fails to send email, then try again without the log file stating that
    it failed to send an email. Obviously this will not be of use if the sending
    of email failed for some other reasons, but it will at least give the user
    some information when it fails for the most common reason.

    Cc: stable@vger.kernel.org
    Fixes: c2d84ddb338c8 ("ktest.pl: Add MAIL_COMMAND option to define how to send email")
    Signed-off-by: Steven Rostedt (VMware)
    Signed-off-by: Greg Kroah-Hartman

    Steven Rostedt (VMware)
     

13 Dec, 2020

1 commit

  • Pull kvm fixes from Paolo Bonzini:
    "Bugfixes for ARM, x86 and tools"

    * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
    tools/kvm_stat: Exempt time-based counters
    KVM: mmu: Fix SPTE encoding of MMIO generation upper half
    kvm: x86/mmu: Use cpuid to determine max gfn
    kvm: svm: de-allocate svm_cpu_data for all cpus in svm_cpu_uninit()
    selftests: kvm/set_memory_region_test: Fix race in move region test
    KVM: arm64: Add usage of stage 2 fault lookup level in user_mem_abort()
    KVM: arm64: Fix handling of merging tables into a block entry
    KVM: arm64: Fix memory leak on stage2 update of a valid PTE

    Linus Torvalds
     

11 Dec, 2020

7 commits

  • Pull ktest fix from Steven Rostedt:
    "Fix issues with grub2bls in ktest.pl

    ktest.pl did not know about grub2bls that was introduced in Fedora 30,
    and now it does"

    * tag 'ktest-v5.10-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-ktest:
    ktest.pl: Fix incorrect reboot for grub2bls

    Linus Torvalds
     
  • Pull networking fixes from David Miller:

    1) IPsec compat fixes, from Dmitry Safonov.

    2) Fix memory leak in xfrm_user_policy(). Fix from Yu Kuai.

    3) Fix polling in xsk sockets by using sk_poll_wait() instead of
    datagram_poll() which keys off of sk_wmem_alloc and such which xsk
    sockets do not update. From Xuan Zhuo.

    4) Missing init of rekey_data in cfgh80211, from Sara Sharon.

    5) Fix destroy of timer before init, from Davide Caratti.

    6) Missing CRYPTO_CRC32 selects in ethernet driver Kconfigs, from Arnd
    Bergmann.

    7) Missing error return in rtm_to_fib_config() switch case, from Zhang
    Changzhong.

    8) Fix some src/dest address handling in vrf and add a testcase. From
    Stephen Suryaputra.

    9) Fix multicast handling in Seville switches driven by mscc-ocelot
    driver. From Vladimir Oltean.

    10) Fix proto value passed to skb delivery demux in udp, from Xin Long.

    11) HW pkt counters not reported correctly in enetc driver, from Claudiu
    Manoil.

    12) Fix deadlock in bridge, from Joseph Huang.

    13) Missing of_node_pur() in dpaa2 driver, fromn Christophe JAILLET.

    14) Fix pid fetching in bpftool when there are a lot of results, from
    Andrii Nakryiko.

    15) Fix long timeouts in nft_dynset, from Pablo Neira Ayuso.

    16) Various stymmac fixes, from Fugang Duan.

    17) Fix null deref in tipc, from Cengiz Can.

    18) When mss is biog, coose more resonable rcvq_space in tcp, fromn Eric
    Dumazet.

    19) Revert a geneve change that likely isnt necessary, from Jakub
    Kicinski.

    20) Avoid premature rx buffer reuse in various Intel driversm from Björn
    Töpel.

    21) retain EcT bits during TIS reflection in tcp, from Wei Wang.

    22) Fix Tso deferral wrt. cwnd limiting in tcp, from Neal Cardwell.

    23) MPLS_OPT_LSE_LABEL attribute is 342 ot 8 bits, from Guillaume Nault

    24) Fix propagation of 32-bit signed bounds in bpf verifier and add test
    cases, from Alexei Starovoitov.

    * git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (81 commits)
    selftests: fix poll error in udpgro.sh
    selftests/bpf: Fix "dubious pointer arithmetic" test
    selftests/bpf: Fix array access with signed variable test
    selftests/bpf: Add test for signed 32-bit bound check bug
    bpf: Fix propagation of 32-bit signed bounds from 64-bit bounds.
    MAINTAINERS: Add entry for Marvell Prestera Ethernet Switch driver
    net: sched: Fix dump of MPLS_OPT_LSE_LABEL attribute in cls_flower
    net/mlx4_en: Handle TX error CQE
    net/mlx4_en: Avoid scheduling restart task if it is already running
    tcp: fix cwnd-limited bug for TSO deferral where we send nothing
    net: flow_offload: Fix memory leak for indirect flow block
    tcp: Retain ECT bits for tos reflection
    ethtool: fix stack overflow in ethnl_parse_bitset()
    e1000e: fix S0ix flow to allow S0i3.2 subset entry
    ice: avoid premature Rx buffer reuse
    ixgbe: avoid premature Rx buffer reuse
    i40e: avoid premature Rx buffer reuse
    igb: avoid transmit queue timeout in xdp path
    igb: use xdp_do_flush
    igb: skb add metasize for xdp
    ...

    Linus Torvalds
     
  • Alexei Starovoitov says:

    ====================
    pull-request: bpf 2020-12-10

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

    We've added 21 non-merge commits during the last 12 day(s) which contain
    a total of 21 files changed, 163 insertions(+), 88 deletions(-).

    The main changes are:

    1) Fix propagation of 32-bit signed bounds from 64-bit bounds, from Alexei.

    2) Fix ring_buffer__poll() return value, from Andrii.

    3) Fix race in lwt_bpf, from Cong.

    4) Fix test_offload, from Toke.

    5) Various xsk fixes.

    Please consider pulling these changes from:

    git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf.git

    Thanks a lot!

    Also thanks to reporters, reviewers and testers of commits in this pull-request:

    Cong Wang, Hulk Robot, Jakub Kicinski, Jean-Philippe Brucker, John
    Fastabend, Magnus Karlsson, Maxim Mikityanskiy, Yonghong Song
    ====================

    Signed-off-by: David S. Miller

    David S. Miller
     
  • The test program udpgso_bench_rx always invokes the poll()
    syscall with a timeout of 10ms. If a larger timeout is specified
    via the command line, udpgso_bench_rx is supposed to do multiple
    poll() calls till the timeout is expired or an event is received.

    Currently the poll() loop errors out after the first invocation with
    no events, and may causes self-tests failure alike:

    failed
    GRO with custom segment size ./udpgso_bench_rx: poll: 0x0 expected 0x1

    This change addresses the issue allowing the poll() loop to consume
    all the configured timeout.

    Fixes: ada641ff6ed3 ("selftests: fixes for UDP GRO")
    Signed-off-by: Paolo Abeni
    Signed-off-by: David S. Miller

    Paolo Abeni
     
  • The verifier trace changed following a bugfix. After checking the 64-bit
    sign, only the upper bit mask is known, not bit 31. Update the test
    accordingly.

    Signed-off-by: Jean-Philippe Brucker
    Acked-by: John Fastabend
    Signed-off-by: Alexei Starovoitov

    Jean-Philippe Brucker
     
  • The test fails because of a recent fix to the verifier, even though this
    program is valid. In details what happens is:

    7: (61) r1 = *(u32 *)(r0 +0)

    Load a 32-bit value, with signed bounds [S32_MIN, S32_MAX]. The bounds
    of the 64-bit value are [0, U32_MAX]...

    8: (65) if r1 s> 0xffffffff goto pc+1

    ... therefore this is always true (the operand is sign-extended).

    10: (b4) w2 = 11
    11: (6d) if r2 s> r1 goto pc+1

    When true, the 64-bit bounds become [0, 10]. The 32-bit bounds are still
    [S32_MIN, 10].

    13: (64) w1 <
    Acked-by: John Fastabend
    Signed-off-by: Alexei Starovoitov

    Jean-Philippe Brucker
     
  • After a 32-bit load followed by a branch, the verifier would reduce the
    maximum bound of the register to 0x7fffffff, allowing a user to bypass
    bound checks. Ensure such a program is rejected.

    In the second test, the 64-bit compare should not sufficient to
    determine whether the signed 32-bit lower bound is 0, so the verifier
    should reject the second branch.

    Signed-off-by: Jean-Philippe Brucker
    Acked-by: John Fastabend
    Signed-off-by: Alexei Starovoitov

    Jean-Philippe Brucker
     

09 Dec, 2020

5 commits

  • A few of the tests in test_offload.py expects to see a certain number of
    maps created, and checks this by counting the number of maps returned by
    bpftool. There is already a filter that will remove any maps already there
    at the beginning of the test, but bpftool now creates a map for the PID
    iterator rodata on each invocation, which makes the map count wrong. Fix
    this by also filtering the pid_iter.rodata map by name when counting.

    Fixes: d53dee3fe013 ("tools/bpftool: Show info for processes holding BPF map/prog/link/btf FDs")
    Signed-off-by: Toke Høiland-Jørgensen
    Signed-off-by: Daniel Borkmann
    Acked-by: Jakub Kicinski
    Link: https://lore.kernel.org/bpf/160752226387.110217.9887866138149423444.stgit@toke.dk

    Toke Høiland-Jørgensen
     
  • When setting the ethtool feature flag fails (as expected for the test), the
    kernel now tracks that the feature was requested to be 'off' and refuses to
    subsequently disable it again. So reset it back to 'on' so a subsequent
    disable (that's not supposed to fail) can succeed.

    Fixes: 417ec26477a5 ("selftests/bpf: add offload test based on netdevsim")
    Signed-off-by: Toke Høiland-Jørgensen
    Signed-off-by: Daniel Borkmann
    Acked-by: Jakub Kicinski
    Link: https://lore.kernel.org/bpf/160752226280.110217.10696241563705667871.stgit@toke.dk

    Toke Høiland-Jørgensen
     
  • Commit 7f0a838254bd ("bpf, xdp: Maintain info on attached XDP BPF programs
    in net_device") changed the case of some of the extack messages being
    returned when attaching of XDP programs failed. This broke test_offload.py,
    so let's fix the test to reflect this.

    Fixes: 7f0a838254bd ("bpf, xdp: Maintain info on attached XDP BPF programs in net_device")
    Signed-off-by: Toke Høiland-Jørgensen
    Signed-off-by: Daniel Borkmann
    Acked-by: Jakub Kicinski
    Link: https://lore.kernel.org/bpf/160752226175.110217.11214100824416344952.stgit@toke.dk

    Toke Høiland-Jørgensen
     
  • Since commit 6f8a57ccf851 ("bpf: Make verifier log more relevant by
    default"), the verifier discards log messages for successfully-verified
    programs. This broke test_offload.py which is looking for a verification
    message from the driver callback. Change test_offload.py to use the toggle
    in netdevsim to make the verification fail before looking for the
    verification message.

    Fixes: 6f8a57ccf851 ("bpf: Make verifier log more relevant by default")
    Signed-off-by: Toke Høiland-Jørgensen
    Signed-off-by: Daniel Borkmann
    Acked-by: Jakub Kicinski
    Link: https://lore.kernel.org/bpf/160752226069.110217.12370824996153348073.stgit@toke.dk

    Toke Høiland-Jørgensen
     
  • Since we just removed the xdp_attachment_flags_ok() callback, also remove
    the check for it in test_offload.py, and replace it with a test for the new
    ambiguity-avoid check when multiple programs are loaded.

    Fixes: 7f0a838254bd ("bpf, xdp: Maintain info on attached XDP BPF programs in net_device")
    Signed-off-by: Toke Høiland-Jørgensen
    Signed-off-by: Daniel Borkmann
    Acked-by: Jakub Kicinski
    Link: https://lore.kernel.org/bpf/160752225858.110217.13036901876869496246.stgit@toke.dk

    Toke Høiland-Jørgensen
     

07 Dec, 2020

2 commits

  • The error handling in hugetlb_allocate_area() was incorrect for the
    hugetlb_shared test case.

    Previously the behavior was:

    - mmap a hugetlb area
    - If this fails, set the pointer to NULL, and carry on
    - mmap an alias of the same hugetlb fd
    - If this fails, munmap the original area

    If the original mmap failed, it's likely the second one did too. If
    both failed, we'd blindly try to munmap a NULL pointer, causing a
    SIGSEGV. Instead, "goto fail" so we return before trying to mmap the
    alias.

    This issue can be hit "in real life" by forgetting to set
    /proc/sys/vm/nr_hugepages (leaving it at 0), and then trying to run the
    hugetlb_shared test.

    Another small improvement is, when the original mmap fails, don't just
    print "it failed": perror(), so we can see *why*. :)

    Signed-off-by: Axel Rasmussen
    Signed-off-by: Andrew Morton
    Cc: Shuah Khan
    Cc: Peter Xu
    Cc: Joe Perches
    Cc: Mike Rapoport
    Cc: Andrea Arcangeli
    Cc: David Alan Gilbert
    Link: https://lkml.kernel.org/r/20201204203443.2714693-1-axelrasmussen@google.com
    Signed-off-by: Linus Torvalds

    Axel Rasmussen
     
  • Only x86 and PowerPC implement the pkey-xxx.h, and an error was reported
    when compiling protection_keys.c.

    Add a Arch judgment to compile "protection_keys" in the Makefile.

    If other arch implement this, add the arch name to the Makefile.
    eg:
    ifneq (,$(findstring $(ARCH),powerpc mips ... ))

    Following build errors:

    pkey-helpers.h:93:2: error: #error Architecture not supported
    #error Architecture not supported
    pkey-helpers.h:96:20: error: `PKEY_DISABLE_ACCESS' undeclared
    #define PKEY_MASK (PKEY_DISABLE_ACCESS | PKEY_DISABLE_WRITE)
    ^
    protection_keys.c:218:45: error: `PKEY_DISABLE_WRITE' undeclared
    pkey_assert(flags & (PKEY_DISABLE_ACCESS | PKEY_DISABLE_WRITE));
    ^

    Signed-off-by: Xingxing Su
    Signed-off-by: Andrew Morton
    Cc: Shuah Khan
    Cc: Sandipan Das
    Cc: John Hubbard
    Cc: Dave Hansen
    Cc: "Kirill A. Shutemov"
    Cc: Brian Geffon
    Cc: Mina Almasry
    Link: https://lkml.kernel.org/r/1606826876-30656-1-git-send-email-suxingxing@loongson.cn
    Signed-off-by: Linus Torvalds

    Xingxing Su
     

06 Dec, 2020

1 commit

  • Depending on the order of the routes to fe80::/64 are installed on the
    VRF table, the NS for the source link-local address of the originator
    might be sent to the wrong interface.

    This patch ensures that packets with link-local addr source is doing a
    lookup with the orig_iif when the destination addr indicates that it
    is strict.

    Add the reproducer as a use case in self test script fcnal-test.sh.

    Fixes: b4869aa2f881 ("net: vrf: ipv6 support for local traffic to local addresses")
    Signed-off-by: Stephen Suryaputra
    Reviewed-by: David Ahern
    Link: https://lore.kernel.org/r/20201204030604.18828-1-ssuryaextr@gmail.com
    Signed-off-by: Jakub Kicinski

    Stephen Suryaputra
     

04 Dec, 2020

1 commit

  • The current memory region move test correctly handles the situation that
    the second (realigning) memslot move operation would temporarily trigger
    MMIO until it completes, however it does not handle the case in which the
    first (misaligning) move operation does this, too.
    This results in false test assertions in case it does so.

    Fix this by handling temporary MMIO from the first memslot move operation
    in the test guest code, too.

    Fixes: 8a0639fe9201 ("KVM: sefltests: Add explicit synchronization to move mem region test")
    Signed-off-by: Maciej S. Szmigiero
    Message-Id:
    Signed-off-by: Paolo Bonzini

    Maciej S. Szmigiero
     

02 Dec, 2020

2 commits

  • Avoid occasional test failures due to the last sample being delayed to
    another ring_buffer__poll() call. Instead, drain samples completely with
    ring_buffer__consume(). This is supposed to fix a rare and non-deterministic
    test failure in libbpf CI.

    Fixes: cb1c9ddd5525 ("selftests/bpf: Add BPF ringbuf selftests")
    Signed-off-by: Andrii Nakryiko
    Signed-off-by: Alexei Starovoitov
    Link: https://lore.kernel.org/bpf/20201130223336.904192-2-andrii@kernel.org

    Andrii Nakryiko
     
  • Fix ring_buffer__poll() to return the number of non-discarded records
    consumed, just like its documentation states. It's also consistent with
    ring_buffer__consume() return. Fix up selftests with wrong expected results.

    Fixes: bf99c936f947 ("libbpf: Add BPF ring buffer support")
    Fixes: cb1c9ddd5525 ("selftests/bpf: Add BPF ringbuf selftests")
    Signed-off-by: Andrii Nakryiko
    Signed-off-by: Alexei Starovoitov
    Link: https://lore.kernel.org/bpf/20201130223336.904192-1-andrii@kernel.org

    Andrii Nakryiko
     

01 Dec, 2020

1 commit

  • This issue was first noticed when I was testing different kernels on
    Oracle Linux 8 which as Fedora 30+ adopts BLS as default. Even though a
    kernel entry was added successfully and the index of that kernel entry was
    retrieved correctly, ktest still wouldn't reboot the system into
    user-specified kernel.

    The bug was spotted in subroutine reboot_to where the if-statement never
    checks for REBOOT_TYPE "grub2bls", therefore the desired entry will not be
    set for the next boot.

    Add a check for "grub2bls" so that $grub_reboot $grub_number can
    be run before a reboot if REBOOT_TYPE is "grub2bls" then we can boot to
    the correct kernel.

    Link: https://lkml.kernel.org/r/20201121021243.1532477-1-libo.chen@oracle.com

    Cc: stable@vger.kernel.org
    Fixes: ac2466456eaa ("ktest: introduce grub2bls REBOOT_TYPE option")
    Signed-off-by: Libo Chen
    Signed-off-by: Steven Rostedt (VMware)

    Libo Chen
     

29 Nov, 2020

1 commit

  • a proper kernel configuration for running kselftest can be obtained with:

    $ yes | make kselftest-merge

    enable compile support for the 'red' qdisc: otherwise, tdc kselftest fail
    when trying to run tdc test items contained in red.json.

    Signed-off-by: Davide Caratti
    Link: https://lore.kernel.org/r/cfa23f2d4f672401e6cebca3a321dd1901a9ff07.1606416464.git.dcaratti@redhat.com
    Signed-off-by: Jakub Kicinski

    Davide Caratti
     

22 Nov, 2020

1 commit

  • Pull seccomp fixes from Kees Cook:
    "This gets the seccomp selftests running again on powerpc and sh, and
    fixes an audit reporting oversight noticed in both seccomp and ptrace.

    - Fix typos in seccomp selftests on powerpc and sh (Kees Cook)

    - Fix PF_SUPERPRIV audit marking in seccomp and ptrace (Mickaël
    Salaün)"

    * tag 'seccomp-v5.10-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
    selftests/seccomp: sh: Fix register names
    selftests/seccomp: powerpc: Fix typo in macro variable name
    seccomp: Set PF_SUPERPRIV when checking capability
    ptrace: Set PF_SUPERPRIV when checking capability

    Linus Torvalds
     

21 Nov, 2020

2 commits

  • It looks like the seccomp selftests was never actually built for sh.
    This fixes it, though I don't have an environment to do a runtime test
    of it yet.

    Fixes: 0bb605c2c7f2b4b3 ("sh: Add SECCOMP_FILTER")
    Tested-by: John Paul Adrian Glaubitz
    Link: https://lore.kernel.org/lkml/a36d7b48-6598-1642-e403-0c77a86f416d@physik.fu-berlin.de
    Signed-off-by: Kees Cook

    Kees Cook
     
  • A typo sneaked into the powerpc selftest. Fix the name so it builds again.

    Fixes: 46138329faea ("selftests/seccomp: powerpc: Fix seccomp return value testing")
    Acked-by: Michael Ellerman
    Link: https://lore.kernel.org/lkml/87y2ix2895.fsf@mpe.ellerman.id.au
    Signed-off-by: Kees Cook

    Kees Cook
     

20 Nov, 2020

1 commit

  • Pull networking fixes from Jakub Kicinski:
    "Networking fixes for 5.10-rc5, including fixes from the WiFi
    (mac80211), can and bpf (including the strncpy_from_user fix).

    Current release - regressions:

    - mac80211: fix memory leak of filtered powersave frames

    - mac80211: free sta in sta_info_insert_finish() on errors to avoid
    sleeping in atomic context

    - netlabel: fix an uninitialized variable warning added in -rc4

    Previous release - regressions:

    - vsock: forward all packets to the host when no H2G is registered,
    un-breaking AWS Nitro Enclaves

    - net: Exempt multicast addresses from five-second neighbor lifetime
    requirement, decreasing the chances neighbor tables fill up

    - net/tls: fix corrupted data in recvmsg

    - qed: fix ILT configuration of SRC block

    - can: m_can: process interrupt only when not runtime suspended

    Previous release - always broken:

    - page_frag: Recover from memory pressure by not recycling pages
    allocating from the reserves

    - strncpy_from_user: Mask out bytes after NUL terminator

    - ip_tunnels: Set tunnel option flag only when tunnel metadata is
    present, always setting it confuses Open vSwitch

    - bpf, sockmap:
    - Fix partial copy_page_to_iter so progress can still be made
    - Fix socket memory accounting and obeying SO_RCVBUF

    - net: Have netpoll bring-up DSA management interface

    - net: bridge: add missing counters to ndo_get_stats64 callback

    - tcp: brr: only postpone PROBE_RTT if RTT is < current min_rtt

    - enetc: Workaround MDIO register access HW bug

    - net/ncsi: move netlink family registration to a subsystem init,
    instead of tying it to driver probe

    - net: ftgmac100: unregister NC-SI when removing driver to avoid
    crash

    - lan743x:
    - prevent interrupt storm on open
    - fix freeing skbs in the wrong context

    - net/mlx5e: Fix socket refcount leak on kTLS RX resync

    - net: dsa: mv88e6xxx: Avoid VLAN database corruption on 6097

    - fix 21 unset return codes and other mistakes on error paths, mostly
    detected by the Hulk Robot"

    * tag 'net-5.10-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (115 commits)
    fail_function: Remove a redundant mutex unlock
    selftest/bpf: Test bpf_probe_read_user_str() strips trailing bytes after NUL
    lib/strncpy_from_user.c: Mask out bytes after NUL terminator.
    net/smc: fix direct access to ib_gid_addr->ndev in smc_ib_determine_gid()
    net/smc: fix matching of existing link groups
    ipv6: Remove dependency of ipv6_frag_thdr_truncated on ipv6 module
    libbpf: Fix VERSIONED_SYM_COUNT number parsing
    net/mlx4_core: Fix init_hca fields offset
    atm: nicstar: Unmap DMA on send error
    page_frag: Recover from memory pressure
    net: dsa: mv88e6xxx: Wait for EEPROM done after HW reset
    mlxsw: core: Use variable timeout for EMAD retries
    mlxsw: Fix firmware flashing
    net: Have netpoll bring-up DSA management interface
    atl1e: fix error return code in atl1e_probe()
    atl1c: fix error return code in atl1c_probe()
    ah6: fix error return code in ah6_input()
    net: usb: qmi_wwan: Set DTR quirk for MR400
    can: m_can: process interrupt only when not runtime suspended
    can: flexcan: flexcan_chip_start(): fix erroneous flexcan_transceiver_enable() during bus-off recovery
    ...

    Linus Torvalds