Commit Graph

19946 Commits

Author SHA1 Message Date
Brian Gix
8a7f164195 Bluetooth: Fix Limited Discoverability for MGMTOPS
CRs-fixed: 309551
Change-Id: I42c46c62dcb4b227d9ac48146ee61cb52063a6ae
Signed-off-by: Brian Gix <bgix@codeaurora.org>
2011-10-18 13:13:57 -07:00
Dmitry Shmidt
fdfcbc682a net: wireless: Fix CFG80211_ALLOW_RECONNECT option for disconnect
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2011-10-18 12:30:02 -07:00
Jason Wang
a1b7ab0836 ipv6: fix NULL dereference in udp6_ufo_fragment()
This patch fixes the issue caused by ef81bb40bf
which is a backport of upstream 87c48fa3b4630905f98268dde838ee43626a060c. The
problem does not exist in upstream.

We do not check whether route is attached before trying to assign ip
identification through route dest which lead NULL pointer dereference. This
happens when host bridge transmit a packet from guest.

This patch changes ipv6_select_ident() to accept in6_addr as its paramter and
fix the issue by using the destination address in ipv6 header when no route is
attached.

Signed-off-by: Jason Wang <jasowang@redhat.com>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-16 14:14:54 -07:00
Brian Gix
570efc917a Bluetooth: Fix error returned to bluez on LE Pairing Failure
Change-Id: I1e7908e133d53b41bdd58a54a2e293526e96e160
Signed-off-by: Brian Gix <bgix@codeaurora.org>
2011-10-14 13:55:25 -07:00
Brian Gix
8d0b7d6797 Bluetooth: Fix LE pairing scenarios when initiated remotely
Fix setting of ENCRYPTION_PENDING and Connection refcnt's that could
be out of sync due to remote slave issued security requests.

Change-Id: Ie72abd0648182db0ef60693820139f40ef2e4bf6
Signed-off-by: Brian Gix <bgix@codeaurora.org>
2011-10-14 13:55:24 -07:00
Linux Build Service Account
e4fe87773c Merge "Bluetooth: Socket lookup for a fixed L2CAP channel" into msm-3.0 2011-10-14 01:07:55 -07:00
Linux Build Service Account
4e4b1b1d69 Merge "Bluetooth: Timeout LE Connection requests" into msm-3.0 2011-10-12 19:55:56 -07:00
Inga Stotland
f214b6e656 Bluetooth: Socket lookup for a fixed L2CAP channel
Socket lookup for a fixed channel should be done based on both remote and
local device addresses.

Change-Id: I35f39bea8ade6fd5d8695640251efc54bf21beae
Signed-off-by: Inga Stotland <ingas@codeaurora.org>
2011-10-12 13:09:28 -07:00
Brian Gix
114f3a6d3c Bluetooth: Timeout LE Connection requests
If LE devices stop advertising or go out of range, we need
to apply a timeout because the baseband doesn't.

Change-Id: I115672e21fd8aef56ac688b2df4664bb74b725e4
Signed-off-by: Brian Gix <bgix@codeaurora.org>
2011-10-11 11:03:06 -07:00
Brian Gix
58ba077931 Bluetooth: Complete LE Auth failure notification
Signed-off-by: Brian Gix <bgix@codeaurora.org>
2011-10-11 09:59:28 -07:00
Peter Krystad
462bf76d29 Bluetooth: Guarantee BR-EDR device will be registered as hci0
Signed-off-by: Peter Krystad <pkrystad@codeaurora.org>
2011-10-11 09:59:24 -07:00
JP Abgrall
8493beb104 netfilter: xt_qtaguid: fix crash on ctrl delete command
Because for now the xt_qtaguid module allows procs to use tags without
having /dev/xt_qtaguid open, there was a case where it would try
to delete a resources from a list that was proc specific.
But that resource was never added to that list which is only
used when /dev/xt_qtaguid has been opened by the proc.

Once our userspace is fully updated, we won't need those exceptions.

