01 Oct, 2020

4 commits

  • [ Upstream commit a61fa2799ef9bf6c4f54cf7295036577cececc72 ]

    Clear the weird flags before logging to improve strace output --
    logging results while, say, TF is set does no one any favors.

    Signed-off-by: Andy Lutomirski
    Signed-off-by: Thomas Gleixner
    Link: https://lkml.kernel.org/r/907bfa5a42d4475b8245e18b67a04b13ca51ffdb.1593191971.git.luto@kernel.org
    Signed-off-by: Sasha Levin

    Andy Lutomirski
     
  • [ Upstream commit 2de4e82318c7f9d34f4b08599a612cd4cd10bf0b ]

    This adds test cases for ptrace deadlocks.

    Additionally fixes a compile problem in get_syscall_info.c,
    observed with gcc-4.8.4:

    get_syscall_info.c: In function 'get_syscall_info':
    get_syscall_info.c:93:3: error: 'for' loop initial declarations are only
    allowed in C99 mode
    for (unsigned int i = 0; i < ARRAY_SIZE(args); ++i) {
    ^
    get_syscall_info.c:93:3: note: use option -std=c99 or -std=gnu99 to compile
    your code

    Signed-off-by: Bernd Edlinger
    Reviewed-by: Kees Cook
    Signed-off-by: Eric W. Biederman
    Signed-off-by: Sasha Levin

    Bernd Edlinger
     
  • [ Upstream commit af4ddd607dff7aabd466a4a878e01b9f592a75ab ]

    test.d/ftrace/func-filter-glob.tc is failing on s390 because it has
    ARCH_INLINE_SPIN_LOCK and friends set to 'y'. So the usual
    __raw_spin_lock symbol isn't in the ftrace function list. Change
    '*aw*lock' to '*spin*lock' which would hopefully match some of the
    locking functions on all platforms.

    Reviewed-by: Steven Rostedt (VMware)
    Signed-off-by: Sven Schnelle
    Signed-off-by: Shuah Khan
    Signed-off-by: Sasha Levin

    Sven Schnelle
     
  • [ Upstream commit ef8c84effce3c7a0b8196fcda8f430c815ab511c ]

    It looks like BPF program that handles BPF_SOCK_OPS_STATE_CB state
    can race with the bpf_map_lookup_elem("global_map"); I sometimes
    see the failures in this test and re-running helps.

    Since we know that we expect the callback to be called 3 times (one
    time for listener socket, two times for both ends of the connection),
    let's export this number and add simple retry logic around that.

    Also, let's make EXPECT_EQ() not return on failure, but continue
    evaluating all conditions; that should make potential debugging
    easier.

    With this fix in place I don't observe the flakiness anymore.

    Signed-off-by: Stanislav Fomichev
    Signed-off-by: Alexei Starovoitov
    Cc: Lawrence Brakmo
    Link: https://lore.kernel.org/bpf/20191204190955.170934-1-sdf@google.com
    Signed-off-by: Sasha Levin

    Stanislav Fomichev
     

23 Sep, 2020

1 commit

  • commit 1ec882fc81e3177faf055877310dbdb0c68eb7db upstream.

    The displayed size is in bytes while the text says it is in kB.

    Shift it by 10 to really display kBytes.

    Fixes: fa7b9a805c79 ("tools/selftest/vm: allow choosing mem size and page size in map_hugetlb")
    Signed-off-by: Christophe Leroy
    Signed-off-by: Andrew Morton
    Cc:
    Link: https://lkml.kernel.org/r/e27481224564a93d14106e750de31189deaa8bc8.1598861977.git.christophe.leroy@csgroup.eu
    Signed-off-by: Linus Torvalds
    Signed-off-by: Greg Kroah-Hartman

    Christophe Leroy
     

17 Sep, 2020

1 commit

  • [ Upstream commit 5c1e4f7e9e49b6925b1fb5c507d2c614f3edb292 ]

    The following 4 tests in timers can take longer than the default 45
    seconds that added in commit 852c8cbf34d3 ("selftests/kselftest/runner.sh:
    Add 45 second timeout per test") to run:
    * nsleep-lat - 2m7.350s
    * set-timer-lat - 2m0.66s
    * inconsistency-check - 1m45.074s
    * raw_skew - 2m0.013s

    Thus they will be marked as failed with the current 45s setting:
    not ok 3 selftests: timers: nsleep-lat # TIMEOUT
    not ok 4 selftests: timers: set-timer-lat # TIMEOUT
    not ok 6 selftests: timers: inconsistency-check # TIMEOUT
    not ok 7 selftests: timers: raw_skew # TIMEOUT

    Disable the timeout setting for timers can make these tests finish
    properly:
    ok 3 selftests: timers: nsleep-lat
    ok 4 selftests: timers: set-timer-lat
    ok 6 selftests: timers: inconsistency-check
    ok 7 selftests: timers: raw_skew

    https://bugs.launchpad.net/bugs/1864626
    Fixes: 852c8cbf34d3 ("selftests/kselftest/runner.sh: Add 45 second timeout per test")
    Signed-off-by: Po-Hsu Lin
    Acked-by: John Stultz
    Signed-off-by: Shuah Khan
    Signed-off-by: Sasha Levin

    Po-Hsu Lin
     

10 Sep, 2020

1 commit

  • [ Upstream commit fa4505675e093e895b7ec49a76d44f6b5ad9602e ]

    When stdout output from the selftests tool 'test_maps' gets redirected
    into e.g file or pipe, then the output lines increase a lot (from 21
    to 33949 lines). This is caused by the printf that happens before the
    fork() call, and there are user-space buffered printf data that seems
    to be duplicated into the forked process.

    To fix this fflush() stdout before the fork loop in __run_parallel().

    Fixes: 1a97cf1fe503 ("selftests/bpf: speedup test_maps")
    Signed-off-by: Jesper Dangaard Brouer
    Signed-off-by: Daniel Borkmann
    Link: https://lore.kernel.org/bpf/159842985651.1050885.2154399297503372406.stgit@firesoul
    Signed-off-by: Sasha Levin

    Jesper Dangaard Brouer
     

03 Sep, 2020

2 commits

  • [ Upstream commit bcf7ddb0186d366f761f86196b480ea6dd2dc18c ]

    h1 is initially configured to reach h2 via r1 rather than the
    more direct path through r2. If rp_filter is set and inherited
    for r2, forwarding fails since the source address of h1 is
    reachable from eth0 vs the packet coming to it via r1 and eth1.
    Since rp_filter setting affects the test, explicitly reset it.

    Signed-off-by: David Ahern
    Signed-off-by: David S. Miller
    Signed-off-by: Sasha Levin

    David Ahern
     
  • [ Upstream commit 3337bf41e0dd70b4064cdf60acdfcdc2d050066c ]

    An extra count on ebb_state.stats.pmc_count[PMC_INDEX(pmc)] is being per-
    formed when count_pmc() is used to reset PMCs on a few selftests. This
    extra pmc_count can occasionally invalidate results, such as the ones from
    cycles_test shown hereafter. The ebb_check_count() failed with an above
    the upper limit error due to the extra value on ebb_state.stats.pmc_count.

    Furthermore, this extra count is also indicated by extra PMC1 trace_log on
    the output of the cycle test (as well as on pmc56_overflow_test):

    ==========
    ...
    [21]: counter = 8
    [22]: register SPRN_MMCR0 = 0x0000000080000080
    [23]: register SPRN_PMC1 = 0x0000000080000004
    [24]: counter = 9
    [25]: register SPRN_MMCR0 = 0x0000000080000080
    [26]: register SPRN_PMC1 = 0x0000000080000004
    [27]: counter = 10
    [28]: register SPRN_MMCR0 = 0x0000000080000080
    [29]: register SPRN_PMC1 = 0x0000000080000004
    >> [30]: register SPRN_PMC1 = 0x000000004000051e
    PMC1 count (0x280000546) above upper limit 0x2800003e8 (+0x15e)
    [FAIL] Test FAILED on line 52
    failure: cycles
    ==========

    Signed-off-by: Desnes A. Nunes do Rosario
    Tested-by: Sachin Sant
    Signed-off-by: Michael Ellerman
    Link: https://lore.kernel.org/r/20200626164737.21943-1-desnesn@linux.ibm.com
    Signed-off-by: Sasha Levin

    Desnes A. Nunes do Rosario
     

26 Aug, 2020

1 commit

  • [ Upstream commit d830020656c5b68ced962ed3cb51a90e0a89d4c4 ]

    Haven't reproduced this issue. This PR is does a minor code cleanup.

    Signed-off-by: Gaurav Singh
    Signed-off-by: Andrew Morton
    Reviewed-by: Andrew Morton
    Cc: Shuah Khan
    Cc: Tejun Heo
    Cc: Michal Koutn
    Cc: Roman Gushchin
    Cc: Christian Brauner
    Cc: Chris Down
    Link: http://lkml.kernel.org/r/20200726013808.22242-1-gaurav1086@gmail.com
    Signed-off-by: Linus Torvalds
    Signed-off-by: Sasha Levin

    Gaurav Singh
     

21 Aug, 2020

5 commits

  • [ Upstream commit 3563b9bea0ca7f53e4218b5e268550341a49f333 ]

    With commit 4a4a5e5d2aad ("powerpc/pkeys: key allocation/deallocation
    must not change pkey registers") we are not updating UAMOR on key
    allocation. So don't update the expected uamor value in the test.

    Fixes: 4a4a5e5d2aad ("powerpc/pkeys: key allocation/deallocation must not change pkey registers")
    Signed-off-by: Aneesh Kumar K.V
    Signed-off-by: Michael Ellerman
    Link: https://lore.kernel.org/r/20200709032946.881753-23-aneesh.kumar@linux.ibm.com
    Signed-off-by: Sasha Levin

    Aneesh Kumar K.V
     
  • [ Upstream commit 0eaa3b5ca7b5a76e3783639c828498343be66a01 ]

    Signed-off-by: Aneesh Kumar K.V
    Signed-off-by: Michael Ellerman
    Link: https://lore.kernel.org/r/20200709032946.881753-22-aneesh.kumar@linux.ibm.com
    Signed-off-by: Sasha Levin

    Aneesh Kumar K.V
     
  • [ Upstream commit 9a11f12e0a6c374b3ef1ce81e32ce477d28eb1b8 ]

    Rename variable to indicate that they are invalid values which we will
    use to test ptrace update of pkeys.

    Signed-off-by: Aneesh Kumar K.V
    Signed-off-by: Michael Ellerman
    Link: https://lore.kernel.org/r/20200709032946.881753-21-aneesh.kumar@linux.ibm.com
    Signed-off-by: Sasha Levin

    Aneesh Kumar K.V
     
  • [ Upstream commit 3220fb667842a9725cbb71656f406eadb03c094b ]

    This is a follow up adjustment to commit 6c92bd5cd465 ("selftests/bpf:
    Test_progs indicate to shell on non-actions"), that returns shell exit
    indication EXIT_FAILURE (value 1) when user selects a non-existing test.

    The problem with using EXIT_FAILURE is that a shell script cannot tell
    the difference between a non-existing test and the test failing.

    This patch uses value 2 as shell exit indication.
    (Aside note unrecognized option parameters use value 64).

    Fixes: 6c92bd5cd465 ("selftests/bpf: Test_progs indicate to shell on non-actions")
    Signed-off-by: Jesper Dangaard Brouer
    Signed-off-by: Daniel Borkmann
    Acked-by: Andrii Nakryiko
    Link: https://lore.kernel.org/bpf/159410593992.1093222.90072558386094370.stgit@firesoul
    Signed-off-by: Sasha Levin

    Jesper Dangaard Brouer
     
  • [ Upstream commit 6c92bd5cd4650c39dd929565ee172984c680fead ]

    When a user selects a non-existing test the summary is printed with
    indication 0 for all info types, and shell "success" (EXIT_SUCCESS) is
    indicated. This can be understood by a human end-user, but for shell
    scripting is it useful to indicate a shell failure (EXIT_FAILURE).

    Signed-off-by: Jesper Dangaard Brouer
    Signed-off-by: Alexei Starovoitov
    Acked-by: Andrii Nakryiko
    Link: https://lore.kernel.org/bpf/159363984736.930467.17956007131403952343.stgit@firesoul
    Signed-off-by: Sasha Levin

    Jesper Dangaard Brouer
     

19 Aug, 2020

4 commits

  • [ Upstream commit dfa03fff86027e58c8dba5c03ae68150d4e513ad ]

    The size of the CPU affinity mask must be large enough for
    systems with a very large number of CPUs. Otherwise, tests
    which try to determine the first online CPU by calling
    sched_getaffinity() will fail. This makes sure that the size
    of the allocated affinity mask is dependent on the number of
    CPUs as reported by get_nprocs_conf().

    Fixes: 3752e453f6ba ("selftests/powerpc: Add tests of PMU EBBs")
    Reported-by: Shirisha Ganta
    Signed-off-by: Sandipan Das
    Reviewed-by: Kamalesh Babulal
    Signed-off-by: Michael Ellerman
    Link: https://lore.kernel.org/r/a408c4b8e9a23bb39b539417a21eb0ff47bb5127.1596084858.git.sandipan@linux.ibm.com
    Signed-off-by: Sasha Levin

    Sandipan Das
     
  • [ Upstream commit 854eb5022be04f81e318765f089f41a57c8e5d83 ]

    On systems with large number of cpus, test fails trying to set
    affinity by calling sched_setaffinity() with smaller size for affinity
    mask. This patch fixes it by making sure that the size of allocated
    affinity mask is dependent on the number of CPUs as reported by
    get_nprocs().

    Fixes: 00b7ec5c9cf3 ("selftests/powerpc: Import Anton's context_switch2 benchmark")
    Reported-by: Shirisha Ganta
    Signed-off-by: Sandipan Das
    Signed-off-by: Harish
    Reviewed-by: Kamalesh Babulal
    Reviewed-by: Satheesh Rajendran
    Signed-off-by: Michael Ellerman
    Link: https://lore.kernel.org/r/20200609081423.529664-1-harish@linux.ibm.com
    Signed-off-by: Sasha Levin

    Harish
     
  • [ Upstream commit 5f8cf6475828b600ff6d000e580c961ac839cc61 ]

    For drivers that don't have the error handling callbacks we implement
    recovery by removing the device and re-probing it. This causes the sysfs
    directory for the PCI device to be removed which causes the following
    spurious error to be printed when checking the PE state:

    Breaking 0005:03:00.0...
    ./eeh-basic.sh: line 13: can't open /sys/bus/pci/devices/0005:03:00.0/eeh_pe_state: no such file
    0005:03:00.0, waited 0/60
    0005:03:00.0, waited 1/60
    0005:03:00.0, waited 2/60
    0005:03:00.0, waited 3/60
    0005:03:00.0, waited 4/60
    0005:03:00.0, waited 5/60
    0005:03:00.0, waited 6/60
    0005:03:00.0, waited 7/60
    0005:03:00.0, Recovered after 8 seconds

    We currently try to avoid this by checking if the PE state file exists
    before reading from it. This is however inherently racy so re-work the
    state checking so that we only read from the file once, and we squash any
    errors that occur while reading.

    Fixes: 85d86c8aa52e ("selftests/powerpc: Add basic EEH selftest")
    Signed-off-by: Oliver O'Halloran
    Signed-off-by: Michael Ellerman
    Link: https://lore.kernel.org/r/20200727010127.23698-1-oohall@gmail.com
    Signed-off-by: Sasha Levin

    Oliver O'Halloran
     
  • [ Upstream commit 47e33c05f9f07cac3de833e531bcac9ae052c7ca ]

    When SECCOMP_IOCTL_NOTIF_ID_VALID was first introduced it had the wrong
    direction flag set. While this isn't a big deal as nothing currently
    enforces these bits in the kernel, it should be defined correctly. Fix
    the define and provide support for the old command until it is no longer
    needed for backward compatibility.

    Fixes: 6a21cc50f0c7 ("seccomp: add a return code to trap to userspace")
    Signed-off-by: Kees Cook
    Signed-off-by: Sasha Levin

    Kees Cook
     

11 Aug, 2020

1 commit

  • [ Upstream commit 16f6458f2478b55e2b628797bc81a4455045c74e ]

    The msg_zerocopy test pins the sender and receiver threads to separate
    cores to reduce variance between runs.

    But it hardcodes the cores and skips core 0, so it fails on machines
    with the selected cores offline, or simply fewer cores.

    The test mainly gives code coverage in automated runs. The throughput
    of zerocopy ('-z') and non-zerocopy runs is logged for manual
    inspection.

    Continue even when sched_setaffinity fails. Just log to warn anyone
    interpreting the data.

    Fixes: 07b65c5b31ce ("test: add msg_zerocopy test")
    Reported-by: Colin Ian King
    Signed-off-by: Willem de Bruijn
    Acked-by: Colin Ian King
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Willem de Bruijn
     

07 Aug, 2020

1 commit

  • commit f43cb0d672aa8eb09bfdb779de5900c040487d1d upstream.

    Fix sockmap tests which rely on old bpf_prog_dispatch behaviour.
    In the first case, the tests check that detaching without giving
    a program succeeds. Since these are not the desired semantics,
    invert the condition. In the second case, the clean up code doesn't
    supply the necessary program fds.

    Fixes: bb0de3131f4c ("bpf: sockmap: Require attach_bpf_fd when detaching a program")
    Reported-by: Martin KaFai Lau
    Signed-off-by: Lorenz Bauer
    Signed-off-by: Daniel Borkmann
    Reviewed-by: Jakub Sitnicki
    Link: https://lore.kernel.org/bpf/20200709115151.75829-1-lmb@cloudflare.com
    Signed-off-by: Greg Kroah-Hartman

    Lorenz Bauer
     

05 Aug, 2020

5 commits

  • [ Upstream commit aba69d49fb49c9166596dd78926514173b7f9ab5 ]

    Fix ip_defrag.sh when CONFIG_NF_DEFRAG_IPV6=m:

    $ sudo ./ip_defrag.sh
    + set -e
    + mktemp -u XXXXXX
    + readonly NETNS=ns-rGlXcw
    + trap cleanup EXIT
    + setup
    + ip netns add ns-rGlXcw
    + ip -netns ns-rGlXcw link set lo up
    + ip netns exec ns-rGlXcw sysctl -w net.ipv4.ipfrag_high_thresh=9000000
    + ip netns exec ns-rGlXcw sysctl -w net.ipv4.ipfrag_low_thresh=7000000
    + ip netns exec ns-rGlXcw sysctl -w net.ipv4.ipfrag_time=1
    + ip netns exec ns-rGlXcw sysctl -w net.ipv6.ip6frag_high_thresh=9000000
    + ip netns exec ns-rGlXcw sysctl -w net.ipv6.ip6frag_low_thresh=7000000
    + ip netns exec ns-rGlXcw sysctl -w net.ipv6.ip6frag_time=1
    + ip netns exec ns-rGlXcw sysctl -w net.netfilter.nf_conntrack_frag6_high_thresh=9000000
    + cleanup
    + ip netns del ns-rGlXcw

    $ ls -la /proc/sys/net/netfilter/nf_conntrack_frag6_high_thresh
    ls: cannot access '/proc/sys/net/netfilter/nf_conntrack_frag6_high_thresh': No such file or directory

    $ sudo modprobe nf_defrag_ipv6
    $ ls -la /proc/sys/net/netfilter/nf_conntrack_frag6_high_thresh
    -rw-r--r-- 1 root root 0 Jul 14 12:34 /proc/sys/net/netfilter/nf_conntrack_frag6_high_thresh

    Signed-off-by: Paolo Pisati
    Reviewed-by: Jakub Kicinski
    Signed-off-by: David S. Miller
    Signed-off-by: Sasha Levin

    Paolo Pisati
     
  • [ Upstream commit 651149f60376758a4759f761767965040f9e4464 ]

    During setup():
    ...
    for ns in h0 r1 h1 h2 h3
    do
    create_ns ${ns}
    done
    ...

    while in cleanup():
    ...
    for n in h1 r1 h2 h3 h4
    do
    ip netns del ${n} 2>/dev/null
    done
    ...

    and after removing the stderr redirection in cleanup():

    $ sudo ./fib_nexthop_multiprefix.sh
    ...
    TEST: IPv4: host 0 to host 3, mtu 1400 [ OK ]
    TEST: IPv6: host 0 to host 3, mtu 1400 [ OK ]
    Cannot remove namespace file "/run/netns/h4": No such file or directory
    $ echo $?
    1

    and a non-zero return code, make kselftests fail (even if the test
    itself is fine):

    ...
    not ok 34 selftests: net: fib_nexthop_multiprefix.sh # exit=1
    ...

    Signed-off-by: Paolo Pisati
    Reviewed-by: David Ahern
    Signed-off-by: David S. Miller
    Signed-off-by: Sasha Levin

    Paolo Pisati
     
  • [ Upstream commit b4da96ffd30bd4a305045ba5c9b0de5d4aa20dc7 ]

    On powerpcle, int64_t maps to long long. Clang 9 threw:
    warning: absolute value function 'labs' given an argument of type \
    'long long' but has parameter of type 'long' which may cause \
    truncation of value [-Wabsolute-value]
    if (labs(tstop - texpect) > cfg_variance_us)

    Tested: make -C tools/testing/selftests TARGETS="net" run_tests

    Fixes: af5136f95045 ("selftests/net: SO_TXTIME with ETF and FQ")
    Signed-off-by: Tanner Love
    Acked-by: Willem de Bruijn
    Signed-off-by: David S. Miller
    Signed-off-by: Sasha Levin

    Tanner Love
     
  • [ Upstream commit 64f9ede2274980076423583683d44480909b7a40 ]

    Clang 9 threw:
    warning: format specifies type 'unsigned short' but the argument has \
    type 'int' [-Wformat]
    typeflags, PORT_BASE, PORT_BASE + port_off);

    Tested: make -C tools/testing/selftests TARGETS="net" run_tests

    Fixes: 77f65ebdca50 ("packet: packet fanout rollover during socket overload")
    Signed-off-by: Tanner Love
    Acked-by: Willem de Bruijn
    Signed-off-by: David S. Miller
    Signed-off-by: Sasha Levin

    Tanner Love
     
  • [ Upstream commit 955cbe91bcf782c09afe369c95a20f0a4b6dcc3c ]

    The signedness of char is implementation-dependent. Some systems
    (including PowerPC and ARM) use unsigned char. Clang 9 threw:
    warning: result of comparison of constant -1 with expression of type \
    'char' is always true [-Wtautological-constant-out-of-range-compare]
    &arg_index)) != -1) {

    Tested: make -C tools/testing/selftests TARGETS="net" run_tests

    Fixes: 16e781224198 ("selftests/net: Add a test to validate behavior of rx timestamps")
    Signed-off-by: Tanner Love
    Acked-by: Willem de Bruijn
    Signed-off-by: David S. Miller
    Signed-off-by: Sasha Levin

    Tanner Love
     

22 Jul, 2020

1 commit

  • [ Upstream commit 34fe5a1cf95c3f114068fc16d919c9cf4b00e428 ]

    Brian reported a crash in IPv6 code when using rpfilter with a setup
    running FRR and external nexthop objects. The root cause of the crash
    is fib6_select_path setting fib6_nh in the result to NULL because of
    an improper check for nexthop objects.

    More specifically, rpfilter invokes ip6_route_lookup with flowi6_oif
    set causing fib6_select_path to be called with have_oif_match set.
    fib6_select_path has early check on have_oif_match and jumps to the
    out label which presumes a builtin fib6_nh. This path is invalid for
    nexthop objects; for external nexthops fib6_select_path needs to just
    return if the fib6_nh has already been set in the result otherwise it
    returns after the call to nexthop_path_fib6_result. Update the check
    on have_oif_match to not bail on external nexthops.

    Update selftests for this problem.

    Fixes: f88d8ea67fbd ("ipv6: Plumb support for nexthop object in a fib6_info")
    Reported-by: Brian Rak
    Signed-off-by: David Ahern
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    David Ahern
     

09 Jul, 2020

1 commit

  • commit 377ff83083c953dd58c5a030b3c9b5b85d8cc727 upstream.

    It's better to use /bin/sh instead of /bin/bash in order to run the tests
    in the BusyBox shell.

    Fixes: 6ea3dfe1e073 ("selftests: add TPM 2.0 tests")
    Cc: stable@vger.kernel.org
    Cc: linux-integrity@vger.kernel.org
    Cc: linux-kselftest@vger.kernel.org
    Signed-off-by: Jarkko Sakkinen
    Signed-off-by: Shuah Khan
    Signed-off-by: Greg Kroah-Hartman

    Jarkko Sakkinen
     

01 Jul, 2020

1 commit

  • [ Upstream commit ca8826095e4d4afc0ccaead27bba6e4b623a12ae ]

    The ETF qdisc can queue skbs that it could not pace on the errqueue.

    Address a few issues in the selftest

    - recv buffer size was too small, and incorrectly calculated
    - compared errno to ee_code instead of ee_errno
    - missed invalid request error type

    v2:
    - fix a few checkpatch --strict indentation warnings

    Fixes: ea6a547669b3 ("selftests/net: make so_txtime more robust to timer variance")
    Signed-off-by: Willem de Bruijn
    Signed-off-by: David S. Miller
    Signed-off-by: Sasha Levin

    Willem de Bruijn
     

24 Jun, 2020

3 commits

  • [ Upstream commit 8027bc0307ce59759b90679fa5d8b22949586d20 ]

    If user passed an interface option longer than 15 characters, then
    device.ifr_name and hwtstamp.ifr_name became non-null-terminated
    strings. The compiler warned about this:

    timestamping.c:353:2: warning: ‘strncpy’ specified bound 16 equals \
    destination size [-Wstringop-truncation]
    353 | strncpy(device.ifr_name, interface, sizeof(device.ifr_name));

    Fixes: cb9eff097831 ("net: new user space API for time stamping of incoming and outgoing packets")
    Signed-off-by: Tanner Love
    Acked-by: Willem de Bruijn
    Signed-off-by: David S. Miller
    Signed-off-by: Sasha Levin

    tannerlove
     
  • [ Upstream commit 2130c0ba69d69bb21f5c52787f2587db00d13d8a ]

    When remote files are counted in get_files_count, without using SSH,
    the code returns 0 because there is a colon prepended to $LOC. $VPATH
    should have been used instead of $LOC.

    Fixes: 06bd0407d06c ("NTB: ntb_test: Update ntb_tool Scratchpad tests")
    Signed-off-by: Logan Gunthorpe
    Acked-by: Allen Hubbe
    Tested-by: Alexander Fomichev
    Signed-off-by: Jon Mason
    Signed-off-by: Sasha Levin

    Logan Gunthorpe
     
  • [ Upstream commit 6e373263ce07eeaa6410843179535fbdf561fc31 ]

    alloc_random_pkey() was allocating the same pkey every time. Not all
    pkeys were geting tested. This fixes it.

    Signed-off-by: Ram Pai
    Signed-off-by: Sandipan Das
    Signed-off-by: Andrew Morton
    Acked-by: Dave Hansen
    Cc: Dave Hansen
    Cc: Florian Weimer
    Cc: "Desnes A. Nunes do Rosario"
    Cc: Ingo Molnar
    Cc: Thiago Jung Bauermann
    Cc: "Aneesh Kumar K.V"
    Cc: Michael Ellerman
    Cc: Michal Hocko
    Cc: Michal Suchanek
    Cc: Shuah Khan
    Link: http://lkml.kernel.org/r/0162f55816d4e783a0d6e49e554d0ab9a3c9a23b.1585646528.git.sandipan@linux.ibm.com
    Signed-off-by: Linus Torvalds
    Signed-off-by: Sasha Levin

    Ram Pai
     

22 Jun, 2020

3 commits

  • [ Upstream commit b8215dce7dfd817ca38807f55165bf502146cd68 ]

    test_flow_dissector leaves a TAP device after it's finished, potentially
    interfering with other tests that will run after it. Fix it by closing the
    TAP descriptor on cleanup.

    Fixes: 0905beec9f52 ("selftests/bpf: run flow dissector tests in skb-less mode")
    Signed-off-by: Jakub Sitnicki
    Signed-off-by: Alexei Starovoitov
    Link: https://lore.kernel.org/bpf/20200531082846.2117903-11-jakub@cloudflare.com
    Signed-off-by: Sasha Levin

    Jakub Sitnicki
     
  • [ Upstream commit 3c8e8cf4b18b3a7034fab4c4504fc4b54e4b6195 ]

    test_seg6_loop.o uses the helper bpf_lwt_seg6_adjust_srh();
    it will not be present if CONFIG_IPV6_SEG6_BPF is not specified.

    Fixes: b061017f8b4d ("selftests/bpf: add realistic loop tests")
    Signed-off-by: Alan Maguire
    Signed-off-by: Daniel Borkmann
    Link: https://lore.kernel.org/bpf/1590147389-26482-2-git-send-email-alan.maguire@oracle.com
    Signed-off-by: Sasha Levin

    Alan Maguire
     
  • [ Upstream commit 9f56bb531a809ecaa7f0ddca61d2cf3adc1cb81a ]

    getline() allocates string, which has to be freed.

    Fixes: 81f77fd0deeb ("bpf: add selftest for stackmap with BPF_F_STACK_BUILD_ID")
    Signed-off-by: Andrii Nakryiko
    Signed-off-by: Alexei Starovoitov
    Cc: Song Liu
    Link: https://lore.kernel.org/bpf/20200429012111.277390-7-andriin@fb.com
    Signed-off-by: Sasha Levin

    Andrii Nakryiko
     

17 Jun, 2020

3 commits

  • commit 619ee76f5c9f6a1d601d1a056a454d62bf676ae4 upstream.

    Check whether error_log file exists in tracing/error_log testcase
    and return UNSUPPORTED if no error_log file.

    This can happen if we run the ftracetest on the older stable
    kernel.

    Fixes: 4eab1cc461a6 ("selftests/ftrace: Add tracing/error_log testcase")
    Cc: stable@vger.kernel.org
    Signed-off-by: Masami Hiramatsu
    Signed-off-by: Shuah Khan
    Signed-off-by: Greg Kroah-Hartman

    Masami Hiramatsu
     
  • [ Upstream commit 865a6cbb2288f8af7f9dc3b153c61b7014fdcf1e ]

    getopt_long requires the last element to be filled with zeros.
    Otherwise, passing an unrecognized option can cause a segfault.

    Fixes: 16e781224198 ("selftests/net: Add a test to validate behavior of rx timestamps")
    Signed-off-by: Tanner Love
    Acked-by: Willem de Bruijn
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    tannerlove
     
  • [ Upstream commit 0531b0357ba37464e5c0033e1b7c69bbf5ecd8fb ]

    Flower tests used to create ingress filter with specified parent qdisc
    "parent ffff:" but dump them on "ingress". With recent commit that fixed
    tcm_parent handling in dump those are not considered same parent anymore,
    which causes iproute2 tc to emit additional "parent ffff:" in first line of
    filter dump output. The change in output causes filter match in tests to
    fail.

    Prevent parent qdisc output when dumping filters in flower tests by always
    correctly specifying "ingress" parent both when creating and dumping
    filters.

    Fixes: a7df4870d79b ("net_sched: fix tcm_parent in tc filter dump")
    Signed-off-by: Vlad Buslov
    Signed-off-by: David S. Miller
    Signed-off-by: Sasha Levin

    Vlad Buslov
     

07 Jun, 2020

1 commit

  • [ Upstream commit 46ca11177ed593f39d534f8d2c74ec5344e90c11 ]

    Starting from iputils s20190709 (used in Fedora 31), arping does not
    support timeout being specified as a decimal:

    $ arping -c 1 -I swp1 -b 192.0.2.66 -q -w 0.1
    arping: invalid argument: '0.1'

    Previously, such timeouts were rounded to an integer.

    Fix this by specifying the timeout as an integer.

    Fixes: a5ee171d087e ("selftests: mlxsw: qos_mc_aware: Add a test for UC awareness")
    Signed-off-by: Amit Cohen
    Reviewed-by: Petr Machata
    Signed-off-by: Ido Schimmel
    Signed-off-by: David S. Miller
    Signed-off-by: Sasha Levin

    Amit Cohen
     

27 May, 2020

1 commit

  • [ Upstream commit 8ffdaf9155ebe517cdec5edbcca19ba6e7ee9c3c ]

    I got this error when building kvm selftests:

    /usr/bin/ld: /home/xz/git/linux/tools/testing/selftests/kvm/libkvm.a(vmx.o):/home/xz/git/linux/tools/testing/selftests/kvm/include/evmcs.h:222: multiple definition of `current_evmcs'; /tmp/cco1G48P.o:/home/xz/git/linux/tools/testing/selftests/kvm/include/evmcs.h:222: first defined here
    /usr/bin/ld: /home/xz/git/linux/tools/testing/selftests/kvm/libkvm.a(vmx.o):/home/xz/git/linux/tools/testing/selftests/kvm/include/evmcs.h:223: multiple definition of `current_vp_assist'; /tmp/cco1G48P.o:/home/xz/git/linux/tools/testing/selftests/kvm/include/evmcs.h:223: first defined here

    I think it's because evmcs.h is included both in a test file and a lib file so
    the structs have multiple declarations when linking. After all it's not a good
    habit to declare structs in the header files.

    Cc: Vitaly Kuznetsov
    Signed-off-by: Peter Xu
    Message-Id:
    Signed-off-by: Paolo Bonzini
    Signed-off-by: Sasha Levin

    Peter Xu