1. 27 Nov, 2018 30 commits
  2. 26 Nov, 2018 4 commits
    • David S. Miller's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next · 4afe60a9
      David S. Miller authored
      Daniel Borkmann says:
      
      ====================
      pull-request: bpf-next 2018-11-26
      
      The following pull-request contains BPF updates for your *net-next* tree.
      
      The main changes are:
      
      1) Extend BTF to support function call types and improve the BPF
         symbol handling with this info for kallsyms and bpftool program
         dump to make debugging easier, from Martin and Yonghong.
      
      2) Optimize LPM lookups by making longest_prefix_match() handle
         multiple bytes at a time, from Eric.
      
      3) Adds support for loading and attaching flow dissector BPF progs
         from bpftool, from Stanislav.
      
      4) Extend the sk_lookup() helper to be supported from XDP, from Nitin.
      
      5) Enable verifier to support narrow context loads with offset > 0
         to adapt to LLVM code generation (currently only offset of 0 was
         supported). Add test cases as well, from Andrey.
      
      6) Simplify passing device functions for offloaded BPF progs by
         adding callbacks to bpf_prog_offload_ops instead of ndo_bpf.
         Also convert nfp and netdevsim to make use of them, from Quentin.
      
      7) Add support for sock_ops based BPF programs to send events to
         the perf ring-buffer through perf_event_output helper, from
         Sowmini and Daniel.
      
      8) Add read / write support for skb->tstamp from tc BPF and cg BPF
         programs to allow for supporting rate-limiting in EDT qdiscs
         like fq from BPF side, from Vlad.
      
      9) Extend libbpf API to support map in map types and add test cases
         for it as well to BPF kselftests, from Nikita.
      
      10) Account the maximum packet offset accessed by a BPF program in
          the verifier and use it for optimizing nfp JIT, from Jiong.
      
      11) Fix error handling regarding kprobe_events in BPF sample loader,
          from Daniel T.
      
      12) Add support for queue and stack map type in bpftool, from David.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4afe60a9
    • David Calavera's avatar
      bpf: align map type names formatting. · ffac28f9
      David Calavera authored
      Make the formatting for map_type_name array consistent.
      Signed-off-by: default avatarDavid Calavera <david.calavera@gmail.com>
      Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      ffac28f9
    • Colin Ian King's avatar
      bpf: btf: fix spelling mistake "Memmber" -> "Member" · 311fe1a8
      Colin Ian King authored
      There is a spelling mistake in a btf_verifier_log_member message,
      fix it.
      Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
      Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      311fe1a8
    • Rustam Kovhaev's avatar
      bpf, tags: Fix DEFINE_PER_CPU expansion · cf0dd411
      Rustam Kovhaev authored
      Building tags produces warning:
      
        ctags: Warning: kernel/bpf/local_storage.c:10: null expansion of name pattern "\1"
      
      Let's use the same fix as in commit 25528213 ("tags: Fix DEFINE_PER_CPU
      expansions"), even though it violates the usual code style.
      Signed-off-by: default avatarRustam Kovhaev <rkovhaev@gmail.com>
      Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      cf0dd411
  3. 25 Nov, 2018 6 commits
    • Eric Dumazet's avatar
      net: remove unsafe skb_insert() · 4bffc669
      Eric Dumazet authored
      I do not see how one can effectively use skb_insert() without holding
      some kind of lock. Otherwise other cpus could have changed the list
      right before we have a chance of acquiring list->lock.
      
      Only existing user is in drivers/infiniband/hw/nes/nes_mgt.c and this
      one probably meant to use __skb_insert() since it appears nesqp->pau_list
      is protected by nesqp->pau_lock. This looks like nesqp->pau_lock
      could be removed, since nesqp->pau_list.lock could be used instead.
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Cc: Faisal Latif <faisal.latif@intel.com>
      Cc: Doug Ledford <dledford@redhat.com>
      Cc: Jason Gunthorpe <jgg@ziepe.ca>
      Cc: linux-rdma <linux-rdma@vger.kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4bffc669
    • Colin Ian King's avatar
      net: bridge: remove redundant checks for null p->dev and p->br · 40b1c813
      Colin Ian King authored
      A recent change added a null check on p->dev after p->dev was being
      dereferenced by the ns_capable check on p->dev. It turns out that
      neither the p->dev and p->br null checks are necessary, and can be
      removed, which cleans up a static analyis warning.
      
      As Nikolay Aleksandrov noted, these checks can be removed because:
      
      "My reasoning of why it shouldn't be possible:
      - On port add new_nbp() sets both p->dev and p->br before creating
        kobj/sysfs
      
      - On port del (trickier) del_nbp() calls kobject_del() before call_rcu()
        to destroy the port which in turn calls sysfs_remove_dir() which uses
        kernfs_remove() which deactivates (shouldn't be able to open new
        files) and calls kernfs_drain() to drain current open/mmaped files in
        the respective dir before continuing, thus making it impossible to
        open a bridge port sysfs file with p->dev and p->br equal to NULL.
      
      So I think it's safe to remove those checks altogether. It'd be nice to
      get a second look over my reasoning as I might be missing something in
      sysfs/kernfs call path."
      
      Thanks to Nikolay Aleksandrov's suggestion to remove the check and
      David Miller for sanity checking this.
      
      Detected by CoverityScan, CID#751490 ("Dereference before null check")
      
      Fixes: a5f3ea54 ("net: bridge: add support for raw sysfs port options")
      Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
      Acked-by: default avatarNikolay Aleksandrov <nikolay@cumulusnetworks.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      40b1c813
    • David S. Miller's avatar
      Merge branch 'r8169-xmit_more' · a1f2d60a
      David S. Miller authored
      Heiner Kallweit says:
      
      ====================
      r8169: make use of xmit_more and __netdev_sent_queue
      
      This series adds helper __netdev_sent_queue to the core and makes use
      of it in the r8169 driver.
      
      Heiner Kallweit (2):
        net: core: add __netdev_sent_queue as variant of __netdev_tx_sent_queue
        r8169: make use of xmit_more and __netdev_sent_queue
      
      v2:
      - fix minor style issue
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a1f2d60a
    • Heiner Kallweit's avatar
      r8169: make use of xmit_more and __netdev_sent_queue · 2e6eedb4
      Heiner Kallweit authored
      Make use of xmit_more and add the functionality introduced with
      3e59020a ("net: bql: add __netdev_tx_sent_queue()").
      I used the mlx4 driver as template.
      Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2e6eedb4
    • Heiner Kallweit's avatar
      net: core: add __netdev_sent_queue as variant of __netdev_tx_sent_queue · 620344c4
      Heiner Kallweit authored
      Similar to netdev_sent_queue add helper __netdev_sent_queue as variant
      of __netdev_tx_sent_queue.
      Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      620344c4
    • Willem de Bruijn's avatar
      selftests/net: add txring_overwrite · 358be656
      Willem de Bruijn authored
      Packet sockets with PACKET_TX_RING send skbs with user data in frags.
      
      Before commit 5cd8d46e ("packet: copy user buffers before orphan
      or clone") ring slots could be released prematurely, possibly allowing
      a process to overwrite data still in flight.
      
      This test opens two packet sockets, one to send and one to read.
      The sender has a tx ring of one slot. It sends two packets with
      different payload, then reads both and verifies their payload.
      
      Before the above commit, both receive calls return the same data as
      the send calls use the same buffer. From the commit, the clone
      needed for looping onto a packet socket triggers an skb_copy_ubufs
      to create a private copy. The separate sends each arrive correctly.
      Signed-off-by: default avatarWillem de Bruijn <willemb@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      358be656