1. 09 Oct, 2017 17 commits
    • David S. Miller's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf · fb60bccc
      David S. Miller authored
      Pablo Neira Ayuso says:
      
      ====================
      Netfilter/IPVS fixes for net
      
      The following patchset contains Netfilter/IPVS fixes for your net tree,
      they are:
      
      1) Fix packet drops due to incorrect ECN handling in IPVS, from Vadim
         Fedorenko.
      
      2) Fix splat with mark restoration in xt_socket with non-full-sock,
         patch from Subash Abhinov Kasiviswanathan.
      
      3) ipset bogusly bails out when adding IPv4 range containing more than
         2^31 addresses, from Jozsef Kadlecsik.
      
      4) Incorrect pernet unregistration order in ipset, from Florian Westphal.
      
      5) Races between dump and swap in ipset results in BUG_ON splats, from
         Ross Lagerwall.
      
      6) Fix chain renames in nf_tables, from JingPiao Chen.
      
      7) Fix race in pernet codepath with ebtables table registration, from
         Artem Savkov.
      
      8) Memory leak in error path in set name allocation in nf_tables, patch
         from Arvind Yadav.
      
      9) Don't dump chain counters if they are not available, this fixes a
         crash when listing the ruleset.
      
      10) Fix out of bound memory read in strlcpy() in x_tables compat code,
          from Eric Dumazet.
      
      11) Make sure we only process TCP packets in SYNPROXY hooks, patch from
          Lin Zhang.
      
      12) Cannot load rules incrementally anymore after xt_bpf with pinned
          objects, added in revision 1. From Shmulik Ladkani.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      fb60bccc
    • David S. Miller's avatar
      Merge branch '10GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-queue · 5766cd68
      David S. Miller authored
      Jeff Kirsher says:
      
      ====================
      Intel Wired LAN Driver Updates 2017-10-09
      
      This series contains updates to ixgbe and arch/Kconfig.
      
      Mark fixes a case where PHY register access is not supported and we were
      returning a PHY address, when we should have been returning -EOPNOTSUPP.
      
      Sabrina Dubroca fixes the use of a logical "and" when it should have been
      the bitwise "and" operator.
      
      Ding Tianhong reverts the commit that added the Kconfig bool option
      ARCH_WANT_RELAX_ORDER, since there is now a new flag
      PCI_DEV_FLAGS_NO_RELAXED_ORDERING that has been added to indicate that
      Relaxed Ordering Attributes should not be used for Transaction Layer
      Packets.  Then follows up with making the needed changes to ixgbe to
      use the new PCI_DEV_FLAGS_NO_RELAXED_ORDERING flag.
      
      John Fastabend fixes an issue in the ring accounting when the transmit
      ring parameters are changed via ethtool when an XDP program is attached.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5766cd68
    • Paolo Abeni's avatar
      udp: fix bcast packet reception · 996b44fc
      Paolo Abeni authored
      The commit bc044e8d ("udp: perform source validation for
      mcast early demux") does not take into account that broadcast packets
      lands in the same code path and they need different checks for the
      source address - notably, zero source address are valid for bcast
      and invalid for mcast.
      
      As a result, 2nd and later broadcast packets with 0 source address
      landing to the same socket are dropped. This breaks dhcp servers.
      
      Since we don't have stringent performance requirements for ingress
      broadcast traffic, fix it by disabling UDP early demux such traffic.
      Reported-by: default avatarHannes Frederic Sowa <hannes@stressinduktion.org>
      Fixes: bc044e8d ("udp: perform source validation for mcast early demux")
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      996b44fc
    • Jason A. Donenfeld's avatar
      netlink: do not set cb_running if dump's start() errs · 41c87425
      Jason A. Donenfeld authored
      It turns out that multiple places can call netlink_dump(), which means
      it's still possible to dereference partially initialized values in
      dump() that were the result of a faulty returned start().
      
      This fixes the issue by calling start() _before_ setting cb_running to
      true, so that there's no chance at all of hitting the dump() function
      through any indirect paths.
      
      It also moves the call to start() to be when the mutex is held. This has
      the nice side effect of serializing invocations to start(), which is
      likely desirable anyway. It also prevents any possible other races that
      might come out of this logic.
      
      In testing this with several different pieces of tricky code to trigger
      these issues, this commit fixes all avenues that I'm aware of.
      Signed-off-by: default avatarJason A. Donenfeld <Jason@zx2c4.com>
      Cc: Johannes Berg <johannes@sipsolutions.net>
      Reviewed-by: default avatarJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      41c87425
    • David S. Miller's avatar
      Merge tag 'mac80211-for-davem-2017-10-09' of... · 6df4d17c
      David S. Miller authored
      Merge tag 'mac80211-for-davem-2017-10-09' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211
      
      Johannes Berg says:
      
      ====================
      pull-request: mac80211 2017-10-09
      
      The QCA folks found another netlink problem - we were missing validation
      of some attributes. It's not super problematic since one can only read a
      few bytes beyond the message (and that memory must exist), but here's the
      fix for it.
      
      I thought perhaps we can make nla_parse_nested() require a policy, but
      given the two-stage validation/parsing in regular netlink that won't work.
      
      Please pull and let me know if there's any problem.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6df4d17c
    • David S. Miller's avatar
      Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec · 93b03193
      David S. Miller authored
      Steffen Klassert says:
      
      ====================
      pull request (net): ipsec 2017-10-09
      
      1) Fix some error paths of the IPsec offloading API.
      
      2) Fix a NULL pointer dereference when IPsec is used
         with vti. From Alexey Kodanev.
      
      3) Don't call xfrm_policy_cache_flush under xfrm_state_lock,
         it triggers several locking warnings. From Artem Savkov.
      
      Please pull or let me know if there are problems.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      93b03193
    • Steffen Klassert's avatar
      ipv4: Fix traffic triggered IPsec connections. · 6c0e7284
      Steffen Klassert authored
      A recent patch removed the dst_free() on the allocated
      dst_entry in ipv4_blackhole_route(). The dst_free() marked the
      dst_entry as dead and added it to the gc list. I.e. it was setup
      for a one time usage. As a result we may now have a blackhole
      route cached at a socket on some IPsec scenarios. This makes the
      connection unusable.
      
      Fix this by marking the dst_entry directly at allocation time
      as 'dead', so it is used only once.
      
      Fixes: b838d5e1 ("ipv4: mark DST_NOGC and remove the operation of dst_free()")
      Reported-by: default avatarTobias Brunner <tobias@strongswan.org>
      Signed-off-by: default avatarSteffen Klassert <steffen.klassert@secunet.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6c0e7284
    • Steffen Klassert's avatar
      ipv6: Fix traffic triggered IPsec connections. · 62cf27e5
      Steffen Klassert authored
      A recent patch removed the dst_free() on the allocated
      dst_entry in ipv6_blackhole_route(). The dst_free() marked
      the dst_entry as dead and added it to the gc list. I.e. it
      was setup for a one time usage. As a result we may now have
      a blackhole route cached at a socket on some IPsec scenarios.
      This makes the connection unusable.
      
      Fix this by marking the dst_entry directly at allocation time
      as 'dead', so it is used only once.
      
      Fixes: 587fea74 ("ipv6: mark DST_NOGC and remove the operation of dst_free()")
      Reported-by: default avatarTobias Brunner <tobias@strongswan.org>
      Signed-off-by: default avatarSteffen Klassert <steffen.klassert@secunet.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      62cf27e5
    • John Fastabend's avatar
      ixgbe: incorrect XDP ring accounting in ethtool tx_frame param · 8e679021
      John Fastabend authored
      Changing the TX ring parameters with an XDP program attached may
      cause the XDP queues to be cleared and the TX rings to be incorrectly
      configured.
      
      Fix by doing correct ring accounting in setup call.
      
      Fixes: 33fdc82f ("ixgbe: add support for XDP_TX action")
      Signed-off-by: default avatarJohn Fastabend <john.fastabend@gmail.com>
      Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      8e679021
    • Ding Tianhong's avatar
      net: ixgbe: Use new PCI_DEV_FLAGS_NO_RELAXED_ORDERING flag · 5e0fac63
      Ding Tianhong authored
      The ixgbe driver use the compile check to determine if it can
      send TLPs to Root Port with the Relaxed Ordering Attribute set,
      this is too inconvenient, now the new flag PCI_DEV_FLAGS_NO_RELAXED_ORDERING
      has been added to the kernel and we could check the bit4 in the PCIe
      Device Control register to determine whether we should use the Relaxed
      Ordering Attributes or not, so use this new way in the ixgbe driver.
      Signed-off-by: default avatarDing Tianhong <dingtianhong@huawei.com>
      Acked-by: default avatarEmil Tantilov <emil.s.tantilov@intel.com>
      Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      5e0fac63
    • Ding Tianhong's avatar
      Revert commit 1a8b6d76 ("net:add one common config...") · f4986d25
      Ding Tianhong authored
      The new flag PCI_DEV_FLAGS_NO_RELAXED_ORDERING has been added
      to indicate that Relaxed Ordering Attributes (RO) should not
      be used for Transaction Layer Packets (TLP) targeted toward
      these affected Root Port, it will clear the bit4 in the PCIe
      Device Control register, so the PCIe device drivers could
      query PCIe configuration space to determine if it can send
      TLPs to Root Port with the Relaxed Ordering Attributes set.
      
      With this new flag  we don't need the config ARCH_WANT_RELAX_ORDER
      to control the Relaxed Ordering Attributes for the ixgbe drivers
      just like the commit 1a8b6d76 ("net:add one common config...") did,
      so revert this commit.
      Signed-off-by: default avatarDing Tianhong <dingtianhong@huawei.com>
      Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      f4986d25
    • Sabrina Dubroca's avatar
      ixgbe: fix masking of bits read from IXGBE_VXLANCTRL register · a39221ce
      Sabrina Dubroca authored
      In ixgbe_clear_udp_tunnel_port(), we read the IXGBE_VXLANCTRL register
      and then try to mask some bits out of the value, using the logical
      instead of bitwise and operator.
      
      Fixes: a21d0822 ("ixgbe: add support for geneve Rx offload")
      Signed-off-by: default avatarSabrina Dubroca <sd@queasysnail.net>
      Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      a39221ce
    • Mark D Rustad's avatar
      ixgbe: Return error when getting PHY address if PHY access is not supported · e0f06bba
      Mark D Rustad authored
      In cases where PHY register access is not supported, don't mislead
      a caller into thinking that it is supported by returning a PHY
      address. Instead, return -EOPNOTSUPP when PHY access is not
      supported.
      Signed-off-by: default avatarMark Rustad <mark.d.rustad@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      e0f06bba
    • Shmulik Ladkani's avatar
      netfilter: xt_bpf: Fix XT_BPF_MODE_FD_PINNED mode of 'xt_bpf_info_v1' · 98589a09
      Shmulik Ladkani authored
      Commit 2c16d603 ("netfilter: xt_bpf: support ebpf") introduced
      support for attaching an eBPF object by an fd, with the
      'bpf_mt_check_v1' ABI expecting the '.fd' to be specified upon each
      IPT_SO_SET_REPLACE call.
      
      However this breaks subsequent iptables calls:
      
       # iptables -A INPUT -m bpf --object-pinned /sys/fs/bpf/xxx -j ACCEPT
       # iptables -A INPUT -s 5.6.7.8 -j ACCEPT
       iptables: Invalid argument. Run `dmesg' for more information.
      
      That's because iptables works by loading existing rules using
      IPT_SO_GET_ENTRIES to userspace, then issuing IPT_SO_SET_REPLACE with
      the replacement set.
      
      However, the loaded 'xt_bpf_info_v1' has an arbitrary '.fd' number
      (from the initial "iptables -m bpf" invocation) - so when 2nd invocation
      occurs, userspace passes a bogus fd number, which leads to
      'bpf_mt_check_v1' to fail.
      
      One suggested solution [1] was to hack iptables userspace, to perform a
      "entries fixup" immediatley after IPT_SO_GET_ENTRIES, by opening a new,
      process-local fd per every 'xt_bpf_info_v1' entry seen.
      
      However, in [2] both Pablo Neira Ayuso and Willem de Bruijn suggested to
      depricate the xt_bpf_info_v1 ABI dealing with pinned ebpf objects.
      
      This fix changes the XT_BPF_MODE_FD_PINNED behavior to ignore the given
      '.fd' and instead perform an in-kernel lookup for the bpf object given
      the provided '.path'.
      
      It also defines an alias for the XT_BPF_MODE_FD_PINNED mode, named
      XT_BPF_MODE_PATH_PINNED, to better reflect the fact that the user is
      expected to provide the path of the pinned object.
      
      Existing XT_BPF_MODE_FD_ELF behavior (non-pinned fd mode) is preserved.
      
      References: [1] https://marc.info/?l=netfilter-devel&m=150564724607440&w=2
                  [2] https://marc.info/?l=netfilter-devel&m=150575727129880&w=2Reported-by: default avatarRafael Buchbinder <rafi@rbk.ms>
      Signed-off-by: default avatarShmulik Ladkani <shmulik.ladkani@gmail.com>
      Acked-by: default avatarWillem de Bruijn <willemb@google.com>
      Acked-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      98589a09
    • Lin Zhang's avatar
      netfilter: SYNPROXY: skip non-tcp packet in {ipv4, ipv6}_synproxy_hook · 49f817d7
      Lin Zhang authored
      In function {ipv4,ipv6}_synproxy_hook we expect a normal tcp packet, but
      the real server maybe reply an icmp error packet related to the exist
      tcp conntrack, so we will access wrong tcp data.
      
      Fix it by checking for the protocol field and only process tcp traffic.
      Signed-off-by: default avatarLin Zhang <xiaolou4617@gmail.com>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      49f817d7
    • Jon Maloy's avatar
      tipc: Unclone message at secondary destination lookup · a9e2971b
      Jon Maloy authored
      When a bundling message is received, the function tipc_link_input()
      calls function tipc_msg_extract() to unbundle all inner messages of
      the bundling message before adding them to input queue.
      
      The function tipc_msg_extract() just clones all inner skb for all
      inner messagges from the bundling skb. This means that the skb
      headroom of an inner message overlaps with the data part of the
      preceding message in the bundle.
      
      If the message in question is a name addressed message, it may be
      subject to a secondary destination lookup, and eventually be sent out
      on one of the interfaces again. But, since what is perceived as headroom
      by the device driver in reality is the last bytes of the preceding
      message in the bundle, the latter will be overwritten by the MAC
      addresses of the L2 header. If the preceding message has not yet been
      consumed by the user, it will evenually be delivered with corrupted
      contents.
      
      This commit fixes this by uncloning all messages passing through the
      function tipc_msg_lookup_dest(), hence ensuring that the headroom
      is always valid when the message is passed on.
      Signed-off-by: default avatarTung Nguyen <tung.q.nguyen@dektech.com.au>
      Signed-off-by: default avatarJon Maloy <jon.maloy@ericsson.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a9e2971b
    • Jon Maloy's avatar
      tipc: correct initialization of skb list · 3382605f
      Jon Maloy authored
      We change the initialization of the skb transmit buffer queues
      in the functions tipc_bcast_xmit() and tipc_rcast_xmit() to also
      initialize their spinlocks. This is needed because we may, during
      error conditions, need to call skb_queue_purge() on those queues
      further down the stack.
      Signed-off-by: default avatarJon Maloy <jon.maloy@ericsson.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3382605f
  2. 08 Oct, 2017 2 commits
  3. 07 Oct, 2017 3 commits
    • Alexei Starovoitov's avatar
      bpf: fix liveness marking · 8fe2d6cc
      Alexei Starovoitov authored
      while processing Rx = Ry instruction the verifier does
      regs[insn->dst_reg] = regs[insn->src_reg]
      which often clears write mark (when Ry doesn't have it)
      that was just set by check_reg_arg(Rx) prior to the assignment.
      That causes mark_reg_read() to keep marking Rx in this block as
      REG_LIVE_READ (since the logic incorrectly misses that it's
      screened by the write) and in many of its parents (until lucky
      write into the same Rx or beginning of the program).
      That causes is_state_visited() logic to miss many pruning opportunities.
      
      Furthermore mark_reg_read() logic propagates the read mark
      for BPF_REG_FP as well (though it's readonly) which causes
      harmless but unnecssary work during is_state_visited().
      Note that do_propagate_liveness() skips FP correctly,
      so do the same in mark_reg_read() as well.
      It saves 0.2 seconds for the test below
      
      program               before  after
      bpf_lb-DLB_L3.o       2604    2304
      bpf_lb-DLB_L4.o       11159   3723
      bpf_lb-DUNKNOWN.o     1116    1110
      bpf_lxc-DDROP_ALL.o   34566   28004
      bpf_lxc-DUNKNOWN.o    53267   39026
      bpf_netdev.o          17843   16943
      bpf_overlay.o         8672    7929
      time                  ~11 sec  ~4 sec
      
      Fixes: dc503a8a ("bpf/verifier: track liveness for pruning")
      Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
      Acked-by: default avatarEdward Cree <ecree@solarflare.com>
      Acked-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8fe2d6cc
    • Axel Beckert's avatar
      doc: Fix typo "8023.ad" in bonding documentation · 00a534e5
      Axel Beckert authored
      Should be "802.3ad" like everywhere else in the document.
      Signed-off-by: default avatarAxel Beckert <abe@deuxchevaux.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      00a534e5
    • Matteo Croce's avatar
      ipv6: fix net.ipv6.conf.all.accept_dad behaviour for real · a2d3f3e3
      Matteo Croce authored
      Commit 35e015e1 ("ipv6: fix net.ipv6.conf.all interface DAD handlers")
      was intended to affect accept_dad flag handling in such a way that
      DAD operation and mode on a given interface would be selected
      according to the maximum value of conf/{all,interface}/accept_dad.
      
      However, addrconf_dad_begin() checks for particular cases in which we
      need to skip DAD, and this check was modified in the wrong way.
      
      Namely, it was modified so that, if the accept_dad flag is 0 for the
      given interface *or* for all interfaces, DAD would be skipped.
      
      We have instead to skip DAD if accept_dad is 0 for the given interface
      *and* for all interfaces.
      
      Fixes: 35e015e1 ("ipv6: fix net.ipv6.conf.all interface DAD handlers")
      Acked-by: default avatarStefano Brivio <sbrivio@redhat.com>
      Signed-off-by: default avatarMatteo Croce <mcroce@redhat.com>
      Reported-by: default avatarErik Kline <ek@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a2d3f3e3
  4. 06 Oct, 2017 4 commits
    • Guillaume Nault's avatar
      ppp: fix race in ppp device destruction · 6151b8b3
      Guillaume Nault authored
      ppp_release() tries to ensure that netdevices are unregistered before
      decrementing the unit refcount and running ppp_destroy_interface().
      
      This is all fine as long as the the device is unregistered by
      ppp_release(): the unregister_netdevice() call, followed by
      rtnl_unlock(), guarantee that the unregistration process completes
      before rtnl_unlock() returns.
      
      However, the device may be unregistered by other means (like
      ppp_nl_dellink()). If this happens right before ppp_release() calling
      rtnl_lock(), then ppp_release() has to wait for the concurrent
      unregistration code to release the lock.
      But rtnl_unlock() releases the lock before completing the device
      unregistration process. This allows ppp_release() to proceed and
      eventually call ppp_destroy_interface() before the unregistration
      process completes. Calling free_netdev() on this partially unregistered
      device will BUG():
      
       ------------[ cut here ]------------
       kernel BUG at net/core/dev.c:8141!
       invalid opcode: 0000 [#1] SMP
      
       CPU: 1 PID: 1557 Comm: pppd Not tainted 4.14.0-rc2+ #4
       Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.2-1.fc26 04/01/2014
      
       Call Trace:
        ppp_destroy_interface+0xd8/0xe0 [ppp_generic]
        ppp_disconnect_channel+0xda/0x110 [ppp_generic]
        ppp_unregister_channel+0x5e/0x110 [ppp_generic]
        pppox_unbind_sock+0x23/0x30 [pppox]
        pppoe_connect+0x130/0x440 [pppoe]
        SYSC_connect+0x98/0x110
        ? do_fcntl+0x2c0/0x5d0
        SyS_connect+0xe/0x10
        entry_SYSCALL_64_fastpath+0x1a/0xa5
      
       RIP: free_netdev+0x107/0x110 RSP: ffffc28a40573d88
       ---[ end trace ed294ff0cc40eeff ]---
      
      We could set the ->needs_free_netdev flag on PPP devices and move the
      ppp_destroy_interface() logic in the ->priv_destructor() callback. But
      that'd be quite intrusive as we'd first need to unlink from the other
      channels and units that depend on the device (the ones that used the
      PPPIOCCONNECT and PPPIOCATTACH ioctls).
      
      Instead, we can just let the netdevice hold a reference on its
      ppp_file. This reference is dropped in ->priv_destructor(), at the very
      end of the unregistration process, so that neither ppp_release() nor
      ppp_disconnect_channel() can call ppp_destroy_interface() in the interim.
      Reported-by: default avatarBeniamino Galvani <bgalvani@redhat.com>
      Fixes: 8cb775bc ("ppp: fix device unregistration upon netns deletion")
      Signed-off-by: default avatarGuillaume Nault <g.nault@alphalink.fr>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6151b8b3
    • Eric Dumazet's avatar
      netfilter: x_tables: avoid stack-out-of-bounds read in xt_copy_counters_from_user · e466af75
      Eric Dumazet authored
      syzkaller reports an out of bound read in strlcpy(), triggered
      by xt_copy_counters_from_user()
      
      Fix this by using memcpy(), then forcing a zero byte at the last position
      of the destination, as Florian did for the non COMPAT code.
      
      Fixes: d7591f0c ("netfilter: x_tables: introduce and use xt_copy_counters_from_user")
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Cc: Willem de Bruijn <willemb@google.com>
      Acked-by: default avatarFlorian Westphal <fw@strlen.de>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      e466af75
    • Pablo Neira Ayuso's avatar
      netfilter: nf_tables: do not dump chain counters if not enabled · 5f9bfe0e
      Pablo Neira Ayuso authored
      Chain counters are only enabled on demand since 9f08ea84, skip them
      when dumping them via netlink.
      
      Fixes: 9f08ea84 ("netfilter: nf_tables: keep chain counters away from hot path")
      Reported-by: default avatarJohny Mattsson <johny.mattsson+kernel@gmail.com>
      Tested-by: default avatarJohny Mattsson <johny.mattsson+kernel@gmail.com>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      5f9bfe0e
    • Dan Carpenter's avatar
      selftests/net: rxtimestamp: Fix an off by one · 1561b326
      Dan Carpenter authored
      The > should be >= so that we don't write one element beyond the end of
      the array.
      
      Fixes: 16e78122 ("selftests/net: Add a test to validate behavior of rx timestamps")
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1561b326
  5. 05 Oct, 2017 10 commits
    • Linus Torvalds's avatar
      Merge tag 'pm-4.14-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · 7a92616c
      Linus Torvalds authored
      Pull power management fix from Rafael Wysocki:
       "This fixes a code ordering issue in the main suspend-to-idle loop that
        causes some "low power S0 idle" conditions to be incorrectly reported
        as unmet with suspend/resume debug messages enabled"
      
      * tag 'pm-4.14-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        PM / s2idle: Invoke the ->wake() platform callback earlier
      7a92616c
    • Rafael J. Wysocki's avatar
      Merge branch 'pm-sleep' · ca935f8e
      Rafael J. Wysocki authored
      * pm-sleep:
        PM / s2idle: Invoke the ->wake() platform callback earlier
      ca935f8e
    • Linus Torvalds's avatar
      Merge tag 'for-4.14/dm-fixes' of... · 076264ad
      Linus Torvalds authored
      Merge tag 'for-4.14/dm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm
      
      Pull device mapper fixes from Mike Snitzer:
      
       - a stable fix for the alignment of the event number reported at the
         end of the 'DM_LIST_DEVICES' ioctl.
      
       - a couple stable fixes for the DM crypt target.
      
       - a DM raid health status reporting fix.
      
      * tag 'for-4.14/dm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm:
        dm raid: fix incorrect status output at the end of a "recover" process
        dm crypt: reject sector_size feature if device length is not aligned to it
        dm crypt: fix memory leak in crypt_ctr_cipher_old()
        dm ioctl: fix alignment of event number in the device list
      076264ad
    • Jonathan Brassow's avatar
      dm raid: fix incorrect status output at the end of a "recover" process · 41dcf197
      Jonathan Brassow authored
      There are three important fields that indicate the overall health and
      status of an array: dev_health, sync_ratio, and sync_action.  They tell
      us the condition of the devices in the array, and the degree to which
      the array is synchronized.
      
      This commit fixes a condition that is reported incorrectly.  When a member
      of the array is being rebuilt or a new device is added, the "recover"
      process is used to synchronize it with the rest of the array.  When the
      process is complete, but the sync thread hasn't yet been reaped, it is
      possible for the state of MD to be:
       mddev->recovery = [ MD_RECOVERY_RUNNING MD_RECOVERY_RECOVER MD_RECOVERY_DONE ]
       curr_resync_completed = <max dev size> (but not MaxSector)
       and all rdevs to be In_sync.
      This causes the 'array_in_sync' output parameter that is passed to
      rs_get_progress() to be computed incorrectly and reported as 'false' --
      or not in-sync.  This in turn causes the dev_health status characters to
      be reported as all 'a', rather than the proper 'A'.
      
      This can cause erroneous output for several seconds at a time when tools
      will want to be checking the condition due to events that are raised at
      the end of a sync process.  Fix this by properly calculating the
      'array_in_sync' return parameter in rs_get_progress().
      
      Also, remove an unnecessary intermediate 'recovery_cp' variable in
      rs_get_progress().
      Signed-off-by: default avatarJonathan Brassow <jbrassow@redhat.com>
      Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
      41dcf197
    • Linus Torvalds's avatar
      Merge tag 'sound-4.14-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound · 0f380715
      Linus Torvalds authored
      Pull sound fixes from Takashi Iwai:
       "A collection of small fixes, mostly with stable ones:
      
       - X32 ABI fix for PCM; likely not so many people suffer from it, but
         still better to fix
      
       - Two minor kernel warning fixes on USB audio devices spotted by
         syzkaller
      
       - Regression fix of echoaudio due to its inconsistent dimension
      
       - Fix for HBR support on Intel DP audio, on some recent chips
      
       - USB-audio quirk for yet another Plantronics devices
      
       - Fix for potential double-fetch in ASIHPI FIFO queue"
      
      * tag 'sound-4.14-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
        ALSA: usx2y: Suppress kernel warning at page allocation failures
        Revert "ALSA: echoaudio: purge contradictions between dimension matrix members and total number of members"
        ALSA: usb-audio: Check out-of-bounds access by corrupted buffer descriptor
        ALSA: pcm: Fix structure definition for X32 ABI
        ALSA: usb-audio: Add sample rate quirk for Plantronics C310/C520-M
        ALSA: hda - program ICT bits to support HBR audio
        ALSA: asihpi: fix a potential double-fetch bug when copying puhm
        ALSA: compress: Remove unused variable
      0f380715
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid · 77ede3a0
      Linus Torvalds authored
      Pull HID subsystem fixes from Jiri Kosina:
      
       - buffer management size fix for i2c-hid driver, from Adrian Salido
      
       - tool ID regression fixes for Wacom driver from Jason Gerecke
      
       - a few small assorted fixes and a few device ID additions
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid:
        Revert "HID: multitouch: Support ALPS PTP stick with pid 0x120A"
        HID: hidraw: fix power sequence when closing device
        HID: wacom: Always increment hdev refcount within wacom_get_hdev_data
        HID: wacom: generic: Clear ABS_MISC when tool leaves proximity
        HID: wacom: generic: Send MSC_SERIAL and ABS_MISC when leaving prox
        HID: i2c-hid: allocate hid buffers for real worst case
        HID: rmi: Make sure the HID device is opened on resume
        HID: multitouch: Support ALPS PTP stick with pid 0x120A
        HID: multitouch: support buttons and trackpoint on Lenovo X1 Tab Gen2
        HID: wacom: Correct coordinate system of touchring and pen twist
        HID: wacom: Properly report negative values from Intuos Pro 2 Bluetooth
        HID: multitouch: Fix system-control buttons not working
        HID: add multi-input quirk for IDC6680 touchscreen
        HID: wacom: leds: Don't try to control the EKR's read-only LEDs
        HID: wacom: bits shifted too much for 9th and 10th buttons
      77ede3a0
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · 9a431ef9
      Linus Torvalds authored
      Pull networking fixes from David Miller:
      
       1) Check iwlwifi 9000 reorder buffer out-of-space condition properly,
          from Sara Sharon.
      
       2) Fix RCU splat in qualcomm rmnet driver, from Subash Abhinov
          Kasiviswanathan.
      
       3) Fix session and tunnel release races in l2tp, from Guillaume Nault
          and Sabrina Dubroca.
      
       4) Fix endian bug in sctp_diag_dump(), from Dan Carpenter.
      
       5) Several mlx5 driver fixes from the Mellanox folks (max flow counters
          cap check, invalid memory access in IPoIB support, etc.)
      
       6) tun_get_user() should bail if skb->len is zero, from Alexander
          Potapenko.
      
       7) Fix RCU lookups in inetpeer, from Eric Dumazet.
      
       8) Fix locking in packet_do_bund().
      
       9) Handle cb->start() error properly in netlink dump code, from Jason
          A. Donenfeld.
      
      10) Handle multicast properly in UDP socket early demux code. From Paolo
          Abeni.
      
      11) Several erspan bug fixes in ip_gre, from Xin Long.
      
      12) Fix use-after-free in socket filter code, in order to handle the
          fact that listener lock is no longer taken during the three-way TCP
          handshake. From Eric Dumazet.
      
      13) Fix infoleak in RTM_GETSTATS, from Nikolay Aleksandrov.
      
      14) Fix tail call generation in x86-64 BPF JIT, from Alexei Starovoitov.
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (77 commits)
        net: 8021q: skip packets if the vlan is down
        bpf: fix bpf_tail_call() x64 JIT
        net: stmmac: dwmac-rk: Add RK3128 GMAC support
        rndis_host: support Novatel Verizon USB730L
        net: rtnetlink: fix info leak in RTM_GETSTATS call
        socket, bpf: fix possible use after free
        mlxsw: spectrum_router: Track RIF of IPIP next hops
        mlxsw: spectrum_router: Move VRF refcounting
        net: hns3: Fix an error handling path in 'hclge_rss_init_hw()'
        net: mvpp2: Fix clock resource by adding an optional bus clock
        r8152: add Linksys USB3GIGV1 id
        l2tp: fix l2tp_eth module loading
        ip_gre: erspan device should keep dst
        ip_gre: set tunnel hlen properly in erspan_tunnel_init
        ip_gre: check packet length and mtu correctly in erspan_xmit
        ip_gre: get key from session_id correctly in erspan_rcv
        tipc: use only positive error codes in messages
        ppp: fix __percpu annotation
        udp: perform source validation for mcast early demux
        IPv4: early demux can return an error code
        ...
      9a431ef9
    • Vishakha Narvekar's avatar
      net: 8021q: skip packets if the vlan is down · e769fcec
      Vishakha Narvekar authored
      If the vlan is down, free the packet instead of proceeding with other
      processing, or counting it as received.  If vlan interfaces are used
      as slaves for bonding, with arp monitoring for connectivity, if the rx
      counter is seen to be incrementing, then the bond device will not
      observe that the interface is down.
      
      CC: David S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarVishakha Narvekar <Vishakha.Narvekar@dell.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e769fcec
    • Linus Torvalds's avatar
      Merge tag 'armsoc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc · 42b76d0e
      Linus Torvalds authored
      Pull ARM SoC fixes from Olof Johansson:
       "Our first batch of fixes this release cycle, unfortunately a bit
        noisier than usual. Two major groups stand out:
      
         - Some pinctril dts/dtsi changes for stm32 due to a new driver being
           merged during the merge window, and this aligns the DT contents
           between the old format and the new. This could arguably be moved to
           the next merge window but it also seemed relatively harmless to
           include now.
      
         - Amlogic/meson had driver changes merged that required devicetree
           changes to avoid functional/performance regressions. I've already
           asked them to be more careful about this going forward, and making
           sure drivers are compatible with older DTs when they make these
           kind of changes. The platform is actively being upstreamed so
           there's a few things in flight, we've seen this happen before and
           sometimes it's hard to catch in time.
      
        Besides that there is the usual mix of minor fixes"
      
      * tag 'armsoc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (33 commits)
        ARM: dts: stm32: use right pinctrl compatible for stm32f469
        ARM: dts: stm32: Fix STMPE1600 binding on stm32429i-eval board
        ARM: defconfig: update Gemini defconfig
        ARM: defconfig: FRAMEBUFFER_CONSOLE can no longer be =m
        arm64: dts: rockchip: add the grf clk for dw-mipi-dsi on rk3399
        reset: Restrict RESET_HSDK to ARC_SOC_HSDK or COMPILE_TEST
        ARM: dts: da850-evm: add serial and ethernet aliases
        ARM: dts: am43xx-epos-evm: Remove extra CPSW EMAC entry
        ARM: dts: am33xx: Add spi alias to match SOC schematics
        ARM: OMAP2+: hsmmc: fix logic to call either omap_hsmmc_init or omap_hsmmc_late_init but not both
        ARM: dts: dra7: Set a default parent to mcasp3_ahclkx_mux
        ARM: OMAP2+: dra7xx: Set OPT_CLKS_IN_RESET flag for gpio1
        ARM: dts: nokia n900: drop unneeded/undocumented parts of the dts
        arm64: dts: rockchip: Correct MIPI DPHY PLL clock on rk3399
        arm64: dt marvell: Fix AP806 system controller size
        MAINTAINERS: add Macchiatobin maintainers entry
        ARC: reset: remove the misleading v1 suffix all over
        ARC: reset: add missing DT binding documentation for HSDKv1 reset driver
        ARC: reset: Only build on archs that have IOMEM
        ARM: at91: Replace uses of virt_to_phys with __pa_symbol
        ...
      42b76d0e
    • James Hogan's avatar
      Update James Hogan's email address · e0a86312
      James Hogan authored
      Update my imgtec.com and personal email address to my kernel.org one in
      a few places as MIPS will soon no longer be part of Imagination
      Technologies, and add mappings in .mailcap so get_maintainer.pl reports
      the right address.
      Signed-off-by: default avatarJames Hogan <jhogan@kernel.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      e0a86312
  6. 04 Oct, 2017 4 commits
    • Olof Johansson's avatar
      Merge tag 'stm32-dt-fixes-for-v4.14' of... · 08f8c880
      Olof Johansson authored
      Merge tag 'stm32-dt-fixes-for-v4.14' of git://git.kernel.org/pub/scm/linux/kernel/git/atorgue/stm32 into fixes
      
      STM32 fixes for v4.14:
      ---------------------
      
      -Fix STMPE1600 bindings for stm32429i-eval board
      -Use right compatible for stm32f469 pinctrl. It implies to use
      pinctrl dedicated files for F4 SoCs.
      
      * tag 'stm32-dt-fixes-for-v4.14' of git://git.kernel.org/pub/scm/linux/kernel/git/atorgue/stm32:
        ARM: dts: stm32: use right pinctrl compatible for stm32f469
        ARM: dts: stm32: Fix STMPE1600 binding on stm32429i-eval board
      Signed-off-by: default avatarOlof Johansson <olof@lixom.net>
      08f8c880
    • Olof Johansson's avatar
      Merge tag 'amlogic-dt64-3' of... · eab5c002
      Olof Johansson authored
      Merge tag 'amlogic-dt64-3' of git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-amlogic into fixes
      
      Amlogic 64-bit DT updates for v4.14 (round 3)
      - updates for new MMC driver features/fixes
      - support high-speed modes
      
      * tag 'amlogic-dt64-3' of git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-amlogic:
        ARM64: dts: meson-gxbb: nanopi-k2: enable sdr104 mode
        ARM64: dts: meson-gxbb: nanopi-k2: enable sdcard UHS modes
        ARM64: dts: meson-gxbb: p20x: enable sdcard UHS modes
        ARM64: dts: meson-gxl: libretech-cc: enable high speed modes
        ARM64: dts: meson-gxl: libretech-cc: add card regulator settle times
        ARM64: dts: meson-gxbb: nanopi-k2: add card regulator settle times
        ARM64: dts: meson: add mmc clk gate pins
        ARM64: dts: meson: remove cap-sd-highspeed from emmc nodes
        ARM64: dts: meson-gx: Use correct mmc clock source 0
      Signed-off-by: default avatarOlof Johansson <olof@lixom.net>
      eab5c002
    • Linus Torvalds's avatar
      Merge branch 'akpm' (patches from Andrew) · b7e14164
      Linus Torvalds authored
      Merge misc fixes from Andrew Morton:
       "A lot of stuff, sorry about that. A week on a beach, then a bunch of
        time catching up then more time letting it bake in -next. Shan't do
        that again!"
      
      * emailed patches from Andrew Morton <akpm@linux-foundation.org>: (51 commits)
        include/linux/fs.h: fix comment about struct address_space
        checkpatch: fix ignoring cover-letter logic
        m32r: fix build failure
        lib/ratelimit.c: use deferred printk() version
        kernel/params.c: improve STANDARD_PARAM_DEF readability
        kernel/params.c: fix an overflow in param_attr_show
        kernel/params.c: fix the maximum length in param_get_string
        mm/memory_hotplug: define find_{smallest|biggest}_section_pfn as unsigned long
        mm/memory_hotplug: change pfn_to_section_nr/section_nr_to_pfn macro to inline function
        kernel/kcmp.c: drop branch leftover typo
        memremap: add scheduling point to devm_memremap_pages
        mm, page_alloc: add scheduling point to memmap_init_zone
        mm, memory_hotplug: add scheduling point to __add_pages
        lib/idr.c: fix comment for idr_replace()
        mm: memcontrol: use vmalloc fallback for large kmem memcg arrays
        kernel/sysctl.c: remove duplicate UINT_MAX check on do_proc_douintvec_conv()
        include/linux/bitfield.h: remove 32bit from FIELD_GET comment block
        lib/lz4: make arrays static const, reduces object code size
        exec: binfmt_misc: kill the onstack iname[BINPRM_BUF_SIZE] array
        exec: binfmt_misc: fix race between load_misc_binary() and kill_node()
        ...
      b7e14164
    • Linus Torvalds's avatar
      Merge branch 'fixes-v4.14-rc4' of... · 6c795b30
      Linus Torvalds authored
      Merge branch 'fixes-v4.14-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security
      
      Pull smack fix from James Morris:
       "It fixes a bug in xattr_getsecurity() where security_release_secctx()
        was being called instead of kfree(), which leads to a memory leak in
        the capabilities code. smack_inode_getsecurity is also fixed to behave
        correctly when called from there"
      
      * 'fixes-v4.14-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security:
        lsm: fix smack_inode_removexattr and xattr_getsecurity memleak
      6c795b30