Siddh Raman Pant b4066eb04b Bluetooth: hci_conn: return ERR_PTR instead of NULL when there is no link
hci_connect_sco currently returns NULL when there is no link (i.e. when
hci_conn_link() returns NULL).

sco_connect() expects an ERR_PTR in case of any error (see line 266 in
sco.c). Thus, hcon set as NULL passes through to sco_conn_add(), which
tries to get hcon->hdev, resulting in dereferencing a NULL pointer as
reported by syzkaller.

The same issue exists for iso_connect_cis() calling hci_connect_cis().

Thus, make hci_connect_sco() and hci_connect_cis() return ERR_PTR
instead of NULL.

Reported-and-tested-by: syzbot+37acd5d80d00d609d233@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=37acd5d80d00d609d233
Fixes: 06149746e720 ("Bluetooth: hci_conn: Add support for linking multiple hcon")
Signed-off-by: Siddh Raman Pant <code@siddh.me>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2023-07-20 11:26:56 -07:00
..
2023-05-05 19:12:01 -07:00
2023-05-31 13:06:57 +02:00
2023-07-17 09:46:26 +02:00
2023-07-12 18:13:57 -07:00
2023-03-16 17:34:40 -07:00
2023-07-03 11:26:05 -07:00
2023-06-24 15:41:46 -07:00
2023-07-06 11:02:58 +02:00
2023-06-28 16:43:10 -07:00
2023-06-28 16:43:10 -07:00
2023-07-01 14:38:25 -07:00
2023-06-24 15:50:13 -07:00
2023-07-04 10:19:48 +02:00
2023-06-28 16:43:10 -07:00