1. 28 Aug, 2017 14 commits
  2. 26 Aug, 2017 8 commits
  3. 25 Aug, 2017 10 commits
  4. 24 Aug, 2017 8 commits
    • Bob Peterson's avatar
      tipc: Fix tipc_sk_reinit handling of -EAGAIN · 6c7e983b
      Bob Peterson authored
      In 9dbbfb0a function tipc_sk_reinit
      had additional logic added to loop in the event that function
      rhashtable_walk_next() returned -EAGAIN. No worries.
      
      However, if rhashtable_walk_start returns -EAGAIN, it does "continue",
      and therefore skips the call to rhashtable_walk_stop(). That has
      the effect of calling rcu_read_lock() without its paired call to
      rcu_read_unlock(). Since rcu_read_lock() may be nested, the problem
      may not be apparent for a while, especially since resize events may
      be rare. But the comments to rhashtable_walk_start() state:
      
       * ...Note that we take the RCU lock in all
       * cases including when we return an error.  So you must always call
       * rhashtable_walk_stop to clean up.
      
      This patch replaces the continue with a goto and label to ensure a
      matching call to rhashtable_walk_stop().
      Signed-off-by: default avatarBob Peterson <rpeterso@redhat.com>
      Acked-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6c7e983b
    • Arnd Bergmann's avatar
      qlge: avoid memcpy buffer overflow · e58f9583
      Arnd Bergmann authored
      gcc-8.0.0 (snapshot) points out that we copy a variable-length string
      into a fixed length field using memcpy() with the destination length,
      and that ends up copying whatever follows the string:
      
          inlined from 'ql_core_dump' at drivers/net/ethernet/qlogic/qlge/qlge_dbg.c:1106:2:
      drivers/net/ethernet/qlogic/qlge/qlge_dbg.c:708:2: error: 'memcpy' reading 15 bytes from a region of size 14 [-Werror=stringop-overflow=]
        memcpy(seg_hdr->description, desc, (sizeof(seg_hdr->description)) - 1);
      
      Changing it to use strncpy() will instead zero-pad the destination,
      which seems to be the right thing to do here.
      
      The bug is probably harmless, but it seems like a good idea to address
      it in stable kernels as well, if only for the purpose of building with
      gcc-8 without warnings.
      
      Fixes: a61f8026 ("qlge: Add ethtool register dump function.")
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e58f9583
    • Eric Dumazet's avatar
      virtio_net: be drop monitor friendly · dadc0736
      Eric Dumazet authored
      This change is needed to not fool drop monitor.
      (perf record ... -e skb:kfree_skb )
      
      Packets were properly sent and are consumed after TX completion.
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      dadc0736
    • David S. Miller's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf · af57d2b7
      David S. Miller authored
      Pablo Neira Ayuso says:
      
      ====================
      Netfilter fixes for net
      
      The following patchset contains Netfilter fixes for your net tree,
      they are:
      
      1) Fix use after free of struct proc_dir_entry in ipt_CLUSTERIP, patch
         from Sabrina Dubroca.
      
      2) Fix spurious EINVAL errors from iptables over nft compatibility layer.
      
      3) Reload pointer to ip header only if there is non-terminal verdict,
         ie. XT_CONTINUE, otherwise invalid memory access may happen, patch
         from Taehee Yoo.
      
      4) Fix interaction between SYNPROXY and NAT, SYNPROXY adds sequence
         adjustment already, however from nf_nat_setup() assumes there's not.
         Patch from Xin Long.
      
      5) Fix burst arithmetics in nft_limit as Joe Stringer mentioned during
         NFWS in Faro. Patch from Andy Zhou.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      af57d2b7
    • andy zhou's avatar
      netfilter: nf_tables: Fix nft limit burst handling · c26844ed
      andy zhou authored
      Current implementation treats the burst configuration the same as
      rate configuration. This can cause the per packet cost to be lower
      than configured. In effect, this bug causes the token bucket to be
      refilled at a higher rate than what user has specified.
      
      This patch changes the implementation so that the token bucket size
      is controlled by "rate + burst", while maintain the token bucket
      refill rate the same as user specified.
      
      Fixes: 96518518 ("netfilter: add nftables")
      Signed-off-by: default avatarAndy Zhou <azhou@ovn.org>
      Acked-by: default avatarJoe Stringer <joe@ovn.org>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      c26844ed
    • Xin Long's avatar
      netfilter: check for seqadj ext existence before adding it in nf_nat_setup_info · ab6dd1be
      Xin Long authored
      Commit 4440a2ab ("netfilter: synproxy: Check oom when adding synproxy
      and seqadj ct extensions") wanted to drop the packet when it fails to add
      seqadj ext due to no memory by checking if nfct_seqadj_ext_add returns
      NULL.
      
      But that nfct_seqadj_ext_add returns NULL can also happen when seqadj ext
      already exists in a nf_conn. It will cause that userspace protocol doesn't
      work when both dnat and snat are configured.
      
      Li Shuang found this issue in the case:
      
      Topo:
         ftp client                   router                  ftp server
        10.167.131.2  <-> 10.167.131.254  10.167.141.254 <-> 10.167.141.1
      
      Rules:
        # iptables -t nat -A PREROUTING -i eth1 -p tcp -m tcp --dport 21 -j \
          DNAT --to-destination 10.167.141.1
        # iptables -t nat -A POSTROUTING -o eth2 -p tcp -m tcp --dport 21 -j \
          SNAT --to-source 10.167.141.254
      
      In router, when both dnat and snat are added, nf_nat_setup_info will be
      called twice. The packet can be dropped at the 2nd time for DNAT due to
      seqadj ext is already added at the 1st time for SNAT.
      
      This patch is to fix it by checking for seqadj ext existence before adding
      it, so that the packet will not be dropped if seqadj ext already exists.
      
      Note that as Florian mentioned, as a long term, we should review ext_add()
      behaviour, it's better to return a pointer to the existing ext instead.
      
      Fixes: 4440a2ab ("netfilter: synproxy: Check oom when adding synproxy and seqadj ct extensions")
      Reported-by: default avatarLi Shuang <shuali@redhat.com>
      Acked-by: default avatarFlorian Westphal <fw@strlen.de>
      Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      ab6dd1be
    • Luca Coelho's avatar
      iwlwifi: pcie: move rx workqueue initialization to iwl_trans_pcie_alloc() · 10a54d81
      Luca Coelho authored
      Work queues cannot be allocated when a mutex is held because the mutex
      may be in use and that would make it sleep.  Doing so generates the
      following splat with 4.13+:
      
      [   19.513298] ======================================================
      [   19.513429] WARNING: possible circular locking dependency detected
      [   19.513557] 4.13.0-rc5+ #6 Not tainted
      [   19.513638] ------------------------------------------------------
      [   19.513767] cpuhp/0/12 is trying to acquire lock:
      [   19.513867]  (&tz->lock){+.+.+.}, at: [<ffffffff924afebb>] thermal_zone_get_temp+0x5b/0xb0
      [   19.514047]
      [   19.514047] but task is already holding lock:
      [   19.514166]  (cpuhp_state){+.+.+.}, at: [<ffffffff91cc4baa>] cpuhp_thread_fun+0x3a/0x210
      [   19.514338]
      [   19.514338] which lock already depends on the new lock.
      
      This lock dependency already existed with previous kernel versions,
      but it was not detected until commit 49dfe2a6 ("cpuhotplug: Link
      lock stacks for hotplug callbacks") was introduced.
      Reported-by: default avatarDavid Weinehall <david.weinehall@intel.com>
      Reported-by: default avatarJiri Kosina <jikos@kernel.org>
      Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      10a54d81
    • David S. Miller's avatar
      Merge branch 'bnxt_en-bug-fixes' · d0273ef3
      David S. Miller authored
      Michael Chan says:
      
      ====================
      bnxt_en: bug fixes.
      
      3 bug fixes related to XDP ring accounting in bnxt_setup_tc(), freeing
      MSIX vectors when bnxt_re unregisters, and preserving the user-administered
      PF MAC address when disabling SRIOV.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d0273ef3