Change-Id: Idd4bfea926627190c74645142916e10832eb2504
Signed-off-by: JP Abgrall <jpa@google.com>
2011-10-07 22:16:01 -07:00
Ashish Sharma
3bc18c7282 bridge: Have tx_bytes count headers like rx_bytes.
Since rx_bytes accounting does not include Ethernet Headers in
br_input.c, excluding ETH_HLEN on the transmit path for consistent
measurement of packet length on both the Tx and Rx chains.

The clean way would be for Rx to include the eth header, but the
skb len has already been adjusted by the time the br code sees the skb.
This is only a temporary workaround until we can completely ignore or
cleanly fix the skb->len handling.

Change-Id: I910de95a4686b2119da7f1f326e2154ef31f9972
Signed-off-by: Ashish Sharma <ashishsharma@google.com>
2011-10-07 17:54:30 -07:00
Ashish Sharma
ca37d833b0 netfilter: xt_qtaguid: Fix the stats info display order
Change-Id: I3bf165c31f35a6c7dc212f23df5eefaeb8129d0d
Signed-off-by: Ashish Sharma <ashishsharma@google.com>
2011-10-06 17:02:06 -07:00
Brian Gix
fdd3892444 Bluetooth: Add EIR flags to LE Adv data cache
Use the EIR flags to prevent LE pairing attempts to
BR/EDR capable (Dual Mode) devices.

Signed-off-by: Brian Gix <bgix@codeaurora.org>
2011-10-04 17:14:22 -07:00
Brian Gix
065e8ff2cd Bluetooth: Balance LE hdev refcnt when not pairing.
Signed-off-by: Brian Gix <bgix@codeaurora.org>
2011-10-04 17:14:08 -07:00
Srinivas Krovvidi
9ff51459ca Bluetooth: Storing Link key persistantly based on the Auth Req.
Store the link key persistently if one of the following is true:
 1. this is a legacy link key
 2. this is a changed combination key and there was a previously
    stored one
 3. neither local nor remote side had no-bonding as a requirement
 4. the local side had dedicated bonding as a requirement
 5. the remote side is using dedicated bonding since in that case
    also the local requirements are set to dedicated bonding
 If none of the above match only keep the link key around for
 this connection and set the temporary flag for the device.

CRs-Fixed: 309161
Signed-off-by: Srinivas Krovvidi <skrovvid@codeaurora.org>
2011-10-04 17:13:59 -07:00
Brian Gix
e9ceb522ff Bluetooth: Fix LE Pairing time-out
Timer that was started at beginning of LE Pairing did not correctly
terminate pairing process when it fired, and was not properly cleaned
up on pairing completion.

Signed-off-by: Brian Gix <bgix@codeaurora.org>
2011-10-03 16:21:22 -07:00
Peter Krystad
7400e7f5ec Revert "Bluetooth: check L2CAP length in first ACL fragment"
This reverts commit 8979481328

CRs-fixed: 305959
Signed-off-by: Peter Krystad <pkrystad@codeaurora.org>
2011-10-03 16:21:15 -07:00
Mat Martineau
604c6475ca Bluetooth: AMP move collision loser should not change move state
During a move collision, both devices start out thinking they are the
initiator. The loser of the collision switches from the initiator role
to the responder role when receiving a move request from the remote
device.  However, a move response will also be received by the loser
after the role switch has occurred.

The loser of the collision was incorrectly modifying the AMP move
state in the move response handler.  This kept it from sending a move
channel response to the remote device, which stalled the channel move
process.

This change makes sure the AMP move state remains valid, so the
channel move succeeds.

CRs-fixed: 308382
Signed-off-by: Mat Martineau <mathewm@codeaurora.org>
2011-10-03 16:20:54 -07:00
Mat Martineau
8cd0df0792 Bluetooth: Change socket release context
When sock_put() is called on an L2CAP socket, if the reference count
on a sock goes to 0, l2cap_sock_release() is called. As part of the
release, l2cap_sock_shutdown() locks the socket. This is not allowable
in interrupt context.  This change makes calls to sock_put() on the
system workqueue, where it can safely lock.

