Commit 48818e14 authored by Jaganath Kanakkassery's avatar Jaganath Kanakkassery Committed by Sasha Levin

Bluetooth: Fix invalid length check in l2cap_information_rsp()

The length check is invalid since the length varies with type of
info response.

This was introduced by the commit cb3b3152

Because of this, l2cap info rsp is not handled and command reject is sent.

> ACL data: handle 11 flags 0x02 dlen 16
        L2CAP(s): Info rsp: type 2 result 0
          Extended feature mask 0x00b8
            Enhanced Retransmission mode
            Streaming mode
            FCS Option
            Fixed Channels
< ACL data: handle 11 flags 0x00 dlen 10
        L2CAP(s): Command rej: reason 0
          Command not understood

Cc: stable@vger.kernel.org
Signed-off-by: default avatarJaganath Kanakkassery <jaganath.k@samsung.com>
Signed-off-by: default avatarChan-Yeol Park <chanyeol.park@samsung.com>
Acked-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
Signed-off-by: default avatarGustavo Padovan <gustavo.padovan@collabora.co.uk>

ath9k_htc: Handle IDLE state transition properly

Make sure that a chip reset is done when IDLE is turned
off - this fixes authentication timeouts.

Cc: stable@vger.kernel.org
Reported-by: default avatarIgnacy Gawedzki <i@lri.fr>
Signed-off-by: default avatarSujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>

ath9k: fix an RCU issue in calling ieee80211_get_tx_rates

ath_txq_schedule is called outside of the drv_tx call, so it needs RCU
protection.
Signed-off-by: default avatarFelix Fietkau <nbd@openwrt.org>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>

Bluetooth: Fix invalid length check in l2cap_information_rsp()

The length check is invalid since the length varies with type of
info response.

This was introduced by the commit cb3b3152

Because of this, l2cap info rsp is not handled and command reject is sent.

> ACL data: handle 11 flags 0x02 dlen 16
        L2CAP(s): Info rsp: type 2 result 0
          Extended feature mask 0x00b8
            Enhanced Retransmission mode
            Streaming mode
            FCS Option
            Fixed Channels
< ACL data: handle 11 flags 0x00 dlen 10
        L2CAP(s): Command rej: reason 0
          Command not understood

Cc: stable@vger.kernel.org
Signed-off-by: default avatarJaganath Kanakkassery <jaganath.k@samsung.com>
Signed-off-by: default avatarChan-Yeol Park <chanyeol.park@samsung.com>
Acked-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
Signed-off-by: default avatarGustavo Padovan <gustavo.padovan@collabora.co.uk>

Merge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211

nl80211: fix attrbuf access race by allocating a separate one

Since my commit 3713b4e3 ("nl80211: allow splitting wiphy
information in dumps"), nl80211_dump_wiphy() uses the global
nl80211_fam.attrbuf for parsing the incoming data. This wouldn't
be a problem if it only did so on the first dump iteration which
is locked against other commands in generic netlink, but due to
space constraints in cb->args (the needed state doesn't fit) I
decided to always parse the original message. That's racy though
since nl80211_fam.attrbuf could be used by some other parsing in
generic netlink concurrently.

For now, fix this by allocating a separate parse buffer (it's a
bit too big for the stack, currently 1448 bytes on 64-bit). For
-next, I'll change the code to parse into the global buffer in
the first round only and then allocate a smaller buffer to keep
the data in cb->args.
Reported-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
Acked-by: default avatarDavid S. Miller <davem@davemloft.net>
Acked-by: default avatarJohn W. Linville <linville@tuxdriver.com>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>

(cherry picked from commit da9910ac
3f6fa3d4)
Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
parent 63c9b9e3
...@@ -4534,11 +4534,8 @@ void l2cap_logical_cfm(struct l2cap_chan *chan, struct hci_chan *hchan, ...@@ -4534,11 +4534,8 @@ void l2cap_logical_cfm(struct l2cap_chan *chan, struct hci_chan *hchan,
{ {
BT_DBG("chan %p, hchan %p, status %d", chan, hchan, status); BT_DBG("chan %p, hchan %p, status %d", chan, hchan, status);
if (status) { if (cmd_len < sizeof(*rsp))
l2cap_logical_fail(chan); return -EPROTO;
__release_logical_link(chan);
return;
}
if (chan->state != BT_CONNECTED) { if (chan->state != BT_CONNECTED) {
/* Ignore logical link if channel is on BR/EDR */ /* Ignore logical link if channel is on BR/EDR */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment