提交 127074bf 编写于 作者: U Ulisses Furquim 提交者: Johan Hedberg

Bluetooth: Fix possible use after free in delete path

We need to use the _sync() version for cancelling the info and security
timer in the L2CAP connection delete path. Otherwise the delayed work
handler might run after the connection object is freed.
Signed-off-by: NUlisses Furquim <ulisses@profusion.mobi>
Acked-by: NMarcel Holtmann <marcel@holtmann.org>
Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
上级 17cd3f37
...@@ -1016,10 +1016,10 @@ static void l2cap_conn_del(struct hci_conn *hcon, int err) ...@@ -1016,10 +1016,10 @@ static void l2cap_conn_del(struct hci_conn *hcon, int err)
hci_chan_del(conn->hchan); hci_chan_del(conn->hchan);
if (conn->info_state & L2CAP_INFO_FEAT_MASK_REQ_SENT) if (conn->info_state & L2CAP_INFO_FEAT_MASK_REQ_SENT)
__cancel_delayed_work(&conn->info_timer); cancel_delayed_work_sync(&conn->info_timer);
if (test_and_clear_bit(HCI_CONN_LE_SMP_PEND, &hcon->flags)) { if (test_and_clear_bit(HCI_CONN_LE_SMP_PEND, &hcon->flags)) {
__cancel_delayed_work(&conn->security_timer); cancel_delayed_work_sync(&conn->security_timer);
smp_chan_destroy(conn); smp_chan_destroy(conn);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册