This addresses "scheduling while atomic" issues in both the Bluetooth
mgmt_ops pairing code and when RFCOMM sessions are deleted in a
security_cfm callback.

Signed-off-by: Mat Martineau <mathewm@codeaurora.org>
2011-10-03 16:20:50 -07:00
Prabhakaran Mc
b04401d45b Bluetooth: Remove old link key before reinitiating authentication
When remote device do not have link key, DUT will try to reinitiate
authentication process. We should remove the link key before
reinitiating authentication process. This was fixed in hciops in
Bluez user space. Adding this change for mgmtops to handle this
case in kernel space.

CRs-fixed: 307063
Signed-off-by: Prabhakaran Mc <prabhakaranmc@codeaurora.org>
2011-10-03 16:20:30 -07:00
Mat Martineau
55f2a62dff Bluetooth: Wait for info response before accepting AMP connection
An incoming AMP "create channel" connection would trigger an info
request and an AMP physical accept sequence at the same time.  Since
accepting an AMP physical link is a local operation, it would complete
quickly and send a config request before the info response was
received.

If there is an outstanding info request, the AMP physical link should
not be accepted yet.  Existing logic in l2cap_conn_start() will accept
the physical link when the info response is received.

CRs-fixed: 307243
Signed-off-by: Mat Martineau <mathewm@codeaurora.org>
2011-10-03 16:20:27 -07:00
Brian Gix
3dd7017dd3 Bluetooth: Fix Deadlock on Legacy Scan/Pair
Fix nested calls to hci_dev_lock().

Signed-off-by: Brian Gix <bgix@codeaurora.org>
2011-10-03 16:20:18 -07:00
Inga Stotland
5029fc2ccc Bluetooth: Fix logic in hci_power_on().
If hci_dev_open() returns no error or EALREADY, allow the power on
sequence to proceed.

Signed-off-by: Inga Stotland <ingas@codeaurora.org>

Conflicts:

	net/bluetooth/hci_core.c
2011-10-03 16:19:53 -07:00
Brian Gix
2e2f50d997 Bluetooth: Add LE/BR flag to Connect notification
When remote device is connected outside the control of BlueZ, it
needs to be informed of whether the new connection is LE or BR/EDR.

Signed-off-by: Brian Gix <bgix@codeaurora.org>
2011-10-03 16:19:44 -07:00
Brian Gix
e57c1673ac Bluetooth: Fix LE Pairing on previous connections
There was a crashing issue when pairing was performed on LE connections
that were already up, due to a NULL function pointer being followed.

Signed-off-by: Brian Gix <bgix@codeaurora.org>
2011-10-03 16:19:44 -07:00
Brian Gix
adebcf9fca Bluetooth: Fix dead-lock failure during LE scan
Timer being deleted durings it's time-out callback execution caused
spinlock deadlock on multicore systems.

CRs-fixed: 305677
Signed-off-by: Brian Gix <bgix@codeaurora.org>
2011-10-03 16:19:43 -07:00
Brian Gix
6d5fb8a1b1 Bluetooth: Fix balancing of hci_conn refcnts
When LE was added, the refcnt's for the hci_conns used were not balanced
and some of this bleeded over between LE pairing and Legacy pairing.

CRs-fixed: 305391
Signed-off-by: Brian Gix <bgix@codeaurora.org>
2011-10-03 16:19:43 -07:00
Peter Krystad
1fc44074b0 Bluetooth: Only send mgmt_ops messages for BR-EDR devices
Signed-off-by: Peter Krystad <pkrystad@codeaurora.org>
2011-10-03 16:19:29 -07:00
Brian Gix
64bd5309f8 Bluetooth: Fix balance of hci_dev_get/hci_dev_put
Signed-off-by: Brian Gix <bgix@codeaurora.org>
2011-10-03 16:19:16 -07:00
Brian Gix
dfdd9360af Bluetooth: Fix Connection persistence, SSP caching
Fix key storage when not bonding
Fix when LE ACL is disconnected after use

