1. 04 9月, 2020 9 次提交
  2. 02 9月, 2020 1 次提交
  3. 01 9月, 2020 2 次提交
  4. 29 8月, 2020 4 次提交
  5. 28 8月, 2020 3 次提交
  6. 27 8月, 2020 9 次提交
    • A
      libbpf: Fix compilation warnings for 64-bit printf args · 2e80be60
      Andrii Nakryiko 提交于
      Fix compilation warnings due to __u64 defined differently as `unsigned long`
      or `unsigned long long` on different architectures (e.g., ppc64le differs from
      x86-64). Also cast one argument to size_t to fix printf warning of similar
      nature.
      
      Fixes: eacaaed7 ("libbpf: Implement enum value-based CO-RE relocations")
      Fixes: 50e09460 ("libbpf: Skip well-known ELF sections when iterating ELF")
      Reported-by: NNaresh Kamboju <naresh.kamboju@linaro.org>
      Signed-off-by: NAndrii Nakryiko <andriin@fb.com>
      Signed-off-by: NAlexei Starovoitov <ast@kernel.org>
      Link: https://lore.kernel.org/bpf/20200827041109.3613090-1-andriin@fb.com
      2e80be60
    • Y
      selftests/bpf: Add verifier tests for xor operation · f5493c51
      Yonghong Song 提交于
      Added some test_verifier bounds check test cases for
      xor operations.
        $ ./test_verifier
        ...
        #78/u bounds check for reg = 0, reg xor 1 OK
        #78/p bounds check for reg = 0, reg xor 1 OK
        #79/u bounds check for reg32 = 0, reg32 xor 1 OK
        #79/p bounds check for reg32 = 0, reg32 xor 1 OK
        #80/u bounds check for reg = 2, reg xor 3 OK
        #80/p bounds check for reg = 2, reg xor 3 OK
        #81/u bounds check for reg = any, reg xor 3 OK
        #81/p bounds check for reg = any, reg xor 3 OK
        #82/u bounds check for reg32 = any, reg32 xor 3 OK
        #82/p bounds check for reg32 = any, reg32 xor 3 OK
        #83/u bounds check for reg > 0, reg xor 3 OK
        #83/p bounds check for reg > 0, reg xor 3 OK
        #84/u bounds check for reg32 > 0, reg32 xor 3 OK
        #84/p bounds check for reg32 > 0, reg32 xor 3 OK
        ...
      Signed-off-by: NYonghong Song <yhs@fb.com>
      Signed-off-by: NAlexei Starovoitov <ast@kernel.org>
      Cc: John Fastabend <john.fastabend@gmail.com>
      Link: https://lore.kernel.org/bpf/20200825064609.2018077-1-yhs@fb.com
      f5493c51
    • I
      selftests: fib_nexthops: Test IPv6 route with group after replacing IPv4 nexthops · 041bc0dc
      Ido Schimmel 提交于
      Test that an IPv6 route can not use a nexthop group with mixed IPv4 and
      IPv6 nexthops, but can use it after replacing the IPv4 nexthops with
      IPv6 nexthops.
      
      Output without previous patch:
      
      # ./fib_nexthops.sh -t ipv6_fcnal_runtime
      
      IPv6 functional runtime
      -----------------------
      TEST: Route add                                                     [ OK ]
      TEST: Route delete                                                  [ OK ]
      TEST: Ping with nexthop                                             [ OK ]
      TEST: Ping - multipath                                              [ OK ]
      TEST: Ping - blackhole                                              [ OK ]
      TEST: Ping - blackhole replaced with gateway                        [ OK ]
      TEST: Ping - gateway replaced by blackhole                          [ OK ]
      TEST: Ping - group with blackhole                                   [ OK ]
      TEST: Ping - group blackhole replaced with gateways                 [ OK ]
      TEST: IPv6 route with device only nexthop                           [ OK ]
      TEST: IPv6 multipath route with nexthop mix - dev only + gw         [ OK ]
      TEST: IPv6 route can not have a v4 gateway                          [ OK ]
      TEST: Nexthop replace - v6 route, v4 nexthop                        [ OK ]
      TEST: Nexthop replace of group entry - v6 route, v4 nexthop         [ OK ]
      TEST: IPv6 route can not have a group with v4 and v6 gateways       [ OK ]
      TEST: IPv6 route can not have a group with v4 and v6 gateways       [ OK ]
      TEST: IPv6 route using a group after removing v4 gateways           [ OK ]
      TEST: IPv6 route can not have a group with v4 and v6 gateways       [ OK ]
      TEST: IPv6 route can not have a group with v4 and v6 gateways       [ OK ]
      TEST: IPv6 route using a group after replacing v4 gateways          [FAIL]
      TEST: Nexthop with default route and rpfilter                       [ OK ]
      TEST: Nexthop with multipath default route and rpfilter             [ OK ]
      
      Tests passed:  21
      Tests failed:   1
      
      Output with previous patch:
      
      # ./fib_nexthops.sh -t ipv6_fcnal_runtime
      
      IPv6 functional runtime
      -----------------------
      TEST: Route add                                                     [ OK ]
      TEST: Route delete                                                  [ OK ]
      TEST: Ping with nexthop                                             [ OK ]
      TEST: Ping - multipath                                              [ OK ]
      TEST: Ping - blackhole                                              [ OK ]
      TEST: Ping - blackhole replaced with gateway                        [ OK ]
      TEST: Ping - gateway replaced by blackhole                          [ OK ]
      TEST: Ping - group with blackhole                                   [ OK ]
      TEST: Ping - group blackhole replaced with gateways                 [ OK ]
      TEST: IPv6 route with device only nexthop                           [ OK ]
      TEST: IPv6 multipath route with nexthop mix - dev only + gw         [ OK ]
      TEST: IPv6 route can not have a v4 gateway                          [ OK ]
      TEST: Nexthop replace - v6 route, v4 nexthop                        [ OK ]
      TEST: Nexthop replace of group entry - v6 route, v4 nexthop         [ OK ]
      TEST: IPv6 route can not have a group with v4 and v6 gateways       [ OK ]
      TEST: IPv6 route can not have a group with v4 and v6 gateways       [ OK ]
      TEST: IPv6 route using a group after removing v4 gateways           [ OK ]
      TEST: IPv6 route can not have a group with v4 and v6 gateways       [ OK ]
      TEST: IPv6 route can not have a group with v4 and v6 gateways       [ OK ]
      TEST: IPv6 route using a group after replacing v4 gateways          [ OK ]
      TEST: Nexthop with default route and rpfilter                       [ OK ]
      TEST: Nexthop with multipath default route and rpfilter             [ OK ]
      
      Tests passed:  22
      Tests failed:   0
      Signed-off-by: NIdo Schimmel <idosch@nvidia.com>
      Reviewed-by: NDavid Ahern <dsahern@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      041bc0dc
    • I
      selftests: fib_nexthops: Test IPv6 route with group after removing IPv4 nexthops · 05290a27
      Ido Schimmel 提交于
      Test that an IPv6 route can not use a nexthop group with mixed IPv4 and
      IPv6 nexthops, but can use it after deleting the IPv4 nexthops.
      
      Output without previous patch:
      
      # ./fib_nexthops.sh -t ipv6_fcnal_runtime
      
      IPv6 functional runtime
      -----------------------
      TEST: Route add                                                     [ OK ]
      TEST: Route delete                                                  [ OK ]
      TEST: Ping with nexthop                                             [ OK ]
      TEST: Ping - multipath                                              [ OK ]
      TEST: Ping - blackhole                                              [ OK ]
      TEST: Ping - blackhole replaced with gateway                        [ OK ]
      TEST: Ping - gateway replaced by blackhole                          [ OK ]
      TEST: Ping - group with blackhole                                   [ OK ]
      TEST: Ping - group blackhole replaced with gateways                 [ OK ]
      TEST: IPv6 route with device only nexthop                           [ OK ]
      TEST: IPv6 multipath route with nexthop mix - dev only + gw         [ OK ]
      TEST: IPv6 route can not have a v4 gateway                          [ OK ]
      TEST: Nexthop replace - v6 route, v4 nexthop                        [ OK ]
      TEST: Nexthop replace of group entry - v6 route, v4 nexthop         [ OK ]
      TEST: IPv6 route can not have a group with v4 and v6 gateways       [ OK ]
      TEST: IPv6 route can not have a group with v4 and v6 gateways       [ OK ]
      TEST: IPv6 route using a group after deleting v4 gateways           [FAIL]
      TEST: Nexthop with default route and rpfilter                       [ OK ]
      TEST: Nexthop with multipath default route and rpfilter             [ OK ]
      
      Tests passed:  18
      Tests failed:   1
      
      Output with previous patch:
      
      bash-5.0# ./fib_nexthops.sh -t ipv6_fcnal_runtime
      
      IPv6 functional runtime
      -----------------------
      TEST: Route add                                                     [ OK ]
      TEST: Route delete                                                  [ OK ]
      TEST: Ping with nexthop                                             [ OK ]
      TEST: Ping - multipath                                              [ OK ]
      TEST: Ping - blackhole                                              [ OK ]
      TEST: Ping - blackhole replaced with gateway                        [ OK ]
      TEST: Ping - gateway replaced by blackhole                          [ OK ]
      TEST: Ping - group with blackhole                                   [ OK ]
      TEST: Ping - group blackhole replaced with gateways                 [ OK ]
      TEST: IPv6 route with device only nexthop                           [ OK ]
      TEST: IPv6 multipath route with nexthop mix - dev only + gw         [ OK ]
      TEST: IPv6 route can not have a v4 gateway                          [ OK ]
      TEST: Nexthop replace - v6 route, v4 nexthop                        [ OK ]
      TEST: Nexthop replace of group entry - v6 route, v4 nexthop         [ OK ]
      TEST: IPv6 route can not have a group with v4 and v6 gateways       [ OK ]
      TEST: IPv6 route can not have a group with v4 and v6 gateways       [ OK ]
      TEST: IPv6 route using a group after deleting v4 gateways           [ OK ]
      TEST: Nexthop with default route and rpfilter                       [ OK ]
      TEST: Nexthop with multipath default route and rpfilter             [ OK ]
      
      Tests passed:  19
      Tests failed:   0
      Signed-off-by: NIdo Schimmel <idosch@nvidia.com>
      Reviewed-by: NDavid Ahern <dsahern@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      05290a27
    • A
      libbpf: Fix unintentional success return code in bpf_object__load · ef05afa6
      Alex Gartrell 提交于
      There are code paths where EINVAL is returned directly without setting
      errno. In that case, errno could be 0, which would mask the
      failure. For example, if a careless programmer set log_level to 10000
      out of laziness, they would have to spend a long time trying to figure
      out why.
      
      Fixes: 4f33ddb4 ("libbpf: Propagate EPERM to caller on program load")
      Signed-off-by: NAlex Gartrell <alexgartrell@gmail.com>
      Signed-off-by: NAlexei Starovoitov <ast@kernel.org>
      Link: https://lore.kernel.org/bpf/20200826075549.1858580-1-alexgartrell@gmail.com
      ef05afa6
    • U
      selftests/bpf: Test for map update access from within EXT programs · 1410620c
      Udip Pant 提交于
      This adds further tests to ensure access permissions and restrictions
      are applied properly for some map types such as sock-map.
      It also adds another negative tests to assert static functions cannot be
      replaced. In the 'unreliable' mode it still fails with error 'tracing progs
      cannot use bpf_spin_lock yet' with the change in the verifier
      Signed-off-by: NUdip Pant <udippant@fb.com>
      Signed-off-by: NAlexei Starovoitov <ast@kernel.org>
      Link: https://lore.kernel.org/bpf/20200825232003.2877030-5-udippant@fb.com
      1410620c
    • U
      selftests/bpf: Test for checking return code for the extended prog · 50d19736
      Udip Pant 提交于
      This adds test to enforce same check for the return code for the extended prog
      as it is enforced for the target program. It asserts failure for a
      return code, which is permitted without the patch in this series, while
      it is restricted after the application of this patch.
      Signed-off-by: NUdip Pant <udippant@fb.com>
      Signed-off-by: NAlexei Starovoitov <ast@kernel.org>
      Link: https://lore.kernel.org/bpf/20200825232003.2877030-4-udippant@fb.com
      50d19736
    • U
      selftests/bpf: Add test for freplace program with write access · 6dc03dc7
      Udip Pant 提交于
      This adds a selftest that tests the behavior when a freplace target program
      attempts to make a write access on a packet. The expectation is that the read or write
      access is granted based on the program type of the linked program and
      not itself (which is of type, for e.g., BPF_PROG_TYPE_EXT).
      
      This test fails without the associated patch on the verifier.
      Signed-off-by: NUdip Pant <udippant@fb.com>
      Signed-off-by: NAlexei Starovoitov <ast@kernel.org>
      Link: https://lore.kernel.org/bpf/20200825232003.2877030-3-udippant@fb.com
      6dc03dc7
    • C
      selftests/bpf: Fix spelling mistake "scoket" -> "socket" · 7100ff7c
      Colin Ian King 提交于
      There is a spelling mistake in a check error message. Fix it.
      Signed-off-by: NColin Ian King <colin.king@canonical.com>
      Signed-off-by: NAlexei Starovoitov <ast@kernel.org>
      Link: https://lore.kernel.org/bpf/20200826085907.43095-1-colin.king@canonical.com
      7100ff7c
  7. 26 8月, 2020 12 次提交