]> git.karo-electronics.de Git - karo-tx-linux.git/commit
Bluetooth: Fix a redundant and problematic incoming MTU check
authorMat Martineau <mathewm@codeaurora.org>
Wed, 2 May 2012 16:41:59 +0000 (09:41 -0700)
committerGustavo Padovan <gustavo.padovan@collabora.co.uk>
Wed, 16 May 2012 19:13:37 +0000 (16:13 -0300)
commit35c84d76ee52f49fe2635d8cd686b5b658e8d892
tree79704b24e59038ddd3730afefe15791890802e5b
parent85d59726c5c66016a507f1f4a60db8e374dd284d
Bluetooth: Fix a redundant and problematic incoming MTU check

The L2CAP MTU for incoming data is verified differently depending on
the L2CAP mode, so the check is best performed in a mode-specific
context.  Checking the incoming MTU before HCI fragment reassembly is
a layer violation and assumes all bytes after the standard L2CAP
header are L2CAP data.

This approach causes issues with unsegmented ERTM or streaming mode
frames, where there are additional enhanced or extended headers before
the data payload and possible FCS bytes after the data payload.  A
valid frame could be as many as 10 bytes larger than the MTU.

Removing this code is the best fix, because the MTU is checked later
on for all L2CAP data frames (connectionless, basic, ERTM, and
streaming).  This also gets rid of outdated locking (socket instead of
l2cap_chan) and an extra lookup of the channel ID.

Signed-off-by: Mat Martineau <mathewm@codeaurora.org>
Reviewed-by: Ulisses Furquim <ulisses@profusion.mobi>
Signed-off-by: Gustavo Padovan <gustavo@padovan.org>
net/bluetooth/l2cap_core.c