zephyr/subsys/bluetooth/host
Aleksander Wasaznik 30098c881f Bluetooth: Host: Detect deadlock in bt_att_req_alloc
`gatt_req_alloc` will wait until a `req` is free (or until timeout).
`req`s are freed on the BT RX thread in calls into bt_att_recv.

When `gatt_req_alloc` called on the BT RX thread itself when there are
no free `req`s, it will block the BT RX thread and deadlock. The
deadlock lasts until timeout.

This change detects this condition and returns the failure early.

Fixes https://github.com/zephyrproject-rtos/zephyr/issues/39624 where
if `bt_gatt_write` is called from BT RX thread (as can happen if it is
called from a bluetooth callback), the BT RX thread can be blocked and
prevented from processing the request responses and unblocking itself.
This was the cause of a soft 30s deadlock until gatt_req_alloc timeouts.

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2022-01-27 16:04:24 +01:00
..
a2dp_internal.h
a2dp.c
addr.c
adv.c Bluetooth: Host: Support setting long periodic adv data 2022-01-13 13:23:29 +01:00
adv.h Bluetooth: host: Cancel limited adv timeout when advertising stopped 2021-08-30 14:41:20 +02:00
aes_ccm.c Bluetooth: host: Fix MIC generation in Bluetooth CCM encryption 2021-11-08 11:00:33 -05:00
at.c
at.h
att_internal.h Bluetooth: Host: Fix type mismatch in bt_gatt_cancel 2022-01-07 12:48:52 -05:00
att.c Bluetooth: Host: Detect deadlock in bt_att_req_alloc 2022-01-27 16:04:24 +01:00
avdtp_internal.h
avdtp.c
br.c Bluetooth: hci: Align terms with the Bluetooth v5.3 spec 2021-09-17 16:05:01 +02:00
br.h
buf.c Bluetooth: buf: Update BT_BUF_RX_SIZE with ISO 2021-12-09 12:38:12 -05:00
CMakeLists.txt Bluetooth: Update terms in public API to spec v5.3 2021-09-15 14:02:50 +03:00
conn_internal.h Bluetooth: ISO: Add ISO channel type 2022-01-18 13:19:47 -05:00
conn.c Bluetooth: host: df: Add missing bt_conn_unref 2022-01-21 09:30:23 -05:00
crypto.c
crypto.h
direction_internal.h Bluetooth: host: df: Add handling of HCI_LE_CTE_Request_Failed 2022-01-21 09:30:23 -05:00
direction.c Bluetooth: host: df: Add handling of HCI_LE_CTE_Request_Failed 2022-01-21 09:30:23 -05:00
ecc.c bluetooth: Add defines for ECC key lengths 2021-08-09 16:45:57 +02:00
ecc.h bluetooth: Add defines for ECC key lengths 2021-08-09 16:45:57 +02:00
gatt_internal.h
gatt.c Bluetooth: Host: Handle req alloc failure in bt_gatt_unsubscribe 2022-01-27 16:04:24 +01:00
hci_common.c
hci_core.c Bluetooth: Host: Detect deadlock in bt_att_req_alloc 2022-01-27 16:04:24 +01:00
hci_core.h Bluetooth: Host: Detect deadlock in bt_att_req_alloc 2022-01-27 16:04:24 +01:00
hci_ecc.c bluetooth: Add defines for ECC key lengths 2021-08-09 16:45:57 +02:00
hci_ecc.h
hci_raw_internal.h
hci_raw.c bluetooth: hci_raw: avoid possible memory overflow in bt_buf_get_tx() 2022-01-26 11:54:31 +01:00
hfp_hf.c net: buf: POOL_FIXED_DEFINE explicit user data 2021-11-24 16:04:50 +02:00
hfp_internal.h
id.c Bluetooth: host: Access local IRKs consistently 2021-09-29 10:44:38 -04:00
id.h
iso_internal.h Bluetooth: ISO: Add CIG state machine 2021-11-15 14:39:59 -05:00
iso.c Bluetooth: ISO: Fix missing ISO type for peripheral ISO 2022-01-21 15:46:01 +02:00
Kconfig Bluetooth: Host: Reassemble extended advertising reports 2022-01-07 15:35:39 +02:00
Kconfig.gatt kconfig: bluetooth: experimental settings now uses select EXPERIMENTAL 2021-10-22 13:59:21 +02:00
Kconfig.l2cap Bluetooth: Audio: Media control - set L2CAP buffers 2021-12-15 14:59:55 -05:00
keys_br.c
keys.c Bluetooth: Fix build error for printing LTK 2021-12-13 17:21:24 -05:00
keys.h Bluetooth: host: Align with terms in v5.3 spec 2021-09-20 20:01:32 +02:00
l2cap_br.c net: buf: POOL_FIXED_DEFINE explicit user data 2021-11-24 16:04:50 +02:00
l2cap_internal.h Bluetooth: Disconnect L2CAP channel if peer sent too much data 2021-11-09 19:58:42 -05:00
l2cap.c bluetooth: l2cap: receive server error status 2022-01-05 14:42:33 +01:00
monitor.c logging: Deprecate v1, default to v2 2022-01-17 15:49:10 -05:00
monitor.h
rfcomm_internal.h
rfcomm.c
scan.c Bluetooth: Host: Reset scan state on scan stop 2022-01-07 15:35:39 +02:00
scan.h
sdp_internal.h
sdp.c net: buf: POOL_FIXED_DEFINE explicit user data 2021-11-24 16:04:50 +02:00
settings.c Bluetooth: host: check return value of bt_rand when creating identities 2021-09-27 17:14:20 +02:00
settings.h
smp_null.c
smp.c bluetooth: host: Add support for SMP error code 0x0f 2021-11-01 21:48:52 -04:00
smp.h bluetooth: host: Add support for SMP error code 0x0f 2021-11-01 21:48:52 -04:00
ssp.c
ssp.h
testing.c
testing.h
uuid.c