Skip to content
Snippets Groups Projects
  1. Nov 07, 2019
  2. Nov 06, 2019
  3. Nov 01, 2019
  4. Oct 30, 2019
    • Ilya Leoshkevich's avatar
      bpf: Allow narrow loads of bpf_sysctl fields with offset > 0 · 7541c87c
      Ilya Leoshkevich authored
      
      "ctx:file_pos sysctl:read read ok narrow" works on s390 by accident: it
      reads the wrong byte, which happens to have the expected value of 0.
      Improve the test by seeking to the 4th byte and expecting 4 instead of
      0.
      
      This makes the latent problem apparent: the test attempts to read the
      first byte of bpf_sysctl.file_pos, assuming this is the least-significant
      byte, which is not the case on big-endian machines: a non-zero offset is
      needed.
      
      The point of the test is to verify narrow loads, so we cannot cheat our
      way out by simply using BPF_W. The existence of the test means that such
      loads have to be supported, most likely because llvm can generate them.
      Fix the test by adding a big-endian variant, which uses an offset to
      access the least-significant byte of bpf_sysctl.file_pos.
      
      This reveals the final problem: verifier rejects accesses to bpf_sysctl
      fields with offset > 0. Such accesses are already allowed for a wide
      range of structs: __sk_buff, bpf_sock_addr and sk_msg_md to name a few.
      Extend this support to bpf_sysctl by using bpf_ctx_range instead of
      offsetof when matching field offsets.
      
      Fixes: 7b146ceb ("bpf: Sysctl hook")
      Fixes: e1550bfe ("bpf: Add file_pos field to bpf_sysctl ctx")
      Fixes: 9a1027e5 ("selftests/bpf: Test file_pos field in bpf_sysctl ctx")
      Signed-off-by: default avatarIlya Leoshkevich <iii@linux.ibm.com>
      Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
      Acked-by: default avatarAndrey Ignatov <rdna@fb.com>
      Acked-by: default avatarAndrii Nakryiko <andriin@fb.com>
      Link: https://lore.kernel.org/bpf/20191028122902.9763-1-iii@linux.ibm.com
      7541c87c
  5. Oct 26, 2019
  6. Oct 22, 2019
  7. Oct 19, 2019
  8. Oct 18, 2019
  9. Oct 09, 2019
  10. Oct 08, 2019
  11. Oct 05, 2019
  12. Oct 03, 2019
    • Josh Hunt's avatar
      udp: only do GSO if # of segs > 1 · 4094871d
      Josh Hunt authored
      
      Prior to this change an application sending <= 1MSS worth of data and
      enabling UDP GSO would fail if the system had SW GSO enabled, but the
      same send would succeed if HW GSO offload is enabled. In addition to this
      inconsistency the error in the SW GSO case does not get back to the
      application if sending out of a real device so the user is unaware of this
      failure.
      
      With this change we only perform GSO if the # of segments is > 1 even
      if the application has enabled segmentation. I've also updated the
      relevant udpgso selftests.
      
      Fixes: bec1f6f6 ("udp: generate gso with UDP_SEGMENT")
      Signed-off-by: default avatarJosh Hunt <johunt@akamai.com>
      Reviewed-by: default avatarWillem de Bruijn <willemb@google.com>
      Reviewed-by: default avatarAlexander Duyck <alexander.h.duyck@linux.intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4094871d
    • Shuah Khan's avatar
      selftests: kvm: Fix libkvm build error · 6e06983d
      Shuah Khan authored
      
      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: default avatarShuah Khan <skhan@linuxfoundation.org>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      6e06983d
  13. Oct 02, 2019
  14. Oct 01, 2019
  15. Sep 30, 2019
  16. Sep 28, 2019
  17. Sep 27, 2019
  18. Sep 26, 2019
  19. Sep 25, 2019
  20. Sep 24, 2019
Loading