Signed-off-by: Brian Gix <bgix@codeaurora.org>
2011-10-03 16:18:52 -07:00
Kun Han Kim
15b911f615 Bluetooth: Added support for HFP 1.6 Wide Band Speech
Signed-off-by: Kun Han Kim <kunhank@codeaurora.org>
2011-10-03 16:18:52 -07:00
Brian Gix
a68668b4e3 Bluetooth: Add LE SecMgr and mgmtops support
Enabled ECB Block encoding for Low Energy pairing
Implemented missing components of MGMTOPS interface
Differentiated as needed between BR/EDR pairing and LE pairing

Signed-off-by: Brian Gix <bgix@codeaurora.org>

Conflicts:

	net/bluetooth/mgmt.c
2011-10-03 16:18:51 -07:00
Brian Gix
bc1f0e4bff Bluetooth: Fix Init Link Policy
Redundant calls to hci_setup_event_mask() prematurly exited Init state
when first call when erroneously detected as the last cmd sent.

CRs-fixed: 302804

Signed-off-by: Brian Gix <bgix@codeaurora.org>
2011-10-03 16:18:32 -07:00
Srinivas Krovvidi
85aab23108 Bluetooth: Changes to handle cfm cb only after dlc is linked to session.
CRs-Fixed: 304043
Signed-off-by: Srinivas Krovvidi <skrovvid@codeaurora.org>
2011-10-03 16:18:19 -07:00
Brian Gix
cfb536b329 Bluetooth: Fix kernel hci_dev_open timeout reset
Handle -EALREADY error in hci_sock of hci_dev_open as indication that
the HCI device is already open. This was causing reset inducing timeout,
and removed unused/useless check of failure in power-up code.

Signed-off-by: Brian Gix <bgix@codeaurora.org>
2011-10-03 16:18:15 -07:00
Mallikarjuna GB
2da40bfbf2 Bluetooth : RFCOMM Frame size change
RFCOMM Frame size changes to accomodate the credits in the data packet.
Earlier implementation was not considering the 1 Byte required for
Credits information in data packet and hence was considering the
RFCOMM header plus FCS as 5 Bytes.
Because of this if the remote device sends a data packet with
negotiated frame size and credits information,packet size exceeds L2CAPMTU
and will be discarded by L2CAP.

CRs-fixed: 303518

Signed-off-by: Mallikarjuna GB <gbmalli@codeaurora.org>
2011-10-03 16:18:13 -07:00
Brian Gix
842bc5e174 Bluetooth: Fix size of data for LTK Randomizer
Signed-off-by: Brian Gix <bgix@codeaurora.org>
2011-10-03 16:18:05 -07:00
Prabhakaran Mc
6001a71683 Bluetooth: SAP Authentication changes
SAP profile requires 16 pin length authentication for BT 1.2/2.0
devices as per specification. These changes were present for hciops
pluging, the current changes are for Management operations plugin.

Signed-off-by: Prabhakaran Mc <prabhakaranmc@codeaurora.org>
2011-10-03 16:18:03 -07:00
Inga Stotland
bd6a49a2a0 Bluetooth: Handle disconnect for LE links.
Additional check whether the disconnect request is
coming on LE link.

Signed-off-by: Inga Stotland <ingas@codeaurora.org>
2011-10-03 16:17:15 -07:00
Mat Martineau
f058a44078 Bluetooth: Revert "Bluetooth: Increase AUTO_OFF timeout for HCI devices"
This reverts commit 24fac10d7e110035f61cf4bd69018adc84f15fc1.

Signed-off-by: Mat Martineau <mathewm@codeaurora.org>
2011-10-03 16:16:52 -07:00
Mat Martineau
c78ee412f7 Bluetooth: Increase AUTO_OFF timeout for HCI devices
The previous timeout (2 seconds) was too short for use with the 8960.
New timeout is 20 seconds.

