1. 18 Jun, 2019 8 commits
  2. 17 Jun, 2019 32 commits
    • David S. Miller's avatar
      Merge branch 'UDP-GSO-audit-tests' · f97252a8
      David S. Miller authored
      Fred Klassen says:
      
      ====================
      UDP GSO audit tests
      
      Updates to UDP GSO selftests ot optionally stress test CMSG
      subsytem, and report the reliability and performance of both
      TX Timestamping and ZEROCOPY messages.
      ====================
      Acked-by: default avatarWillem de Bruijn <willemb@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f97252a8
    • Fred Klassen's avatar
      net/udpgso_bench.sh test fails on error · 4ffc37f5
      Fred Klassen authored
      Ensure that failure on any individual test results in an overall
      failure of the test script.
      Signed-off-by: default avatarFred Klassen <fklassen@appneta.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4ffc37f5
    • Fred Klassen's avatar
      net/udpgso_bench.sh add UDP GSO audit tests · ade90d69
      Fred Klassen authored
      Audit tests count the total number of messages sent and compares
      with total number of CMSG received on error queue. Example:
      
          udp gso zerocopy timestamp audit
          udp rx:   1599 MB/s  1166414 calls/s
          udp tx:   1615 MB/s    27395 calls/s  27395 msg/s
          udp rx:   1634 MB/s  1192261 calls/s
          udp tx:   1633 MB/s    27699 calls/s  27699 msg/s
          udp rx:   1633 MB/s  1191358 calls/s
          udp tx:   1631 MB/s    27678 calls/s  27678 msg/s
          Summary over 4.000 seconds...
          sum udp tx:   1665 MB/s      82772 calls (27590/s)      82772 msgs (27590/s)
          Tx Timestamps:               82772 received                 0 errors
          Zerocopy acks:               82772 received
      
      Errors are thrown if CMSG count does not equal send count,
      example:
      
          Summary over 4.000 seconds...
          sum tcp tx:   7451 MB/s     493706 calls (123426/s)     493706 msgs (123426/s)
          ./udpgso_bench_tx: Unexpected number of Zerocopy completions:    493706 expected    493704 received
      
      Also reduce individual test time from 4 to 3 seconds so that
      overall test time does not increase significantly.
      
      v3: Enhancements as per Willem de Bruijn <willemb@google.com>
          - document -P option for TCP audit
      Signed-off-by: default avatarFred Klassen <fklassen@appneta.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ade90d69
    • Fred Klassen's avatar
      net/udpgso_bench_tx: options to exercise TX CMSG · 79ebc3c2
      Fred Klassen authored
      This enhancement adds options that facilitate load testing with
      additional TX CMSG options, and to optionally print results of
      various send CMSG operations.
      
      These options are especially useful in isolating situations
      where error-queue messages are lost when combined with other
      CMSG operations (e.g. SO_ZEROCOPY).
      
      New options:
          -a - count all CMSG messages and match to sent messages
          -T - add TX CMSG that requests TX software timestamps
          -H - similar to -T except request TX hardware timestamps
          -P - call poll() before reading error queue
          -v - print detailed results
      
      v2: Enhancements as per Willem de Bruijn <willemb@google.com>
          - Updated control and buffer parameters for recvmsg
          - poll() parameter cleanup
          - fail on bad audit results
          - remove TOS options
          - improved reporting
      
      v3: Enhancements as per Willem de Bruijn <willemb@google.com>
          - add SOF_TIMESTAMPING_OPT_TSONLY to eliminate MSG_TRUNC
          - general code cleanup
      Signed-off-by: default avatarFred Klassen <fklassen@appneta.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      79ebc3c2
    • Linus Torvalds's avatar
      Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs · 29f785ff
      Linus Torvalds authored
      Pull vfs fixes from Al Viro:
       "MS_MOVE regression fix + breakage in fsmount(2) (also introduced in
        this cycle, along with fsmount(2) itself).
      
        I'm still digging through the piles of mail, so there might be more
        fixes to follow, but these two are obvious and self-contained, so
        there's no point delaying those..."
      
      * 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
        fs/namespace: fix unprivileged mount propagation
        vfs: fsmount: add missing mntget()
      29f785ff
    • David S. Miller's avatar
      Merge branch 'net-ipv4-remove-erroneous-advancement-of-list-pointer' · 4bd366ce
      David S. Miller authored
      Florian Westphal says:
      
      ====================
      net: ipv4: remove erroneous advancement of list pointer
      
      Tariq reported a soft lockup on net-next that Mellanox was able to
      bisect to 2638eb8b ("net: ipv4: provide __rcu annotation for ifa_list").
      
      While reviewing above patch I found a regression when addresses have a
      lifetime specified.
      
      Second patch extends rtnetlink.sh to trigger crash
      (without first patch applied).
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4bd366ce
    • Florian Westphal's avatar
      selftests: rtnetlink: add addresses with fixed life time · 3cfa1488
      Florian Westphal authored
      This exercises kernel code path that deal with addresses that have
      a limited lifetime.
      
      Without previous fix, this triggers following crash on net-next:
       BUG: KASAN: null-ptr-deref in check_lifetime+0x403/0x670
       Read of size 8 at addr 0000000000000010 by task kworker [..]
      Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3cfa1488
    • Florian Westphal's avatar
      net: ipv4: remove erroneous advancement of list pointer · 40008e92
      Florian Westphal authored
      Causes crash when lifetime expires on an adress as garbage is
      dereferenced soon after.
      
      This used to look like this:
      
       for (ifap = &ifa->ifa_dev->ifa_list;
            *ifap != NULL; ifap = &(*ifap)->ifa_next) {
                if (*ifap == ifa) ...
      
      but this was changed to:
      
      struct in_ifaddr *tmp;
      
      ifap = &ifa->ifa_dev->ifa_list;
      tmp = rtnl_dereference(*ifap);
      while (tmp) {
         tmp = rtnl_dereference(tmp->ifa_next); // Bogus
         if (rtnl_dereference(*ifap) == ifa) {
           ...
         ifap = &tmp->ifa_next;		// Can be NULL
         tmp = rtnl_dereference(*ifap);	// Dereference
         }
      }
      
      Remove the bogus assigment/list entry skip.
      
      Fixes: 2638eb8b ("net: ipv4: provide __rcu annotation for ifa_list")
      Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      40008e92
    • Arnd Bergmann's avatar
      net: dsa: sja1105: fix ptp link error · 78fe8a28
      Arnd Bergmann authored
      Due to a reversed dependency, it is possible to build
      the lower ptp driver as a loadable module and the actual
      driver using it as built-in, causing a link error:
      
      drivers/net/dsa/sja1105/sja1105_spi.o: In function `sja1105_static_config_upload':
      sja1105_spi.c:(.text+0x6f0): undefined reference to `sja1105_ptp_reset'
      drivers/net/dsa/sja1105/sja1105_spi.o:(.data+0x2d4): undefined reference to `sja1105et_ptp_cmd'
      drivers/net/dsa/sja1105/sja1105_spi.o:(.data+0x604): undefined reference to `sja1105pqrs_ptp_cmd'
      drivers/net/dsa/sja1105/sja1105_main.o: In function `sja1105_remove':
      sja1105_main.c:(.text+0x8d4): undefined reference to `sja1105_ptp_clock_unregister'
      drivers/net/dsa/sja1105/sja1105_main.o: In function `sja1105_rxtstamp_work':
      sja1105_main.c:(.text+0x964): undefined reference to `sja1105_tstamp_reconstruct'
      drivers/net/dsa/sja1105/sja1105_main.o: In function `sja1105_setup':
      sja1105_main.c:(.text+0xb7c): undefined reference to `sja1105_ptp_clock_register'
      drivers/net/dsa/sja1105/sja1105_main.o: In function `sja1105_port_deferred_xmit':
      sja1105_main.c:(.text+0x1fa0): undefined reference to `sja1105_ptpegr_ts_poll'
      sja1105_main.c:(.text+0x1fc4): undefined reference to `sja1105_tstamp_reconstruct'
      drivers/net/dsa/sja1105/sja1105_main.o:(.rodata+0x5b0): undefined reference to `sja1105_get_ts_info'
      
      Change the Makefile logic to always build the ptp module
      the same way as the rest. Another option would be to
      just add it to the same module and remove the exports,
      but I don't know if there was a good reason to keep them
      separate.
      
      Fixes: bb77f36a ("net: dsa: sja1105: Add support for the PTP clock")
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      78fe8a28
    • Arnd Bergmann's avatar
      net: stmmac: fix unused-variable warning · c63d1e5c
      Arnd Bergmann authored
      When building without CONFIG_OF, we get a harmless build warning:
      
      drivers/net/ethernet/stmicro/stmmac/stmmac_main.c: In function 'stmmac_phy_setup':
      drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:973:22: error: unused variable 'node' [-Werror=unused-variable]
        struct device_node *node = priv->plat->phy_node;
      
      Reword it so we always use the local variable, by making it the
      fwnode pointer instead of the device_node.
      
      Fixes: 74371272 ("net: stmmac: Convert to phylink and remove phylib logic")
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c63d1e5c
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · da0f3820
      Linus Torvalds authored
      Pull networking fixes from David Miller:
       "Lots of bug fixes here:
      
         1) Out of bounds access in __bpf_skc_lookup, from Lorenz Bauer.
      
         2) Fix rate reporting in cfg80211_calculate_bitrate_he(), from John
            Crispin.
      
         3) Use after free in psock backlog workqueue, from John Fastabend.
      
         4) Fix source port matching in fdb peer flow rule of mlx5, from Raed
            Salem.
      
         5) Use atomic_inc_not_zero() in fl6_sock_lookup(), from Eric Dumazet.
      
         6) Network header needs to be set for packet redirect in nfp, from
            John Hurley.
      
         7) Fix udp zerocopy refcnt, from Willem de Bruijn.
      
         8) Don't assume linear buffers in vxlan and geneve error handlers,
            from Stefano Brivio.
      
         9) Fix TOS matching in mlxsw, from Jiri Pirko.
      
        10) More SCTP cookie memory leak fixes, from Neil Horman.
      
        11) Fix VLAN filtering in rtl8366, from Linus Walluij.
      
        12) Various TCP SACK payload size and fragmentation memory limit fixes
            from Eric Dumazet.
      
        13) Use after free in pneigh_get_next(), also from Eric Dumazet.
      
        14) LAPB control block leak fix from Jeremy Sowden"
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (145 commits)
        lapb: fixed leak of control-blocks.
        tipc: purge deferredq list for each grp member in tipc_group_delete
        ax25: fix inconsistent lock state in ax25_destroy_timer
        neigh: fix use-after-free read in pneigh_get_next
        tcp: fix compile error if !CONFIG_SYSCTL
        hv_sock: Suppress bogus "may be used uninitialized" warnings
        be2net: Fix number of Rx queues used for flow hashing
        net: handle 802.1P vlan 0 packets properly
        tcp: enforce tcp_min_snd_mss in tcp_mtu_probing()
        tcp: add tcp_min_snd_mss sysctl
        tcp: tcp_fragment() should apply sane memory limits
        tcp: limit payload size of sacked skbs
        Revert "net: phylink: set the autoneg state in phylink_phy_change"
        bpf: fix nested bpf tracepoints with per-cpu data
        bpf: Fix out of bounds memory access in bpf_sk_storage
        vsock/virtio: set SOCK_DONE on peer shutdown
        net: dsa: rtl8366: Fix up VLAN filtering
        net: phylink: set the autoneg state in phylink_phy_change
        net: add high_order_alloc_disable sysctl/static key
        tcp: add tcp_tx_skb_cache sysctl
        ...
      da0f3820
    • Mitch Williams's avatar
      iavf: allow null RX descriptors · efa14c39
      Mitch Williams authored
      In some circumstances, the hardware can hand us a null receive
      descriptor, with no data attached but otherwise valid. Unfortunately,
      the driver was ill-equipped to handle such an event, and would stop
      processing packets at that point.
      
      To fix this, use the Descriptor Done bit instead of the size to
      determine whether or not a descriptor is ready to be processed. Add some
      checks to allow for unused buffers.
      Signed-off-by: default avatarMitch Williams <mitch.a.williams@intel.com>
      Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      efa14c39
    • Paul Greenwalt's avatar
      iavf: add call to iavf_[add|del]_cloud_filter · 68dfe634
      Paul Greenwalt authored
      Add call to iavf_add_cloud_filter and iavf_del_cloud_filter from
      iavf_process_aq_command to clear aq_required
      IAVF_FLAG_AQ_ADD_CLOUD_FILTER and IAVF_FLAG_AQ_DEL_CLOUD_FILTER bits.
      
      aq_required IAVF_FLAG_AQ_DEL_CLOUD_FILTER bit is being set in
      iavf_down and iavf_delete_clsflower, and are never cleared.
      
      aq_required IAVF_FLAG_AQ_ADD_CLOUD_FILTER bit is being set in
      iavf_handle_reset and iavf_configure_clsflower, and are never
      cleared.
      
      Since the aq_required is not zero, iavf_watchdog_task is setting the
      queue_delayed_work to 20 msec instead of the longer delay.
      Signed-off-by: default avatarPaul Greenwalt <paul.greenwalt@intel.com>
      Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      68dfe634
    • Jakub Pawlak's avatar
      iavf: Refactor init state machine · b66c7bc1
      Jakub Pawlak authored
      Cleanup of init state machine, move state specific
      code to separate functions and rewrite the
      iavf_init_task() function.
      Signed-off-by: default avatarJakub Pawlak <jakub.pawlak@intel.com>
      Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      b66c7bc1
    • Jan Sokolowski's avatar
      iavf: Refactor the watchdog state machine · bac84861
      Jan Sokolowski authored
      Refactor the watchdog state machine implementation.
      Add the additional state __IAVF_COMM_FAILED to process
      the PF communication fails. Prepare the watchdog state machine
      to integrate with init state machine.
      Signed-off-by: default avatarJan Sokolowski <jan.sokolowski@intel.com>
      Signed-off-by: default avatarJakub Pawlak <jakub.pawlak@intel.com>
      Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      bac84861
    • Jakub Pawlak's avatar
      iavf: Remove timer for work triggering, use delaying work instead · fdd4044f
      Jakub Pawlak authored
      Remove the watchdog timer, instead declare watchdog task
      as delayed work and use dedicated workqueue to service driver
      tasks. The dedicated driver workqueue iavf_wq is common
      for all driver instances.
      Signed-off-by: default avatarJakub Pawlak <jakub.pawlak@intel.com>
      Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      fdd4044f
    • Jakub Pawlak's avatar
      iavf: Move commands processing to the separate function · b476b003
      Jakub Pawlak authored
      Move the commands processing outside the watchdog_task()
      function. This reduce length and complexity of the function
      which is mainly designed to process the watchdog state machine.
      Signed-off-by: default avatarJakub Pawlak <jakub.pawlak@intel.com>
      Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      b476b003
    • Avinash Dayanand's avatar
      iavf: Fix the math for valid length for ADq enable · 16e00c25
      Avinash Dayanand authored
      There was a calculation error in virtchnl regarding the valid
      length which was fixed recently and a corresponding change needs
      to go into the code while we enable ADq.
      Signed-off-by: default avatarAvinash Dayanand <avinash.dayanand@intel.com>
      Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      16e00c25
    • Aleksandr Loktionov's avatar
      iavf: Change GFP_KERNEL to GFP_ATOMIC in kzalloc() · f0a48fb4
      Aleksandr Loktionov authored
      iavf_add_vlan() is being called in atomic context
      so kzalloc() needs GFP_ATOMIC. This patch fixes it.
      Signed-off-by: default avatarAleksandr Loktionov <aleksandr.loktionov@intel.com>
      Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      f0a48fb4
    • Mitch Williams's avatar
      iavf: wait longer for close to complete · 88ec7308
      Mitch Williams authored
      On some hardware/driver/architecture combinations, it may take longer
      than 200msec for all close operations to be completed, causing a
      spurious error message to be logged.
      
      Increase the timeout value to 500msec to avoid this erroneous error.
      Signed-off-by: default avatarMitch Williams <mitch.a.williams@intel.com>
      Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      88ec7308
    • Mitch Williams's avatar
      iavf: use signed variable · 168d91cf
      Mitch Williams authored
      The counter variable in iavf_clean_tx_irq starts out negative and climbs
      to 0. So allocating it as u16 is actually a really bad idea that just
      happens to work because the value underflows and overflows consistently
      on most architectures.
      
      Replace the u16 with an int so signed math works as expected.
      Signed-off-by: default avatarMitch Williams <mitch.a.williams@intel.com>
      Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      168d91cf
    • Akeem G Abodunrin's avatar
      iavf: Create VLAN tag elements starting from the first element · c2417a7b
      Akeem G Abodunrin authored
      This patch changes how VLAN tag are being populated and programmed into
      the HW - Instead of start adding VF VLAN tag from the last member of the
      element list, start from the first member of the list, until number of
      allowed VLAN tags is exhausted in the HW.
      Signed-off-by: default avatarAkeem G Abodunrin <akeem.g.abodunrin@intel.com>
      Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      c2417a7b
    • Christian Brauner's avatar
      fs/namespace: fix unprivileged mount propagation · d728cf79
      Christian Brauner authored
      When propagating mounts across mount namespaces owned by different user
      namespaces it is not possible anymore to move or umount the mount in the
      less privileged mount namespace.
      
      Here is a reproducer:
      
        sudo mount -t tmpfs tmpfs /mnt
        sudo --make-rshared /mnt
      
        # create unprivileged user + mount namespace and preserve propagation
        unshare -U -m --map-root --propagation=unchanged
      
        # now change back to the original mount namespace in another terminal:
        sudo mkdir /mnt/aaa
        sudo mount -t tmpfs tmpfs /mnt/aaa
      
        # now in the unprivileged user + mount namespace
        mount --move /mnt/aaa /opt
      
      Unfortunately, this is a pretty big deal for userspace since this is
      e.g. used to inject mounts into running unprivileged containers.
      So this regression really needs to go away rather quickly.
      
      The problem is that a recent change falsely locked the root of the newly
      added mounts by setting MNT_LOCKED. Fix this by only locking the mounts
      on copy_mnt_ns() and not when adding a new mount.
      
      Fixes: 3bd045cc ("separate copying and locking mount tree on cross-userns copies")
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: <stable@vger.kernel.org>
      Tested-by: default avatarChristian Brauner <christian@brauner.io>
      Acked-by: default avatarChristian Brauner <christian@brauner.io>
      Signed-off-by: default avatar"Eric W. Biederman" <ebiederm@xmission.com>
      Signed-off-by: default avatarChristian Brauner <christian@brauner.io>
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      d728cf79
    • Eric Biggers's avatar
      vfs: fsmount: add missing mntget() · 1b0b9cc8
      Eric Biggers authored
      sys_fsmount() needs to take a reference to the new mount when adding it
      to the anonymous mount namespace.  Otherwise the filesystem can be
      unmounted while it's still in use, as found by syzkaller.
      Reported-by: default avatarMark Rutland <mark.rutland@arm.com>
      Reported-by: syzbot+99de05d099a170867f22@syzkaller.appspotmail.com
      Reported-by: syzbot+7008b8b8ba7df475fdc8@syzkaller.appspotmail.com
      Fixes: 93766fbd ("vfs: syscall: Add fsmount() to create a mount for a superblock")
      Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      1b0b9cc8
    • Jiri Pirko's avatar
      net: sched: cls_matchall: allow to delete filter · f517f271
      Jiri Pirko authored
      Currently user is unable to delete the filter. See following example:
      $ tc filter add dev ens16np1 ingress pref 1 handle 1 matchall action drop
      $ tc filter show dev ens16np1 ingress
      filter protocol all pref 1 matchall chain 0
      filter protocol all pref 1 matchall chain 0 handle 0x1
        in_hw
              action order 1: gact action drop
               random type none pass val 0
               index 1 ref 1 bind 1
      
      $ tc filter del dev ens16np1 ingress pref 1 handle 1 matchall action drop
      RTNETLINK answers: Operation not supported
      
      Implement tcf_proto_ops->delete() op and allow user to delete the filter.
      Reported-by: default avatarEli Cohen <eli@mellanox.com>
      Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f517f271
    • Colin Ian King's avatar
      net: hns3: fix dereference of ae_dev before it is null checked · ad9bf545
      Colin Ian King authored
      Pointer ae_dev is null checked however, prior to that it is dereferenced
      when assigned pointer ops. Fix this by assigning pointer ops after ae_dev
      has been null checked.
      
      Addresses-Coverity: ("Dereference before null check")
      Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ad9bf545
    • David S. Miller's avatar
      Merge branch 'net-sched-act_ctinfo-fixes' · 43321251
      David S. Miller authored
      Kevin Darbyshire-Bryant says:
      
      ====================
      net: sched: act_ctinfo: fixes
      
      This is first attempt at sending a small series.  Order is important
      because one bug (policy validation) prevents us from encountering the
      more important 'OOPS' generating bug in action creation.  Fix the OOPS
      first.
      
      Confession time: Until very recently, development of this module has
      been done on 'net-next' tree to 'clean compile' level with run-time
      testing on backports to 4.14 & 4.19 kernels under openwrt.  It turns out
      that sched: action: based code has been under more active change than I
      realised.
      
      During the back & forward porting during development & testing, the
      critical ACT_P_CREATED return code got missed despite being in the 4.14
      & 4.19 backports.  I have now gone through the init functions, using
      act_csum as reference with a fine toothed comb and am happy they do the
      same things.
      
      This issue hadn't been caught till now due to another issue caused by
      new strict nla_parse_nested function failing parsing validation before
      action creation.
      
      Thanks to Marcelo Leitner <marcelo.leitner@gmail.com> for flagging
      extack deficiency (fixed in 733f0766 sched: act_ctinfo: use extack
      error reporting) which led to b424e432 ("netlink: add validation of
      NLA_F_NESTED flag") and 8cb08174 ("netlink: make validation more
      configurable for future strictness”) which led to the policy validation
      fix, which then led to the action creation fix both contained in this
      series.
      
      If I ever get to a developer conference please feel free to
      tar/feather/apply cone of shame.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      43321251
    • Kevin Darbyshire-Bryant's avatar
      net: sched: act_ctinfo: fix policy validation · c197d636
      Kevin Darbyshire-Bryant authored
      Fix nla_policy definition by specifying an exact length type attribute
      to CTINFO action paraneter block structure.  Without this change,
      netlink parsing will fail validation and the action will not be
      instantiated.
      
      8cb08174 ("netlink: make validation more configurable for future")
      introduced much stricter checking to attributes being passed via
      netlink.  Existing actions were updated to use less restrictive
      deprecated versions of nla_parse_nested.
      
      As a new module, act_ctinfo should be designed to use the strict
      checking model otherwise, well, what was the point of implementing it.
      
      Confession time: Until very recently, development of this module has
      been done on 'net-next' tree to 'clean compile' level with run-time
      testing on backports to 4.14 & 4.19 kernels under openwrt.  This is how
      I managed to miss the run-time impacts of the new strict
      nla_parse_nested function.  I hopefully have learned something from this
      (glances toward laptop running a net-next kernel)
      
      There is however a still outstanding implication on iproute2 user space
      in that it needs to be told to pass nested netlink messages with the
      nested attribute actually set.  So even with this kernel fix to do
      things correctly you still cannot instantiate a new 'strict'
      nla_parse_nested based action such as act_ctinfo with iproute2's tc.
      Signed-off-by: default avatarKevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c197d636
    • Kevin Darbyshire-Bryant's avatar
      net: sched: act_ctinfo: fix action creation · a658c2e4
      Kevin Darbyshire-Bryant authored
      Use correct return value on action creation: ACT_P_CREATED.
      
      The use of incorrect return value could result in a situation where the
      system thought a ctinfo module was listening but actually wasn't
      instantiated correctly leading to an OOPS in tcf_generic_walker().
      
      Confession time: Until very recently, development of this module has
      been done on 'net-next' tree to 'clean compile' level with run-time
      testing on backports to 4.14 & 4.19 kernels under openwrt.  During the
      back & forward porting during development & testing, the critical
      ACT_P_CREATED return code got missed despite being in the 4.14 & 4.19
      backports.  I have now gone through the init functions, using act_csum
      as reference with a fine toothed comb.  Bonus, no more OOPSes.  I
      managed to also miss this issue till now due to the new strict
      nla_parse_nested function failing validation before action creation.
      
      As an inexperienced developer I've learned that
      copy/pasting/backporting/forward porting code correctly is hard.  If I
      ever get to a developer conference I shall don the cone of shame.
      Signed-off-by: default avatarKevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a658c2e4
    • Jason Wang's avatar
      vhost_net: disable zerocopy by default · 098eadce
      Jason Wang authored
      Vhost_net was known to suffer from HOL[1] issues which is not easy to
      fix. Several downstream disable the feature by default. What's more,
      the datapath was split and datacopy path got the support of batching
      and XDP support recently which makes it faster than zerocopy part for
      small packets transmission.
      
      It looks to me that disable zerocopy by default is more
      appropriate. It cold be enabled by default again in the future if we
      fix the above issues.
      
      [1] https://patchwork.kernel.org/patch/3787671/Signed-off-by: default avatarJason Wang <jasowang@redhat.com>
      Acked-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      098eadce
    • Ard Biesheuvel's avatar
      net: ipv4: move tcp_fastopen server side code to SipHash library · c681edae
      Ard Biesheuvel authored
      Using a bare block cipher in non-crypto code is almost always a bad idea,
      not only for security reasons (and we've seen some examples of this in
      the kernel in the past), but also for performance reasons.
      
      In the TCP fastopen case, we call into the bare AES block cipher one or
      two times (depending on whether the connection is IPv4 or IPv6). On most
      systems, this results in a call chain such as
      
        crypto_cipher_encrypt_one(ctx, dst, src)
          crypto_cipher_crt(tfm)->cit_encrypt_one(crypto_cipher_tfm(tfm), ...);
            aesni_encrypt
              kernel_fpu_begin();
              aesni_enc(ctx, dst, src); // asm routine
              kernel_fpu_end();
      
      It is highly unlikely that the use of special AES instructions has a
      benefit in this case, especially since we are doing the above twice
      for IPv6 connections, instead of using a transform which can process
      the entire input in one go.
      
      We could switch to the cbcmac(aes) shash, which would at least get
      rid of the duplicated overhead in *some* cases (i.e., today, only
      arm64 has an accelerated implementation of cbcmac(aes), while x86 will
      end up using the generic cbcmac template wrapping the AES-NI cipher,
      which basically ends up doing exactly the above). However, in the given
      context, it makes more sense to use a light-weight MAC algorithm that
      is more suitable for the purpose at hand, such as SipHash.
      
      Since the output size of SipHash already matches our chosen value for
      TCP_FASTOPEN_COOKIE_SIZE, and given that it accepts arbitrary input
      sizes, this greatly simplifies the code as well.
      
      NOTE: Server farms backing a single server IP for load balancing purposes
            and sharing a single fastopen key will be adversely affected by
            this change unless all systems in the pool receive their kernel
            upgrades at the same time.
      Signed-off-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c681edae
    • Tuong Lien's avatar
      tipc: include retrans failure detection for unicast · 6a6b5c8b
      Tuong Lien authored
      In patch series, commit 9195948f ("tipc: improve TIPC throughput by
      Gap ACK blocks"), as for simplicity, the repeated retransmit failures'
      detection in the function - "tipc_link_retrans()" was kept there for
      broadcast retransmissions only.
      
      This commit now reapplies this feature for link unicast retransmissions
      that has been done via the function - "tipc_link_advance_transmq()".
      
      Also, the "tipc_link_retrans()" is renamed to "tipc_link_bc_retrans()"
      as it is used only for broadcast.
      Acked-by: default avatarJon Maloy <jon.maloy@ericsson.se>
      Signed-off-by: default avatarTuong Lien <tuong.t.lien@dektech.com.au>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6a6b5c8b