1. 01 Apr, 2015 1 commit
    • Johannes Berg's avatar
      mac80211: fix RX A-MPDU session reorder timer deletion · 788211d8
      Johannes Berg authored
      There's an issue with the way the RX A-MPDU reorder timer is
      deleted that can cause a kernel crash like this:
      
       * tid_rx is removed - call_rcu(ieee80211_free_tid_rx)
       * station is destroyed
       * reorder timer fires before ieee80211_free_tid_rx() runs,
         accessing the station, thus potentially crashing due to
         the use-after-free
      
      The station deletion is protected by synchronize_net(), but
      that isn't enough -- ieee80211_free_tid_rx() need not have
      run when that returns (it deletes the timer.) We could use
      rcu_barrier() instead of synchronize_net(), but that's much
      more expensive.
      
      Instead, to fix this, add a field tracking that the session
      is being deleted. In this case, the only re-arming of the
      timer happens with the reorder spinlock held, so make that
      code not rearm it if the session is being deleted and also
      delete the timer after setting that field. This ensures the
      timer cannot fire after ___ieee80211_stop_rx_ba_session()
      returns, which fixes the problem.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      788211d8
  2. 16 Mar, 2015 4 commits
  3. 03 Mar, 2015 2 commits
  4. 26 Feb, 2015 1 commit
    • Jouni Malinen's avatar
      mac80211: Send EAPOL frames at lowest rate · 9c1c98a3
      Jouni Malinen authored
      The current minstrel_ht rate control behavior is somewhat optimistic in
      trying to find optimum TX rate. While this is usually fine for normal
      Data frames, there are cases where a more conservative set of retry
      parameters would be beneficial to make the connection more robust.
      
      EAPOL frames are critical to the authentication and especially the
      EAPOL-Key message 4/4 (the last message in the 4-way handshake) is
      important to get through to the AP. If that message is lost, the only
      recovery mechanism in many cases is to reassociate with the AP and start
      from scratch. This can often be avoided by trying to send the frame with
      more conservative rate and/or with more link layer retries.
      
      In most cases, minstrel_ht is currently using the initial EAPOL-Key
      frames for probing higher rates and this results in only five link layer
      transmission attempts (one at high(ish) MCS and four at MCS0). While
      this works with most APs, it looks like there are some deployed APs that
      may have issues with the EAPOL frames using HT MCS immediately after
      association. Similarly, there may be issues in cases where the signal
      strength or radio environment is not good enough to be able to get
      frames through even at couple of MCS 0 tries.
      
      The best approach for this would likely to be to reduce the TX rate for
      the last rate (3rd rate parameter in the set) to a low basic rate (say,
      6 Mbps on 5 GHz and 2 or 5.5 Mbps on 2.4 GHz), but doing that cleanly
      requires some more effort. For now, we can start with a simple one-liner
      that forces the minimum rate to be used for EAPOL frames similarly how
      the TX rate is selected for the IEEE 802.11 Management frames. This does
      result in a small extra latency added to the cases where the AP would be
      able to receive the higher rate, but taken into account how small number
      of EAPOL frames are used, this is likely to be insignificant. A future
      optimization in the minstrel_ht design can also allow this patch to be
      reverted to get back to the more optimized initial TX rate.
      
      It should also be noted that many drivers that do not use minstrel as
      the rate control algorithm are already doing similar workarounds by
      forcing the lowest TX rate to be used for EAPOL frames.
      
      Cc: stable@vger.kernel.org
      Reported-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Tested-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarJouni Malinen <jouni@qca.qualcomm.com>
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      9c1c98a3
  5. 24 Feb, 2015 7 commits
  6. 23 Feb, 2015 2 commits
  7. 22 Feb, 2015 7 commits
  8. 20 Feb, 2015 16 commits
    • Florian Fainelli's avatar
      net: dsa: bcm_sf2: fix 64-bits register reads · ddede6d5
      Florian Fainelli authored
      Reading 64-bits register was not working because we inverted the steps
      between reading the lower 32-bits of the register and reading the upper
      32-bits. Swapping these operations is how the HW guarantees that 64-bits
      reads are latched correctly. We only have a handful of 64-bits registers
      for now, mostly MIB counters, so the imapct is low.
      
      Fixes: 246d7f77 ("net: dsa: add Broadcom SF2 switch driver")
      Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ddede6d5
    • Daniel Borkmann's avatar
      rhashtable: allow to unload test module · 6dd0c165
      Daniel Borkmann authored
      There's no good reason why to disallow unloading of the rhashtable
      test case module.
      
      Commit 9d6dbe1b moved the code from a boot test into a stand-alone
      module, but only converted the subsys_initcall() handler into a
      module_init() function without a related exit handler, and thus
      preventing the test module from unloading.
      
      Fixes: 9d6dbe1b ("rhashtable: Make selftest modular")
      Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      Acked-by: default avatarThomas Graf <tgraf@suug.ch>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6dd0c165
    • Daniel Borkmann's avatar
      rhashtable: better high order allocation attempts · eb6d1abf
      Daniel Borkmann authored
      When trying to allocate future tables via bucket_table_alloc(), it seems
      overkill on large table shifts that we probe for kzalloc() unconditionally
      first, as it's likely to fail.
      
      Only probe with kzalloc() for more reasonable table sizes and use vzalloc()
      either as a fallback on failure or directly in case of large table sizes.
      
      Fixes: 7e1e7763 ("lib: Resizable, Scalable, Concurrent Hash Table")
      Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      Acked-by: default avatarThomas Graf <tgraf@suug.ch>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      eb6d1abf
    • Daniel Borkmann's avatar
      rhashtable: don't test for shrink on insert, expansion on delete · 342100d9
      Daniel Borkmann authored
      Restore pre 54c5b7d3 behaviour and only probe for expansions on inserts
      and shrinks on deletes. Currently, it will happen that on initial inserts
      into a sparse hash table, we may i.e. shrink it first simply because it's
      not fully populated yet, only to later realize that we need to grow again.
      
      This however is counter intuitive, e.g. an initial default size of 64
      elements is already small enough, and in case an elements size hint is given
      to the hash table by a user, we should avoid unnecessary expansion steps,
      so a shrink is clearly unintended here.
      
      Fixes: 54c5b7d3 ("rhashtable: introduce rhashtable_wakeup_worker helper function")
      Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      Cc: Ying Xue <ying.xue@windriver.com>
      Acked-by: default avatarThomas Graf <tgraf@suug.ch>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      342100d9
    • David S. Miller's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf · ee922598
      David S. Miller authored
      Pablo Neira Ayuso says:
      
      ====================
      Netfilter/IPVS fixes for net
      
      The following patchset contains updates for your net tree, they are:
      
      1) Fix removal of destination in IPVS when the new mixed family support
         is used, from Alexey Andriyanov via Simon Horman.
      
      2) Fix module refcount undeflow in nft_compat when reusing a match /
         target.
      
      3) Fix iptables-restore when the recent match is used with a new hitcount
         that exceeds threshold, from Florian Westphal.
      
      4) Fix stack corruption in xt_socket due to using stack storage to save
         the inner IPv6 header, from Eric Dumazet.
      
      I'll follow up soon with another batch with more fixes that are still
      cooking.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ee922598
    • Dan Carpenter's avatar
      caif: fix a signedness bug in cfpkt_iterate() · 278f7b4f
      Dan Carpenter authored
      The cfpkt_iterate() function can return -EPROTO on error, but the
      function is a u16 so the negative value gets truncated to a positive
      unsigned short.  This causes a static checker warning.
      
      The only caller which might care is cffrml_receive(), when it's checking
      the frame checksum.  I modified cffrml_receive() so that it never says
      -EPROTO is a valid checksum.
      
      Also this isn't ever going to be inlined so I removed the "inline".
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      278f7b4f
    • Anish Bhatt's avatar
      cxgb4: Fix incorrect 'c' suffix to %pI4, use %pISc instead · 5a8eeec4
      Anish Bhatt authored
      Issue caught by 0-day kernel test infrastructure. Code changed to use sockaddr
      members so that %pISc can be used instead.
      
      Fixes: b5a02f50 ('cxgb4 : Update ipv6 address handling api')
      Signed-off-by: default avatarAnish Bhatt <anish@chelsio.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5a8eeec4
    • Rami Rosen's avatar
      ethtool: Add hw-switch-offload to netdev_features_strings. · 65e9256c
      Rami Rosen authored
      commit aafb3e98 (netdev: introduce new NETIF_F_HW_SWITCH_OFFLOAD feature
      flag for switch device offloads) add a new feature without adding it to
      netdev_features_strings array; this patch fixes this.
      Signed-off-by: default avatarRami Rosen <ramirose@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      65e9256c
    • Mahesh Bandewar's avatar
      ipvlan: Fix text that talks about ip util support · f4c2b7a0
      Mahesh Bandewar authored
      ipvlan was added into 3.19 release and iproute2 added support
      for the same in iproute2-3.19 package.
      Signed-off-by: default avatarMahesh Bandewar <maheshb@google.com>
      CC: Stephen Hemminger <stephen@networkplumber.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f4c2b7a0
    • Daniel Borkmann's avatar
      rhashtable: don't allocate ht structure on stack in test_rht_init · b7f5e5c7
      Daniel Borkmann authored
      With object runtime debugging enabled, the rhashtable test suite
      will rightfully throw a warning "ODEBUG: object is on stack, but
      not annotated" from rhashtable_init().
      
      This is because run_work is (correctly) being initialized via
      INIT_WORK(), and not annotated by INIT_WORK_ONSTACK(). Meaning,
      rhashtable_init() is okay as is, we just need to move ht e.g.,
      into global scope.
      
      It never triggered anything, since test_rhashtable is rather a
      controlled environment and effectively runs to completion, so
      that stack memory is not vanishing underneath us, we shouldn't
      confuse any testers with it though.
      
      Fixes: 7e1e7763 ("lib: Resizable, Scalable, Concurrent Hash Table")
      Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      Acked-by: default avatarThomas Graf <tgraf@suug.ch>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b7f5e5c7
    • Arnd Bergmann's avatar
      net/appletalk: LTPC needs virt_to_bus · bf60e50c
      Arnd Bergmann authored
      The ltpc driver is rather outdated and does not get built on most
      platforms because it requires the ISA_DMA_API symbol. However
      there are some ARM platforms that have ISA_DMA_API but no virt_to_bus,
      and they get this build error when enabling the ltpc driver.
      
      drivers/net/appletalk/ltpc.c: In function 'handlefc':
      drivers/net/appletalk/ltpc.c:380:2: error: implicit declaration of function 'virt_to_bus' [-Werror=implicit-function-declaration]
        set_dma_addr(dma,virt_to_bus(ltdmacbuf));
        ^
      
      This adds another dependency in Kconfig to avoid that configuration.
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      bf60e50c
    • Arnd Bergmann's avatar
      net: smc91x: improve neponset hack · 15added6
      Arnd Bergmann authored
      The smc91x driver tries to support multiple platforms at compile
      time, but they are mutually exclusive at runtime, and not clearly
      defined.
      
      Trying to build for CONFIG_SA1100_ASSABET without CONFIG_ASSABET_NEPONSET
      results in this link error:
      
      drivers/built-in.o: In function `smc_drv_probe':
      :(.text+0x33310c): undefined reference to `neponset_ncr_frob'
      
      since the neponset_ncr_set function is not defined otherwise.
      
      Similarly, building for both CONFIG_SA1100_ASSABET and CONFIG_SA1100_PLEB
      results in a different build error:
      
      smsc/smc91x.c: In function 'smc_drv_probe':
      smsc/smc91x.c:2299:2: error: implicit declaration of function 'neponset_ncr_set' [-Werror=implicit-function-declaration]
        neponset_ncr_set(NCR_ENET_OSC_EN);
        ^
      smsc/smc91x.c:2299:19: error: 'NCR_ENET_OSC_EN' undeclared (first use in this function)
        neponset_ncr_set(NCR_ENET_OSC_EN);
                         ^
      
      This is an attempt to fix the call site responsible for both
      errors, making sure we call the function exactly when the driver
      is actually trying to run on the assabet/neponset machine. With
      this patch, I no longer see randconfig build errors in this file.
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      15added6
    • Eric Dumazet's avatar
      sock: sock_dequeue_err_skb() needs hard irq safety · 997d5c3f
      Eric Dumazet authored
      Non NAPI drivers can call skb_tstamp_tx() and then sock_queue_err_skb()
      from hard IRQ context.
      
      Therefore, sock_dequeue_err_skb() needs to block hard irq or
      corruptions or hangs can happen.
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Fixes: 364a9e93 ("sock: deduplicate errqueue dequeue")
      Fixes: cb820f8e ("net: Provide a generic socket error queue delivery method for Tx time stamps.")
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      997d5c3f
    • Geert Uytterhoeven's avatar
      net: Initialize all members in skb_gro_remcsum_init() · 846cd667
      Geert Uytterhoeven authored
      skb_gro_remcsum_init() initializes the gro_remcsum.delta member only,
      leading to compiler warnings about a possibly uninitialized
      gro_remcsum.offset member:
      
      drivers/net/vxlan.c: In function ‘vxlan_gro_receive’:
      drivers/net/vxlan.c:602: warning: ‘grc.offset’ may be used uninitialized in this function
      net/ipv4/fou.c: In function ‘gue_gro_receive’:
      net/ipv4/fou.c:262: warning: ‘grc.offset’ may be used uninitialized in this function
      
      While these are harmless for now:
        - skb_gro_remcsum_process() sets offset before changing delta,
        - skb_gro_remcsum_cleanup() checks if delta is non-zero before
          accessing offset,
      it's safer to let the initialization function initialize all members.
      Signed-off-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
      Acked-by: default avatarTom Herbert <therbert@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      846cd667
    • Derrick Pallas's avatar
      ethernet/ixp4xx: prevent allmulti from clobbering promisc · f81edc6a
      Derrick Pallas authored
      If both promisc and allmulti are set, promisc should trump allmulti and
      disable the MAC filter; otherwise, the interface is not really promisc.
      
      Previously, this code checked IFF_ALLMULTI prior to and without regard for
      IFF_PROMISC; if both were set, only multicast and direct unicast traffic
      would make it through the filter.
      Signed-off-by: default avatarDerrick Pallas <pallas@meraki.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f81edc6a
    • Pravin B Shelar's avatar
      openvswitch: Fix net exit. · 7b4577a9
      Pravin B Shelar authored
      Open vSwitch allows moving internal vport to different namespace
      while still connected to the bridge. But when namespace deleted
      OVS does not detach these vports, that results in dangling
      pointer to netdevice which causes kernel panic as follows.
      This issue is fixed by detaching all ovs ports from the deleted
      namespace at net-exit.
      
      BUG: unable to handle kernel NULL pointer dereference at 0000000000000028
      IP: [<ffffffffa0aadaa5>] ovs_vport_locate+0x35/0x80 [openvswitch]
      Oops: 0000 [#1] SMP
      Call Trace:
       [<ffffffffa0aa6391>] lookup_vport+0x21/0xd0 [openvswitch]
       [<ffffffffa0aa65f9>] ovs_vport_cmd_get+0x59/0xf0 [openvswitch]
       [<ffffffff8167e07c>] genl_family_rcv_msg+0x1bc/0x3e0
       [<ffffffff8167e319>] genl_rcv_msg+0x79/0xc0
       [<ffffffff8167d919>] netlink_rcv_skb+0xb9/0xe0
       [<ffffffff8167deac>] genl_rcv+0x2c/0x40
       [<ffffffff8167cffd>] netlink_unicast+0x12d/0x1c0
       [<ffffffff8167d3da>] netlink_sendmsg+0x34a/0x6b0
       [<ffffffff8162e140>] sock_sendmsg+0xa0/0xe0
       [<ffffffff8162e5e8>] ___sys_sendmsg+0x408/0x420
       [<ffffffff8162f541>] __sys_sendmsg+0x51/0x90
       [<ffffffff8162f592>] SyS_sendmsg+0x12/0x20
       [<ffffffff81764ee9>] system_call_fastpath+0x12/0x17
      Reported-by: default avatarAssaf Muller <amuller@redhat.com>
      Fixes: 46df7b81("openvswitch: Add support for network namespaces.")
      Signed-off-by: default avatarPravin B Shelar <pshelar@nicira.com>
      Reviewed-by: default avatarThomas Graf <tgraf@noironetworks.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7b4577a9