Signed-off-by: Mat Martineau <mathewm@codeaurora.org>
2011-10-03 16:16:40 -07:00
Jouni Malinen
508ed74454 cfg80211: Fix validation of AKM suites
commit 1b9ca0272ffae212e726380f66777b30a56ed7a5 upstream.

Incorrect variable was used in validating the akm_suites array from
NL80211_ATTR_AKM_SUITES. In addition, there was no explicit
validation of the array length (we only have room for
NL80211_MAX_NR_AKM_SUITES).

This can result in a buffer write overflow for stack variables with
arbitrary data from user space. The nl80211 commands using the affected
functionality require GENL_ADMIN_PERM, so this is only exposed to admin
users.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-03 11:41:10 -07:00
Oliver Neukum
8341e503c2 Bluetooth: Fix timeout on scanning for the second time
commit 2d20a26a92f72e3bb658fe8ce99c3663756e9e7a upstream.

The checks for HCI_INQUIRY and HCI_MGMT were in the wrong order,
so that second scans always failed.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-03 11:41:01 -07:00
Eric Dumazet
af67433576 bridge: fix a possible use after free
[ Upstream commit 22df13319d1fec30b8f9bcaadc295829647109bb ]

br_multicast_ipv6_rcv() can call pskb_trim_rcsum() and therefore skb
head can be reallocated.

Cache icmp6_type field instead of dereferencing twice the struct
icmp6hdr pointer.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-03 11:40:56 -07:00
Yan, Zheng
42270cd40b bridge: Pseudo-header required for the checksum of ICMPv6
[ Upstream commit 4b275d7efa1c4412f0d572fcd7f78ed0919370b3 ]

Checksum of ICMPv6 is not properly computed because the pseudo header is not used.
Thus, the MLD packet gets dropped by the bridge.

Signed-off-by: Zheng Yan <zheng.z.yan@intel.com>
Reported-by: Ang Way Chuang <wcang@sfc.wide.ad.jp>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-03 11:40:56 -07:00
Steffen Klassert
23b576bfe4 xfrm: Perform a replay check after return from async codepaths
[ Upstream commit bcf66bf54aabffc150acd1c99e0f4bc51935eada ]

When asyncronous crypto algorithms are used, there might be many
packets that passed the xfrm replay check, but the replay advance
function is not called yet for these packets. So the replay check
function would accept a replay of all of these packets. Also the
system might crash if there are more packets in async processing
than the size of the anti replay window, because the replay advance
function would try to update the replay window beyond the bounds.

This pach adds a second replay check after resuming from the async
processing to fix these issues.

Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-03 11:40:55 -07:00
Jiri Pirko
b082a5631a vlan: reset headers on accel emulation path
[ Upstream commit c5114cd59d2664f258b0d021d79b1532d94bdc2b ]

It's after all necessary to do reset headers here. The reason is we
cannot depend that it gets reseted in __netif_receive_skb once skb is
reinjected. For incoming vlanids without vlan_dev, vlan_do_receive()
returns false with skb != NULL and __netif_reveive_skb continues, skb is
not reinjected.

This might be good material for 3.0-stable as well

Reported-by: Mike Auty <mike.auty@gmail.com>
Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-03 11:40:55 -07:00
Mike Waychison
bc4c1bd0d9 tcp: initialize variable ecn_ok in syncookies path
[ Upstream commit f0e3d0689da401f7d1981c2777a714ba295ea5ff ]

Using a gcc 4.4.3, warnings are emitted for a possibly uninitialized use
of ecn_ok.

This can happen if cookie_check_timestamp() returns due to not having
seen a timestamp.  Defaulting to ecn off seems like a reasonable thing
to do in this case, so initialized ecn_ok to false.

Signed-off-by: Mike Waychison <mikew@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-03 11:40:54 -07:00