Skip to content
  1. Feb 11, 2019
  2. Feb 06, 2019
    • Johannes Berg's avatar
      cfg80211: pmsr: fix abort locking · 73350424
      Johannes Berg authored
      When we destroy the interface we already hold the wdev->mtx
      while calling cfg80211_pmsr_wdev_down(), which assumes this
      isn't true and flushes the worker that takes the lock, thus
      leading to a deadlock.
      
      Fix this by refactoring the worker and calling its code in
      cfg80211_pmsr_wdev_down() directly.
      
      We still need to flush the work later to make sure it's not
      still running and will crash, but it will not do anything.
      
      Fixes: 9bb7e0f2
      
       ("cfg80211: add peer measurement with FTM initiator API")
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      73350424
    • Johannes Berg's avatar
      cfg80211: pmsr: fix MAC address setting · 0acd9928
      Johannes Berg authored
      When we *don't* have a MAC address attribute, we shouldn't
      try to use this - this was intended to copy the local MAC
      address instead, so fix it.
      
      Fixes: 9bb7e0f2
      
       ("cfg80211: add peer measurement with FTM initiator API")
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      0acd9928
    • David S. Miller's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf · f09bef61
      David S. Miller authored
      
      
      Pablo Neira Ayuso says:
      
      ====================
      Netfilter fixes for net
      
      The following patchset contains Netfilter fixes for net:
      
      1) Use CONFIG_NF_TABLES_INET from seltests, not NF_TABLES_INET.
         From Naresh Kamboju.
      
      2) Add a test to cover masquerading and redirect case, from Florian
         Westphal.
      
      3) Two packets coming from the same socket may race to set up NAT,
         ending up with different tuples and the packet losing race being
         dropped. Update nf_conntrack_tuple_taken() to exercise clash
         resolution for this case. From Martynas Pumputis and Florian
         Westphal.
      
      4) Unbind anonymous sets from the commit and abort path, this fixes
         a splat due to double set list removal/release in case that the
         transaction needs to be aborted.
      
      5) Do not preserve original output interface for packets that are
         redirected in the output chain when ip6_route_me_harder() is
         called. Otherwise packets end up going not going to the loopback
         device. From Eli Cooper.
      
      6) Fix bogus splat in nft_compat with CONFIG_REFCOUNT_FULL=y, this
         also simplifies the existing logic to deal with the list insertions
         of the xtables extensions. From Florian Westphal.
      
      Diffstat look rather larger than usual because of the new selftest, but
      Florian and I consider that having tests soon into the tree is good to
      improve coverage. If there's a different policy in this regard, please,
      let me know.
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f09bef61
  3. Feb 05, 2019
    • Florian Westphal's avatar
      netfilter: nft_compat: don't use refcount_inc on newly allocated entry · 947e492c
      Florian Westphal authored
      When I moved the refcount to refcount_t type I missed the fact that
      refcount_inc() will result in use-after-free warning with
      CONFIG_REFCOUNT_FULL=y builds.
      
      The correct fix would be to init the reference count to 1 at allocation
      time, but, unfortunately we cannot do this, as we can't undo that
      in case something else fails later in the batch.
      
      So only solution I see is to special-case the 'new entry' condition
      and replace refcount_inc() with a "delayed" refcount_set(1) in this case,
      as done here.
      
      The .activate callback can be removed to simplify things, we only
      need to make sure that deactivate() decrements/unlinks the entry
      from the list at end of transaction phase (commit or abort).
      
      Fixes: 12c44aba
      
       ("netfilter: nft_compat: use refcnt_t type for nft_xt reference count")
      Reported-by: default avatarJordan Glover <Golden_Miller83@protonmail.ch>
      Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      947e492c
    • Eli Cooper's avatar
      netfilter: ipv6: Don't preserve original oif for loopback address · 15df03c6
      Eli Cooper authored
      Commit 508b0904 ("netfilter: ipv6: Preserve link scope traffic
      original oif") made ip6_route_me_harder() keep the original oif for
      link-local and multicast packets. However, it also affected packets
      for the loopback address because it used rt6_need_strict().
      
      REDIRECT rules in the OUTPUT chain rewrite the destination to loopback
      address; thus its oif should not be preserved. This commit fixes the bug
      that redirected local packets are being dropped. Actually the packet was
      not exactly dropped; Instead it was sent out to the original oif rather
      than lo. When a packet with daddr ::1 is sent to the router, it is
      effectively dropped.
      
      Fixes: 508b0904
      
       ("netfilter: ipv6: Preserve link scope traffic original oif")
      Signed-off-by: default avatarEli Cooper <elicooper@gmx.com>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      15df03c6
    • Marc Zyngier's avatar
      net: dsa: Fix lockdep false positive splat · c8101f77
      Marc Zyngier authored
      Creating a macvtap on a DSA-backed interface results in the following
      splat when lockdep is enabled:
      
      [   19.638080] IPv6: ADDRCONF(NETDEV_CHANGE): lan0: link becomes ready
      [   23.041198] device lan0 entered promiscuous mode
      [   23.043445] device eth0 entered promiscuous mode
      [   23.049255]
      [   23.049557] ============================================
      [   23.055021] WARNING: possible recursive locking detected
      [   23.060490] 5.0.0-rc3-00013-g56c857a1b8d3 #118 Not tainted
      [   23.066132] --------------------------------------------
      [   23.071598] ip/2861 is trying to acquire lock:
      [   23.076171] 00000000f61990cb (_xmit_ETHER){+...}, at: dev_set_rx_mode+0x1c/0x38
      [   23.083693]
      [   23.083693] but task is already holding lock:
      [   23.089696] 00000000ecf0c3b4 (_xmit_ETHER){+...}, at: dev_uc_add+0x24/0x70
      [   23.096774]
      [   23.096774] other info that might help us debug this:
      [   23.103494]  Possible unsafe locking scenario:
      [   23.103494]
      [   23.109584]        CPU0
      [   23.112093]        ----
      [   23.114601]   lock(_xmit_ETHER);
      [   23.117917]   lock(_xmit_ETHER);
      [   23.121233]
      [   23.121233]  *** DEADLOCK ***
      [   23.121233]
      [   23.127325]  May be due to missing lock nesting notation
      [   23.127325]
      [   23.134315] 2 locks held by ip/2861:
      [   23.137987]  #0: 000000003b766c72 (rtnl_mutex){+.+.}, at: rtnetlink_rcv_msg+0x338/0x4e0
      [   23.146231]  #1: 00000000ecf0c3b4 (_xmit_ETHER){+...}, at: dev_uc_add+0x24/0x70
      [   23.153757]
      [   23.153757] stack backtrace:
      [   23.158243] CPU: 0 PID: 2861 Comm: ip Not tainted 5.0.0-rc3-00013-g56c857a1b8d3 #118
      [   23.166212] Hardware name: Globalscale Marvell ESPRESSOBin Board (DT)
      [   23.172843] Call trace:
      [   23.175358]  dump_backtrace+0x0/0x188
      [   23.179116]  show_stack+0x14/0x20
      [   23.182524]  dump_stack+0xb4/0xec
      [   23.185928]  __lock_acquire+0x123c/0x1860
      [   23.190048]  lock_acquire+0xc8/0x248
      [   23.193724]  _raw_spin_lock_bh+0x40/0x58
      [   23.197755]  dev_set_rx_mode+0x1c/0x38
      [   23.201607]  dev_set_promiscuity+0x3c/0x50
      [   23.205820]  dsa_slave_change_rx_flags+0x5c/0x70
      [   23.210567]  __dev_set_promiscuity+0x148/0x1e0
      [   23.215136]  __dev_set_rx_mode+0x74/0x98
      [   23.219167]  dev_uc_add+0x54/0x70
      [   23.222575]  macvlan_open+0x170/0x1d0
      [   23.226336]  __dev_open+0xe0/0x160
      [   23.229830]  __dev_change_flags+0x16c/0x1b8
      [   23.234132]  dev_change_flags+0x20/0x60
      [   23.238074]  do_setlink+0x2d0/0xc50
      [   23.241658]  __rtnl_newlink+0x5f8/0x6e8
      [   23.245601]  rtnl_newlink+0x50/0x78
      [   23.249184]  rtnetlink_rcv_msg+0x360/0x4e0
      [   23.253397]  netlink_rcv_skb+0xe8/0x130
      [   23.257338]  rtnetlink_rcv+0x14/0x20
      [   23.261012]  netlink_unicast+0x190/0x210
      [   23.265043]  netlink_sendmsg+0x288/0x350
      [   23.269075]  sock_sendmsg+0x18/0x30
      [   23.272659]  ___sys_sendmsg+0x29c/0x2c8
      [   23.276602]  __sys_sendmsg+0x60/0xb8
      [   23.280276]  __arm64_sys_sendmsg+0x1c/0x28
      [   23.284488]  el0_svc_common+0xd8/0x138
      [   23.288340]  el0_svc_handler+0x24/0x80
      [   23.292192]  el0_svc+0x8/0xc
      
      This looks fairly harmless (no actual deadlock occurs), and is
      fixed in a similar way to c6894dec
      
       ("bridge: fix lockdep
      addr_list_lock false positive splat") by putting the addr_list_lock
      in its own lockdep class.
      
      Signed-off-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
      Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c8101f77
    • Rundong Ge's avatar
      net: dsa: slave: Don't propagate flag changes on down slave interfaces · 17ab4f61
      Rundong Ge authored
      The unbalance of master's promiscuity or allmulti will happen after ifdown
      and ifup a slave interface which is in a bridge.
      
      When we ifdown a slave interface , both the 'dsa_slave_close' and
      'dsa_slave_change_rx_flags' will clear the master's flags. The flags
      of master will be decrease twice.
      In the other hand, if we ifup the slave interface again, since the
      slave's flags were cleared the 'dsa_slave_open' won't set the master's
      flag, only 'dsa_slave_change_rx_flags' that triggered by 'br_add_if'
      will set the master's flags. The flags of master is increase once.
      
      Only propagating flag changes when a slave interface is up makes
      sure this does not happen. The 'vlan_dev_change_rx_flags' had the
      same problem and was fixed, and changes here follows that fix.
      
      Fixes: 91da11f8
      
       ("net: Distributed Switch Architecture protocol support")
      Signed-off-by: default avatarRundong Ge <rdong.ge@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      17ab4f61
    • David S. Miller's avatar
      Merge branch 's390-qeth-fixes' · 0429f237
      David S. Miller authored
      
      
      Julian Wiedmann says:
      
      ====================
      s390/qeth: fixes 2019-02-04
      
      please apply the following four fixes to -net.
      
      Patch 1 takes care of a common resource leak in various error paths, while the
      second patch fixes a misordered kfree when cleaning up after an error.
      The other two patches ensure that there's no stale work dangling on workqueues
      when the qeth device has already been offlined and/or removed.
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0429f237
    • Julian Wiedmann's avatar
      s390/qeth: conclude all event processing before offlining a card · c0a2e4d1
      Julian Wiedmann authored
      Work for Bridgeport events is currently placed on a driver-wide
      workqueue. If the card is removed and freed while any such work is still
      active, this causes a use-after-free.
      So put the events on a per-card queue, where we can control their
      lifetime. As we also don't want stale events to last beyond an
      offline & online cycle, flush this queue when setting the card offline.
      
      Fixes: b4d72c08
      
       ("qeth: bridgeport support - basic control")
      Signed-off-by: default avatarJulian Wiedmann <jwi@linux.ibm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c0a2e4d1
    • Julian Wiedmann's avatar
      s390/qeth: cancel close_dev work before removing a card · c2780c1a
      Julian Wiedmann authored
      A card's close_dev work is scheduled on a driver-wide workqueue. If the
      card is removed and freed while the work is still active, this causes a
      use-after-free.
      So make sure that the work is completed before freeing the card.
      
      Fixes: 0f54761d
      
       ("qeth: Support VEPA mode")
      Signed-off-by: default avatarJulian Wiedmann <jwi@linux.ibm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c2780c1a
    • Julian Wiedmann's avatar
      s390/qeth: fix use-after-free in error path · afa0c590
      Julian Wiedmann authored
      The error path in qeth_alloc_qdio_buffers() that takes care of
      cleaning up the Output Queues is buggy. It first frees the queue, but
      then calls qeth_clear_outq_buffers() with that very queue struct.
      
      Make the call to qeth_clear_outq_buffers() part of the free action
      (in the correct order), and while at it fix the naming of the helper.
      
      Fixes: 0da9581d
      
       ("qeth: exploit asynchronous delivery of storage blocks")
      Signed-off-by: default avatarJulian Wiedmann <jwi@linux.ibm.com>
      Reviewed-by: default avatarAlexandra Winter <wintera@linux.ibm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      afa0c590
    • Julian Wiedmann's avatar
      s390/qeth: release cmd buffer in error paths · 5065b2dd
      Julian Wiedmann authored
      
      
      Whenever we fail before/while starting an IO, make sure to release the
      IO buffer. Usually qeth_irq() would do this for us, but if the IO
      doesn't even start we obviously won't get an interrupt for it either.
      
      Signed-off-by: default avatarJulian Wiedmann <jwi@linux.ibm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5065b2dd
    • Petr Machata's avatar
      net: cls_flower: Remove filter from mask before freeing it · c1f7e029
      Petr Machata authored
      In fl_change(), when adding a new rule (i.e. fold == NULL), a driver may
      reject the new rule, for example due to resource exhaustion. By that
      point, the new rule was already assigned a mask, and it was added to
      that mask's hash table. The clean-up path that's invoked as a result of
      the rejection however neglects to undo the hash table addition, and
      proceeds to free the new rule, thus leaving a dangling pointer in the
      hash table.
      
      Fix by removing fnew from the mask's hash table before it is freed.
      
      Fixes: 35cc3cef
      
       ("net/sched: cls_flower: Reject duplicated rules also under skip_sw")
      Signed-off-by: default avatarPetr Machata <petrm@mellanox.com>
      Acked-by: default avatarJiri Pirko <jiri@mellanox.com>
      Reviewed-by: default avatarIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c1f7e029
    • David S. Miller's avatar
      Merge tag 'wireless-drivers-for-davem-2019-02-04' of... · 3e5a7c98
      David S. Miller authored
      Merge tag 'wireless-drivers-for-davem-2019-02-04' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers
      
      
      
      Kalle Valo says:
      
      ====================
      wireless-drivers fixes for 5.0
      
      First set of small, but importnat, fixes for 5.0.
      
      iwlwifi
      
      * fix a build regression introduced in 5.0-rc1
      
      wlcore
      
      * fix a firmware regression from v4.18-rc1
      
      mt76x0
      
      * fix for configuring tx power from user space
      
      ath10k
      
      * fix wcn3990 regression from v4.20-rc1
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3e5a7c98
    • David S. Miller's avatar
      Merge branch 'smc-fixes' · 277aa590
      David S. Miller authored
      
      
      Ursula Braun says:
      
      ====================
      net/smc: fixes 2019-02-04
      
      here are more fixes in the smc code for the net tree:
      Patch 1 fixes an IB-related problem with SMCR.
      Patch 2 fixes a cursor problem for one-way traffic.
      Patch 3 fixes a problem with RMB-reusage.
      Patch 4 fixes a closing issue.
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      277aa590
    • Ursula Braun's avatar
      net/smc: correct state change for peer closing · 84b799a2
      Ursula Braun authored
      
      
      If some kind of closing is received from the peer while still in
      state SMC_INIT, it means the peer has had an active connection and
      closed the socket quickly before listen_work finished. This should
      not result in a shortcut from state SMC_INIT to state SMC_CLOSED.
      This patch adds the socket to the accept queue in state
      SMC_APPCLOSEWAIT1. The socket reaches state SMC_CLOSED once being
      accepted and closed with smc_release().
      
      Signed-off-by: default avatarUrsula Braun <ubraun@linux.ibm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      84b799a2
    • Ursula Braun's avatar
      net/smc: delete rkey first before switching to unused · a5e04318
      Ursula Braun authored
      Once RMBs are flagged as unused they are candidates for reuse.
      Thus the LLC DELETE RKEY operaton should be made before flagging
      the RMB as unused.
      
      Fixes: c7674c00
      
       ("net/smc: unregister rkeys of unused buffer")
      Signed-off-by: default avatarUrsula Braun <ubraun@linux.ibm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a5e04318
    • Ursula Braun's avatar
      net/smc: fix sender_free computation · b8649efa
      Ursula Braun authored
      In some scenarios a separate consumer cursor update is necessary.
      The decision is made in smc_tx_consumer_cursor_update(). The
      sender_free computation could be wrong:
      
      The rx confirmed cursor is always smaller than or equal to the
      rx producer cursor. The parameters in the smc_curs_diff() call
      have to be exchanged, otherwise sender_free might even be negative.
      
      And if more data arrives local_rx_ctrl.prod might be updated, enabling
      a cursor difference between local_rx_ctrl.prod and rx confirmed cursor
      larger than the RMB size. This case is not covered by smc_curs_diff().
      Thus function smc_curs_diff_large() is introduced here.
      
      If a recvmsg() is processed in parallel, local_tx_ctrl.cons might
      change during smc_cdc_msg_send. Make sure rx_curs_confirmed is updated
      with the actually sent local_tx_ctrl.cons value.
      
      Fixes: e82f2e31
      
       ("net/smc: optimize consumer cursor updates")
      Signed-off-by: default avatarUrsula Braun <ubraun@linux.ibm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b8649efa
    • Ursula Braun's avatar
      net/smc: preallocated memory for rdma work requests · ad6f317f
      Ursula Braun authored
      
      
      The work requests for rdma writes are built in local variables within
      function smc_tx_rdma_write(). This violates the rule that the work
      request storage has to stay till the work request is confirmed by
      a completion queue response.
      This patch introduces preallocated memory for these work requests.
      The storage is allocated, once a link (and thus a queue pair) is
      established.
      
      Signed-off-by: default avatarUrsula Braun <ubraun@linux.ibm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ad6f317f
    • Sebastian Andrzej Siewior's avatar
      net: dp83640: expire old TX-skb · 53bc8d2a
      Sebastian Andrzej Siewior authored
      During sendmsg() a cloned skb is saved via dp83640_txtstamp() in
      ->tx_queue. After the NIC sends this packet, the PHY will reply with a
      timestamp for that TX packet. If the cable is pulled at the right time I
      don't see that packet. It might gets flushed as part of queue shutdown
      on NIC's side.
      Once the link is up again then after the next sendmsg() we enqueue
      another skb in dp83640_txtstamp() and have two on the list. Then the PHY
      will send a reply and decode_txts() attaches it to the first skb on the
      list.
      No crash occurs since refcounting works but we are one packet behind.
      linuxptp/ptp4l usually closes the socket and opens a new one (in such a
      timeout case) so those "stale" replies never get there. However it does
      not resume normal operation anymore.
      
      Purge old skbs in decode_txts().
      
      Fixes: cb646e2b
      
       ("ptp: Added a clock driver for the National Semiconductor PHYTER.")
      Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Reviewed-by: default avatarKurt Kanzenbach <kurt@linutronix.de>
      Acked-by: default avatarRichard Cochran <richardcochran@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      53bc8d2a
    • Pablo Neira Ayuso's avatar
      netfilter: nf_tables: unbind set in rule from commit path · f6ac8585
      Pablo Neira Ayuso authored
      Anonymous sets that are bound to rules from the same transaction trigger
      a kernel splat from the abort path due to double set list removal and
      double free.
      
      This patch updates the logic to search for the transaction that is
      responsible for creating the set and disable the set list removal and
      release, given the rule is now responsible for this. Lookup is reverse
      since the transaction that adds the set is likely to be at the tail of
      the list.
      
      Moreover, this patch adds the unbind step to deliver the event from the
      commit path.  This should not be done from the worker thread, since we
      have no guarantees of in-order delivery to the listener.
      
      This patch removes the assumption that both activate and deactivate
      callbacks need to be provided.
      
      Fixes: cd5125d8
      
       ("netfilter: nf_tables: split set destruction in deactivate and destroy phase")
      Reported-by: default avatarMikhail Morfikov <mmorfikov@gmail.com>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      f6ac8585
  4. Feb 04, 2019
  5. Feb 03, 2019
  6. Feb 02, 2019
    • David S. Miller's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf · e7b81641
      David S. Miller authored
      
      
      Alexei Starovoitov says:
      
      ====================
      pull-request: bpf 2019-01-31
      
      The following pull-request contains BPF updates for your *net* tree.
      
      The main changes are:
      
      1) disable preemption in sender side of socket filters, from Alexei.
      
      2) fix two potential deadlocks in syscall bpf lookup and prog_register,
         from Martin and Alexei.
      
      3) fix BTF to allow typedef on func_proto, from Yonghong.
      
      4) two bpftool fixes, from Jiri and Paolo.
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e7b81641
    • Eric Dumazet's avatar
      dccp: fool proof ccid_hc_[rt]x_parse_options() · 9b1f19d8
      Eric Dumazet authored
      Similarly to commit 276bdb82
      
       ("dccp: check ccid before dereferencing")
      it is wise to test for a NULL ccid.
      
      kasan: CONFIG_KASAN_INLINE enabled
      kasan: GPF could be caused by NULL-ptr deref or user memory access
      general protection fault: 0000 [#1] PREEMPT SMP KASAN
      CPU: 1 PID: 16 Comm: ksoftirqd/1 Not tainted 5.0.0-rc3+ #37
      Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
      RIP: 0010:ccid_hc_tx_parse_options net/dccp/ccid.h:205 [inline]
      RIP: 0010:dccp_parse_options+0x8d9/0x12b0 net/dccp/options.c:233
      Code: c5 0f b6 75 b3 80 38 00 0f 85 d6 08 00 00 48 b9 00 00 00 00 00 fc ff df 48 8b 45 b8 4c 8b b8 f8 07 00 00 4c 89 f8 48 c1 e8 03 <80> 3c 08 00 0f 85 95 08 00 00 48 b8 00 00 00 00 00 fc ff df 4d 8b
      kobject: 'loop5' (0000000080f78fc1): kobject_uevent_env
      RSP: 0018:ffff8880a94df0b8 EFLAGS: 00010246
      RAX: 0000000000000000 RBX: ffff8880858ac723 RCX: dffffc0000000000
      RDX: 0000000000000100 RSI: 0000000000000007 RDI: 0000000000000001
      RBP: ffff8880a94df140 R08: 0000000000000001 R09: ffff888061b83a80
      R10: ffffed100c370752 R11: ffff888061b83a97 R12: 0000000000000026
      R13: 0000000000000001 R14: 0000000000000000 R15: 0000000000000000
      FS:  0000000000000000(0000) GS:ffff8880ae700000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: 00007f0defa33518 CR3: 000000008db5e000 CR4: 00000000001406e0
      kobject: 'loop5' (0000000080f78fc1): fill_kobj_path: path = '/devices/virtual/block/loop5'
      DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      Call Trace:
       dccp_rcv_state_process+0x2b6/0x1af6 net/dccp/input.c:654
       dccp_v4_do_rcv+0x100/0x190 net/dccp/ipv4.c:688
       sk_backlog_rcv include/net/sock.h:936 [inline]
       __sk_receive_skb+0x3a9/0xea0 net/core/sock.c:473
       dccp_v4_rcv+0x10cb/0x1f80 net/dccp/ipv4.c:880
       ip_protocol_deliver_rcu+0xb6/0xa20 net/ipv4/ip_input.c:208
       ip_local_deliver_finish+0x23b/0x390 net/ipv4/ip_input.c:234
       NF_HOOK include/linux/netfilter.h:289 [inline]
       NF_HOOK include/linux/netfilter.h:283 [inline]
       ip_local_deliver+0x1f0/0x740 net/ipv4/ip_input.c:255
       dst_input include/net/dst.h:450 [inline]
       ip_rcv_finish+0x1f4/0x2f0 net/ipv4/ip_input.c:414
       NF_HOOK include/linux/netfilter.h:289 [inline]
       NF_HOOK include/linux/netfilter.h:283 [inline]
       ip_rcv+0xed/0x620 net/ipv4/ip_input.c:524
       __netif_receive_skb_one_core+0x160/0x210 net/core/dev.c:4973
       __netif_receive_skb+0x2c/0x1c0 net/core/dev.c:5083
       process_backlog+0x206/0x750 net/core/dev.c:5923
       napi_poll net/core/dev.c:6346 [inline]
       net_rx_action+0x76d/0x1930 net/core/dev.c:6412
       __do_softirq+0x30b/0xb11 kernel/softirq.c:292
       run_ksoftirqd kernel/softirq.c:654 [inline]
       run_ksoftirqd+0x8e/0x110 kernel/softirq.c:646
       smpboot_thread_fn+0x6ab/0xa10 kernel/smpboot.c:164
       kthread+0x357/0x430 kernel/kthread.c:246
       ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:352
      Modules linked in:
      ---[ end trace 58a0ba03bea2c376 ]---
      RIP: 0010:ccid_hc_tx_parse_options net/dccp/ccid.h:205 [inline]
      RIP: 0010:dccp_parse_options+0x8d9/0x12b0 net/dccp/options.c:233
      Code: c5 0f b6 75 b3 80 38 00 0f 85 d6 08 00 00 48 b9 00 00 00 00 00 fc ff df 48 8b 45 b8 4c 8b b8 f8 07 00 00 4c 89 f8 48 c1 e8 03 <80> 3c 08 00 0f 85 95 08 00 00 48 b8 00 00 00 00 00 fc ff df 4d 8b
      RSP: 0018:ffff8880a94df0b8 EFLAGS: 00010246
      RAX: 0000000000000000 RBX: ffff8880858ac723 RCX: dffffc0000000000
      RDX: 0000000000000100 RSI: 0000000000000007 RDI: 0000000000000001
      RBP: ffff8880a94df140 R08: 0000000000000001 R09: ffff888061b83a80
      R10: ffffed100c370752 R11: ffff888061b83a97 R12: 0000000000000026
      R13: 0000000000000001 R14: 0000000000000000 R15: 0000000000000000
      FS:  0000000000000000(0000) GS:ffff8880ae700000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: 00007f0defa33518 CR3: 0000000009871000 CR4: 00000000001406e0
      DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Reported-by: default avatarsyzbot <syzkaller@googlegroups.com>
      Cc: Gerrit Renker <gerrit@erg.abdn.ac.uk>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9b1f19d8
    • David S. Miller's avatar
      Merge branch 'smc-fixes' · ec34f792
      David S. Miller authored
      
      
      Ursula Braun says:
      
      ====================
      net/smc: fixes 2019-01-30
      
      here are some fixes in different areas of the smc code for the net
      tree.
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ec34f792
    • Karsten Graul's avatar
      net/smc: fix use of variable in cleared area · 46ad0222
      Karsten Graul authored
      
      
      Do not use pend->idx as index for the arrays because its value is
      located in the cleared area. Use the existing local variable instead.
      Without this fix the wrong area might be cleared.
      
      Signed-off-by: default avatarKarsten Graul <kgraul@linux.ibm.com>
      Signed-off-by: default avatarUrsula Braun <ubraun@linux.ibm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      46ad0222
    • Karsten Graul's avatar
      net/smc: use device link provided in qp_context · e5f3aa04
      Karsten Graul authored
      
      
      The device field of the IB event structure does not always point to the
      SMC IB device. Load the pointer from the qp_context which is always
      provided to smc_ib_qp_event_handler() in the priv field. And for qp
      events the affected port is given in the qp structure of the ibevent,
      derive it from there.
      
      Signed-off-by: default avatarKarsten Graul <kgraul@linux.ibm.com>
      Signed-off-by: default avatarUrsula Braun <ubraun@linux.ibm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e5f3aa04