1. 20 12月, 2014 9 次提交
  2. 19 12月, 2014 8 次提交
  3. 18 12月, 2014 1 次提交
    • M
      Bluetooth: Fix bug with filter in service discovery optimization · ea8ae251
      Marcel Holtmann 提交于
      The optimization for filtering out extended inquiry results, advertising
      reports or scan response data based on provided UUID list has a logic
      bug. In case no match is found in the advertising data, the scan
      response is ignored and not checked against the filter. This will lead
      to events being filtered wrongly.
      
      Change the code to actually only drop the events when the scan response
      data is not present. If it is present, it needs to be checked against
      the provided filter.
      
      The patch is a bit more complex than it needs to be. That is because
      it also fixes this compiler warning that some gcc versions produce.
      
        CC      net/bluetooth/mgmt.o
      net/bluetooth/mgmt.c: In function ‘mgmt_device_found’:
      net/bluetooth/mgmt.c:7028:7: warning: ‘match’ may be used uninitialized in this function [-Wmaybe-uninitialized]
        bool match;
             ^
      
      It seems that gcc can not clearly figure out the context of the match
      variable. So just change the branches for the extended inquiry response
      and advertising data around so that it is clear.
      Reported-by: NGeert Uytterhoeven <geert@linux-m68k.org>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      ea8ae251
  4. 17 12月, 2014 4 次提交
  5. 16 12月, 2014 2 次提交
    • G
      rds: Fix min() warning in rds_message_inc_copy_to_user() · 6ff4a8ad
      Geert Uytterhoeven 提交于
      net/rds/message.c: In function ‘rds_message_inc_copy_to_user’:
      net/rds/message.c:328: warning: comparison of distinct pointer types lacks a cast
      
      Use min_t(unsigned long, ...) like is done in
      rds_message_copy_from_user().
      Signed-off-by: NGeert Uytterhoeven <geert@linux-m68k.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6ff4a8ad
    • T
      gre: fix the inner mac header in nbma tunnel xmit path · 8a0033a9
      Timo Teräs 提交于
      The NBMA GRE tunnels temporarily push GRE header that contain the
      per-packet NBMA destination on the skb via header ops early in xmit
      path. It is the later pulled before the real GRE header is constructed.
      
      The inner mac was thus set differently in nbma case: the GRE header
      has been pushed by neighbor layer, and mac header points to beginning
      of the temporary gre header (set by dev_queue_xmit).
      
      Now that the offloads expect mac header to point to the gre payload,
      fix the xmit patch to:
       - pull first the temporary gre header away
       - and reset mac header to point to gre payload
      
      This fixes tso to work again with nbma tunnels.
      
      Fixes: 14051f04 ("gre: Use inner mac length when computing tunnel length")
      Signed-off-by: NTimo Teräs <timo.teras@iki.fi>
      Cc: Tom Herbert <therbert@google.com>
      Cc: Alexander Duyck <alexander.h.duyck@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8a0033a9
  6. 12 12月, 2014 16 次提交
    • A
      fib_trie: Fix trie balancing issue if new node pushes down existing node · e962f302
      Alexander Duyck 提交于
      This patch addresses an issue with the level compression of the fib_trie.
      Specifically in the case of adding a new leaf that triggers a new node to
      be added that takes the place of the old node.  The result is a trie where
      the 1 child tnode is on one side and one leaf is on the other which gives
      you a very deep trie.  Below is the script I used to generate a trie on
      dummy0 with a 10.X.X.X family of addresses.
      
        ip link add type dummy
        ipval=184549374
        bit=2
        for i in `seq 1 23`
        do
          ifconfig dummy0:$bit $ipval/8
          ipval=`expr $ipval - $bit`
          bit=`expr $bit \* 2`
        done
        cat /proc/net/fib_triestat
      
      Running the script before the patch:
      
      	Local:
      		Aver depth:     10.82
      		Max depth:      23
      		Leaves:         29
      		Prefixes:       30
      		Internal nodes: 27
      		  1: 26  2: 1
      		Pointers: 56
      	Null ptrs: 1
      	Total size: 5  kB
      
      After applying the patch and repeating:
      
      	Local:
      		Aver depth:     4.72
      		Max depth:      9
      		Leaves:         29
      		Prefixes:       30
      		Internal nodes: 12
      		  1: 3  2: 2  3: 7
      		Pointers: 70
      	Null ptrs: 30
      	Total size: 4  kB
      
      What this fix does is start the rebalance at the newly created tnode
      instead of at the parent tnode.  This way if there is a gap between the
      parent and the new node it doesn't prevent the new tnode from being
      coalesced with any pre-existing nodes that may have been pushed into one
      of the new nodes child branches.
      Signed-off-by: NAlexander Duyck <alexander.h.duyck@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e962f302
    • T
      vlan: Add ability to always enable TSO/UFO · 53f6b708
      Toshiaki Makita 提交于
      Since the real device can segment packets by software, a vlan device
      can set TSO/UFO even when the real device doesn't have those features.
      Unlike GSO, this allows packets to be segmented after Qdisc.
      Signed-off-by: NToshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      53f6b708
    • A
      cfg80211: correctly check ad-hoc channels · 185076d6
      Arik Nemtsov 提交于
      Ad-hoc requires beaconing for regulatory purposes. Validate that the
      channel is valid for beaconing, and not only enabled.
      Signed-off-by: NArik Nemtsov <arikx.nemtsov@intel.com>
      Reviewed-by: NLuis R. Rodriguez <mcgrof@suse.com>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      185076d6
    • E
      cfg80211: don't WARN about two consecutive Country IE hint · 70dcec5a
      Emmanuel Grumbach 提交于
      This can happen and there is no point in added more
      detection code lower in the stack. Catching these in one
      single point (cfg80211) is enough. Stop WARNING about this
      case.
      
      This fixes:
      https://bugzilla.kernel.org/show_bug.cgi?id=89001
      
      Cc: stable@vger.kernel.org
      Fixes: 2f1c6c57 ("cfg80211: process non country IE conflicting first")
      Signed-off-by: NEmmanuel Grumbach <emmanuel.grumbach@intel.com>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      70dcec5a
    • J
      Bluetooth: Fix mgmt response status when removing adapter · 9845904f
      Johan Hedberg 提交于
      When an adapter is removed (hci_unregister_dev) any pending mgmt
      commands for that adapter should get the appropriate INVALID_INDEX
      response. Since hci_unregister_dev() calls hci_dev_do_close() first
      that'd so far have caused "not powered" responses to be sent.
      
      Skipping the HCI_UNREGISTER case in mgmt_powered() is also not a
      solution since before reaching the mgmt_index_removed() stage any
      hci_conn callbacks (e.g. used by pairing) will get called, thereby
      causing "disconnected" status responses to be sent.
      
      The fix that covers all scenarios is to handle both INVALID_INDEX and
      NOT_POWERED responses through the mgmt_powered() function. The
      INVALID_INDEX response sending from mgmt_index_removed() is left
      untouched since there are a couple of places not related to powering off
      or removing an adapter that call it (e.g. configuring a new bdaddr).
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      9845904f
    • J
      Bluetooth: Fix enabling BR/EDR SC when powering on · ec6f99b8
      Johan Hedberg 提交于
      If we're in the AUTO_OFF stage the powered_update_hci() function is
      responsible for doing the updates to the HCI state that were not done
      during the actual mgmt command handlers. One of the updates needing done
      is for BR/EDR SC support. This patch adds the missing HCI command for SC
      support to the powered_update_hci() function.
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      ec6f99b8
    • E
      mac80211: update the channel context after channel switch · 722ddb0d
      Emmanuel Grumbach 提交于
      When the channel switch has been made, a vif is now using
      the channel context which was reserved. When that happens,
      we need to update the channel context since its parameters
      may change.
      
      I hit a case in which I switched to a 40Mhz channel but the
      reserved channel context was still on 20Mhz. The rate control
      would try to send 40Mhz packets on a 20Mhz channel context and
      that made iwlwifi's firmware unhappy.
      Signed-off-by: NEmmanuel Grumbach <emmanuel.grumbach@intel.com>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      722ddb0d
    • L
      nl80211: check matches array length before acessing it · f89f46cf
      Luciano Coelho 提交于
      If the userspace passes a malformed sched scan request (or a net
      detect wowlan configuration) by adding a NL80211_ATTR_SCHED_SCAN_MATCH
      attribute without any nested matchsets, a NULL pointer dereference
      will occur.  Fix this by checking that we do have matchsets in our
      array before trying to access it.
      
      BUG: unable to handle kernel NULL pointer dereference at 0000000000000024
      IP: [<ffffffffa002fd69>] nl80211_parse_sched_scan.part.67+0x6e9/0x900 [cfg80211]
      PGD 865c067 PUD 865b067 PMD 0
      Oops: 0002 [#1] SMP
      Modules linked in: iwlmvm(O) iwlwifi(O) mac80211(O) cfg80211(O) compat(O) [last unloaded: compat]
      CPU: 2 PID: 2442 Comm: iw Tainted: G           O   3.17.2 #31
      Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
      task: ffff880013800790 ti: ffff880008d80000 task.ti: ffff880008d80000
      RIP: 0010:[<ffffffffa002fd69>]  [<ffffffffa002fd69>] nl80211_parse_sched_scan.part.67+0x6e9/0x900 [cfg80211]
      RSP: 0018:ffff880008d838d0  EFLAGS: 00010293
      RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000
      RDX: 000000000000143c RSI: 0000000000000000 RDI: ffff880008ee8dd0
      RBP: ffff880008d83948 R08: 0000000000000002 R09: 0000000000000019
      R10: ffff88001d1b3c40 R11: 0000000000000002 R12: ffff880019e85e00
      R13: 00000000fffffed4 R14: ffff880009757800 R15: 0000000000001388
      FS:  00007fa3b6d13700(0000) GS:ffff88003e200000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: 0000000000000024 CR3: 0000000008670000 CR4: 00000000000006e0
      Stack:
       ffff880009757800 ffff880000000001 0000000000000000 ffff880008ee84e0
       0000000000000000 ffff880009757800 00000000fffffed4 ffff880008d83948
       ffffffff814689c9 ffff880009757800 ffff880008ee8000 0000000000000000
      Call Trace:
       [<ffffffff814689c9>] ? nla_parse+0xb9/0x120
       [<ffffffffa00306de>] nl80211_set_wowlan+0x75e/0x960 [cfg80211]
       [<ffffffff810bf3d5>] ? mark_held_locks+0x75/0xa0
       [<ffffffff8161a77b>] genl_family_rcv_msg+0x18b/0x360
       [<ffffffff810bf66d>] ? trace_hardirqs_on+0xd/0x10
       [<ffffffff8161a9d4>] genl_rcv_msg+0x84/0xc0
       [<ffffffff8161a950>] ? genl_family_rcv_msg+0x360/0x360
       [<ffffffff81618e79>] netlink_rcv_skb+0xa9/0xd0
       [<ffffffff81619458>] genl_rcv+0x28/0x40
       [<ffffffff816184a5>] netlink_unicast+0x105/0x180
       [<ffffffff8161886f>] netlink_sendmsg+0x34f/0x7a0
       [<ffffffff8105a097>] ? kvm_clock_read+0x27/0x40
       [<ffffffff815c644d>] sock_sendmsg+0x8d/0xc0
       [<ffffffff811a75c9>] ? might_fault+0xb9/0xc0
       [<ffffffff811a756e>] ? might_fault+0x5e/0xc0
       [<ffffffff815d5d26>] ? verify_iovec+0x56/0xe0
       [<ffffffff815c73e0>] ___sys_sendmsg+0x3d0/0x3e0
       [<ffffffff810a7be8>] ? sched_clock_cpu+0x98/0xd0
       [<ffffffff810611b4>] ? __do_page_fault+0x254/0x580
       [<ffffffff810bb39f>] ? up_read+0x1f/0x40
       [<ffffffff810611b4>] ? __do_page_fault+0x254/0x580
       [<ffffffff812146ed>] ? __fget_light+0x13d/0x160
       [<ffffffff815c7b02>] __sys_sendmsg+0x42/0x80
       [<ffffffff815c7b52>] SyS_sendmsg+0x12/0x20
       [<ffffffff81751f69>] system_call_fastpath+0x16/0x1b
      
      Fixes: ea73cbce ("nl80211: fix scheduled scan RSSI matchset attribute confusion")
      Cc: stable@vger.kernel.org [3.15+]
      Signed-off-by: NLuciano Coelho <luciano.coelho@intel.com>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      f89f46cf
    • A
      cfg80211: avoid mem leak on driver hint set · 34f05f54
      Arik Nemtsov 提交于
      In the already-set and intersect case of a driver-hint, the previous
      wiphy regdomain was not freed before being reset with a copy of the
      cfg80211 regdomain.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NArik Nemtsov <arikx.nemtsov@intel.com>
      Acked-by: NLuis R. Rodriguez <mcgrof@suse.com>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      34f05f54
    • J
      cfg80211: Fix 160 MHz channels with 80+80 and 160 MHz drivers · 08f6f147
      Jouni Malinen 提交于
      The VHT supported channel width field is a two bit integer, not a
      bitfield. cfg80211_chandef_usable() was interpreting it incorrectly and
      ended up rejecting 160 MHz channel width if the driver indicated support
      for both 160 and 80+80 MHz channels.
      
      Cc: stable@vger.kernel.org (3.16+)
      Fixes: 3d9d1d66 ("nl80211/cfg80211: support VHT channel configuration")
             (however, no real drivers had 160 MHz support it until 3.16)
      Signed-off-by: NJouni Malinen <jouni@qca.qualcomm.com>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      08f6f147
    • A
      mac80211: fix multicast LED blinking and counter · d025933e
      Andreas Müller 提交于
      As multicast-frames can't be fragmented, "dot11MulticastReceivedFrameCount"
      stopped being incremented after the use-after-free fix. Furthermore, the
      RX-LED will be triggered by every multicast frame (which wouldn't happen
      before) which wouldn't allow the LED to rest at all.
      
      Fixes https://bugzilla.kernel.org/show_bug.cgi?id=89431 which also had the
      patch.
      
      Cc: stable@vger.kernel.org
      Fixes: b8fff407 ("mac80211: fix use-after-free in defragmentation")
      Signed-off-by: NAndreas Müller <goo@stapelspeicher.org>
      [rewrite commit message]
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      d025933e
    • J
      mac80211: avoid using uninitialized stack data · 7e6225a1
      Jes Sorensen 提交于
      Avoid a case where we would access uninitialized stack data if the AP
      advertises HT support without 40MHz channel support.
      
      Cc: stable@vger.kernel.org
      Fixes: f3000e1b ("mac80211: fix broken use of VHT/20Mhz with some APs")
      Signed-off-by: NJes Sorensen <Jes.Sorensen@redhat.com>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      7e6225a1
    • F
      net: dsa: propagate error code from dsa_slave_phy_setup · 9697f1cd
      Florian Fainelli 提交于
      In case we cannot attach to our slave netdevice PHY, error out and
      propagate that error up to the caller: dsa_slave_create().
      
      Fixes: 0d8bcdd3 ("net: dsa: allow for more complex PHY setups")
      Signed-off-by: NAndrey Volkov <andrey.volkov@nexvision.fr>
      Signed-off-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9697f1cd
    • F
      net: dsa: handle non-existing PHYs on switch internal bus · 53013c77
      Florian Fainelli 提交于
      In case there is no PHY at the designated address on the internal
      switch, we would basically de-reference a null pointer here:
      
      dsa_slave_phy_setup(...)
      {
      	p->phy = ds->slave_mii_bus->phy_map[p->port];
      	phy_connect_direct(slave_dev, p->phy, dsa_slave_adjust_link,
      				      ^------
      
      This can be triggered when the platform configuration (platform_data or
      Device Tree) indicates there should be a PHY device at this address, but
      the HW is non-responsive, such that we cannot attach a PHY device at
      this specific location.
      
      Fix this by checking the return value prior to calling
      phy_connect_direct().
      
      CC: Andrew Lunn <andrew@lunn.ch>
      Fixes: b31f65fb ("net: dsa: slave: Fix autoneg for phys on switch MDIO bus")
      Reported-by: NBrian Norris <computersforpeace@gmail.com>
      Signed-off-by: NAndrey Volkov <andrey.volkov@nexvision.fr>
      Signed-off-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      53013c77
    • J
      Bluetooth: Fix notifying mgmt power off before flushing connection list · 1aeb9c65
      Johan Hedberg 提交于
      This patch moves the mgmt_powered() notification earlier in the
      hci_dev_do_close() function. This way the correct "not powered" error
      gets passed to any pending mgmt commands. Without the patch the pending
      commands would instead get a misleading "disconnected" response when
      powering down the adapter.
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      1aeb9c65
    • J
      Bluetooth: Fix incorrect pending cmd removal in pairing_complete() · a511b35b
      Johan Hedberg 提交于
      The pairing_complete() function is used as a pending mgmt command
      cmd_complete callback. The expectation of such functions is that they
      are not responsible themselves for calling mgmt_pending_remove(). This
      patch fixes the incorrect mgmt_pending_remove() call in
      pairing_complete() and adds it to the appropriate changes.
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      a511b35b