linux-kernel-test/net/bluetooth
Andrei Emeltchenko 8979481328 Bluetooth: check L2CAP length in first ACL fragment
Current Bluetooth code assembles fragments of big L2CAP packets
in l2cap_recv_acldata and then checks allowed L2CAP size in
assemled L2CAP packet (pi->imtu < skb->len).

The patch moves allowed L2CAP size check to the early stage when
we receive the first fragment of L2CAP packet. We do not need to
reserve and keep L2CAP fragments for bad packets.

Updated version after comments from Mat Martineau <mathewm@codeaurora.org>
and Gustavo Padovan <padovan@profusion.mobi>.

Trace below is received when using stress tools sending big
fragmented L2CAP packets.
...
[ 1712.798492] swapper: page allocation failure. order:4, mode:0x4020
[ 1712.804809] [<c0031870>] (unwind_backtrace+0x0/0xdc) from [<c00a1f70>]
(__alloc_pages_nodemask+0x4)
[ 1712.814666] [<c00a1f70>] (__alloc_pages_nodemask+0x47c/0x4d4) from
[<c00a1fd8>] (__get_free_pages+)
[ 1712.824645] [<c00a1fd8>] (__get_free_pages+0x10/0x3c) from [<c026eb5c>]
(__alloc_skb+0x4c/0xfc)
[ 1712.833465] [<c026eb5c>] (__alloc_skb+0x4c/0xfc) from [<bf28c738>]
(l2cap_recv_acldata+0xf0/0x1f8 )
[ 1712.843322] [<bf28c738>] (l2cap_recv_acldata+0xf0/0x1f8 [l2cap]) from
[<bf0094ac>] (hci_rx_task+0x)
...

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@nokia.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2010-10-12 12:44:52 -03:00
..
bnep Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2010-07-07 15:59:38 -07:00
cmtp net: sk_sleep() helper 2010-04-20 16:37:13 -07:00
hidp net: sk_sleep() helper 2010-04-20 16:37:13 -07:00
rfcomm Bluetooth: remove extra newline from debug output 2010-10-12 12:44:51 -03:00
af_bluetooth.c Bluetooth: Add common code for stream-oriented recvmsg() 2010-10-12 12:44:51 -03:00
hci_conn.c Bluetooth: Defer SCO setup if mode change is pending 2010-07-27 12:29:04 -07:00
hci_core.c Bluetooth: Don't clear the blacklist when closing the HCI device 2010-10-12 12:44:52 -03:00
hci_event.c Bluetooth: Defer SCO setup if mode change is pending 2010-07-27 12:29:04 -07:00
hci_sock.c Bluetooth: Use list_head for HCI blacklist head 2010-07-31 16:06:58 -07:00
hci_sysfs.c Bluetooth: HCI devices are either BR/EDR or AMP radios 2010-10-12 12:44:51 -03:00
Kconfig Bluetooth: Remove L2CAP Extended Features from Kconfig 2010-07-21 10:39:04 -07:00
l2cap.c Bluetooth: check L2CAP length in first ACL fragment 2010-10-12 12:44:52 -03:00
lib.c
Makefile
sco.c net: Remove unnecessary returns from void function()s 2010-05-17 23:23:14 -07:00