mirror_ubuntu-kernels/net/bluetooth
Andrei Emeltchenko d37f50e190 Bluetooth: fix crash by disabling tasklet in sock accept
Crash can happen when tasklet handling connect/disconnect requests
preempts socket accept. Can be reproduced with "l2test -r" on one
side and several "l2test -c -b 1000 -i hci0 -P 10 <bdaddr>" on the
other side.

disable taskets in socket accept and change lock_sock and release_sock
to bh_lock_sock and bh_unlock_sock since we have to use spinlocks and
there is no need to mark sock as owned by user.

...
[ 3555.897247] Unable to handle kernel NULL pointer dereference at virtual
address 000000bc
[ 3555.915039] pgd = cab9c000
[ 3555.917785] [000000bc] *pgd=8bf3d031, *pte=00000000, *ppte=00000000
[ 3555.928314] Internal error: Oops: 17 [#1] PREEMPT
[ 3555.999786] CPU: 0    Not tainted  (2.6.32.21-13874-g67918ef #65)
...
[ 3556.005981] PC is at bt_accept_unlink+0x20/0x58 [bluetooth]
[ 3556.011627] LR is at bt_accept_dequeue+0x3c/0xe8 [bluetooth]
...
[ 3556.161285] [<bf0007fc>] (bt_accept_unlink+0x20/0x58 [bluetooth]) from
[<bf000870>] (bt_accept_dequeue+0x3c/0xe8 [bluetooth])
[ 3556.172729] [<bf000870>] (bt_accept_dequeue+0x3c/0xe8 [bluetooth]) from
[<bf324df8>] (l2cap_sock_accept+0x100/0x15c [l2cap])
[ 3556.184082] [<bf324df8>] (l2cap_sock_accept+0x100/0x15c [l2cap]) from
[<c026a0a8>] (sys_accept4+0x120/0x1e0)
[ 3556.193969] [<c026a0a8>] (sys_accept4+0x120/0x1e0) from [<c002c9a0>]
(ret_fast_syscall+0x0/0x2c)
[ 3556.202819] Code: e5813000 e5901164 e580c160 e580c15c (e1d13bbc)
...

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@nokia.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-02-08 01:40:08 -02:00
..
bnep Bluetooth: bnep: fix information leak to userland 2010-12-01 21:04:35 -02:00
cmtp Bluetooth: Do not use assignments in IF conditions 2011-02-08 01:40:08 -02:00
hidp Bluetooth: Do not use assignments in IF conditions 2011-02-08 01:40:08 -02:00
rfcomm Bluetooth: Never deallocate a session when some DLC points to it 2011-01-19 14:40:42 -02:00
af_bluetooth.c Bluetooth: fix crash by disabling tasklet in sock accept 2011-02-08 01:40:08 -02:00
hci_conn.c Bluetooth: Add set_io_capability management command 2011-02-08 01:40:08 -02:00
hci_core.c Bluetooth: Do not use assignments in IF conditions 2011-02-08 01:40:08 -02:00
hci_event.c Bluetooth: Do not use assignments in IF conditions 2011-02-08 01:40:08 -02:00
hci_sock.c Bluetooth: Add support for set_powered management command 2011-02-08 01:40:04 -02:00
hci_sysfs.c Bluetooth: Implement debugfs support for listing UUIDs 2011-02-08 01:40:06 -02:00
Kconfig Bluetooth: Remove L2CAP Extended Features from Kconfig 2010-07-21 10:39:04 -07:00
l2cap.c Bluetooth: Do not use assignments in IF conditions 2011-02-08 01:40:08 -02:00
lib.c Bluetooth: make batostr() print in the right order 2010-10-12 12:44:52 -03:00
Makefile Bluetooth: Add initial Bluetooth Management interface callbacks 2010-12-07 23:03:38 -02:00
mgmt.c Bluetooth: Add set_io_capability management command 2011-02-08 01:40:08 -02:00
sco.c Bluetooth: clean up sco code 2010-12-01 21:04:43 -02:00