remarkable-linux/net/bluetooth
Gustavo F. Padovan dfc909befb Bluetooth: Fix race condition on l2cap_ertm_send()
l2cap_ertm_send() can be called both from user context and bottom half
context. The socket locks for that contexts are different, the user
context uses a mutex(which can sleep) and the second one uses a
spinlock_bh. That creates a race condition when we have interruptions on
both contexts at the same time.

The better way to solve this is to add a new spinlock to lock
l2cap_ertm_send() and the vars it access. The other solution was to defer
l2cap_ertm_send() with a workqueue, but we the sending process already
has one defer on the hci layer. It's not a good idea add another one.

The patch refactor the code to create l2cap_retransmit_frames(), then we
encapulate the lock of l2cap_ertm_send() for some call. It also changes
l2cap_retransmit_frame() to l2cap_retransmit_one_frame() to avoid
confusion

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Reviewed-by: João Paulo Rechi Vita <jprvita@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2010-05-10 09:28:53 +02:00
..
bnep net: sk_sleep() helper 2010-04-20 16:37:13 -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 net: sk_sleep() helper 2010-04-20 16:37:13 -07:00
af_bluetooth.c net: sk_sleep() helper 2010-04-20 16:37:13 -07:00
hci_conn.c Bluetooth: Enter active mode before establishing a SCO link. 2010-02-03 19:10:59 -08:00
hci_core.c Bluetooth: Make hci_send_acl() void 2010-05-10 09:28:52 +02:00
hci_event.c Bluetooth: Add SCO fallback for unsupported feature error 2010-02-27 14:06:00 +01:00
hci_sock.c Bluetooth: Fix out of scope variable access in hci_sock_cmsg() 2010-02-28 00:47:30 -08:00
hci_sysfs.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
Kconfig Bluetooth: Add Kconfig option for L2CAP Extended Features 2010-05-10 09:28:51 +02:00
l2cap.c Bluetooth: Fix race condition on l2cap_ertm_send() 2010-05-10 09:28:53 +02:00
lib.c
Makefile
sco.c Bluetooth: Trivial clean ups to SCO 2010-05-10 09:28:45 +02:00