[PW_SID:1079703] Bluetooth: hci_event: reject incoming conn request when MASTER conn exists#62
[PW_SID:1079703] Bluetooth: hci_event: reject incoming conn request when MASTER conn exists#62BluezTestBot wants to merge 1 commit intoworkflowfrom
Conversation
…xists
hci_conn_request_evt() reuses an existing connection without checking
its role. When the existing connection has the MASTER role (outgoing
connection in progress), conn->state is incorrectly overwritten from
BT_CONNECTED or BT_OPEN to BT_CONNECT, causing state machine corruption.
This can lead to use-after-free or state confusion when the connection
is later disconnected.
The issue was observed during VHCI testing:
Thread 1: Local connect() -> conn created (role=MASTER, state=BT_OPEN)
Thread 2: Remote Connection Request received
-> hci_conn_hash_lookup_ba() finds existing MASTER conn
-> conn->state overwritten to BT_CONNECT (no role check!)
Fix by rejecting incoming connection requests when a MASTER connection
to the same address already exists.
Fixes: 70c4642 ("Bluetooth: Refactor connection request handling")
Signed-off-by: SeungJu Cheon <suunj1331@gmail.com>
|
CheckPatch |
|
GitLint |
|
SubjectPrefix |
|
BuildKernel |
|
CheckAllWarning |
|
CheckSparse |
|
BuildKernel32 |
|
TestRunnerSetup |
|
TestRunner_l2cap-tester |
|
TestRunner_iso-tester |
|
TestRunner_bnep-tester |
|
TestRunner_mgmt-tester |
|
TestRunner_rfcomm-tester |
|
TestRunner_sco-tester |
|
TestRunner_ioctl-tester |
|
TestRunner_mesh-tester |
|
TestRunner_smp-tester |
|
TestRunner_userchan-tester |
|
TestRunner_6lowpan-tester |
|
IncrementalBuild |
hci_conn_request_evt() reuses an existing connection without checking
its role. When the existing connection has the MASTER role (outgoing
connection in progress), conn->state is incorrectly overwritten from
BT_CONNECTED or BT_OPEN to BT_CONNECT, causing state machine corruption.
This can lead to use-after-free or state confusion when the connection
is later disconnected.
The issue was observed during VHCI testing:
Thread 1: Local connect() -> conn created (role=MASTER, state=BT_OPEN)
Thread 2: Remote Connection Request received
-> hci_conn_hash_lookup_ba() finds existing MASTER conn
-> conn->state overwritten to BT_CONNECT (no role check!)
Fix by rejecting incoming connection requests when a MASTER connection
to the same address already exists.
Fixes: 70c4642 ("Bluetooth: Refactor connection request handling")
Signed-off-by: SeungJu Cheon suunj1331@gmail.com
net/bluetooth/hci_event.c | 6 ++++++
1 file changed, 6 insertions(+)