All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 6.1 0/1] Bluetooth: hci_sync: cancel cmd_timer if hci_open failed
@ 2023-01-26 13:36 Fedor Pchelkin
  2023-01-26 13:36 ` [PATCH 6.1 1/1] " Fedor Pchelkin
  2023-01-27  2:07 ` [PATCH 6.1 0/1] " Sasha Levin
  0 siblings, 2 replies; 7+ messages in thread
From: Fedor Pchelkin @ 2023-01-26 13:36 UTC (permalink / raw)
  To: stable, Greg Kroah-Hartman
  Cc: Fedor Pchelkin, Archie Pusaka, Abhishek Pandit-Subedi,
	Marcel Holtmann, Johan Hedberg, Luiz Augusto von Dentz,
	David S. Miller, Jakub Kicinski, linux-bluetooth, netdev,
	linux-kernel, Alexey Khoroshilov, lvc-project

Syzkaller reports use-after-free in hci_cmd_timeout(). The bug was fixed
in the following patch and can be cleanly applied to 6.1 stable tree.

Due to some technical rearrangement, the fix for older stable branches
requires a different patch which I'll send you in another thread.

^ permalink raw reply	[flat|nested] 7+ messages in thread
* [PATCH] Bluetooth: hci_sync: cancel cmd_timer if hci_open failed
@ 2022-10-05  7:09 Archie Pusaka
  2022-10-05  7:35 ` bluez.test.bot
  0 siblings, 1 reply; 7+ messages in thread
From: Archie Pusaka @ 2022-10-05  7:09 UTC (permalink / raw)
  To: linux-bluetooth, Luiz Augusto von Dentz, Marcel Holtmann
  Cc: CrosBT Upstreaming, Archie Pusaka, Abhishek Pandit-Subedi,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Johan Hedberg,
	Paolo Abeni, linux-kernel, netdev

From: Archie Pusaka <apusaka@chromium.org>

If a command is already sent, we take care of freeing it, but we
also need to cancel the timeout as well.

Signed-off-by: Archie Pusaka <apusaka@chromium.org>
Reviewed-by: Abhishek Pandit-Subedi <abhishekpandit@google.com>

---

 net/bluetooth/hci_sync.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c
index 76c3107c9f91..a011065220e4 100644
--- a/net/bluetooth/hci_sync.c
+++ b/net/bluetooth/hci_sync.c
@@ -4696,6 +4696,7 @@ int hci_dev_open_sync(struct hci_dev *hdev)
 			hdev->flush(hdev);
 
 		if (hdev->sent_cmd) {
+			cancel_delayed_work_sync(&hdev->cmd_timer);
 			kfree_skb(hdev->sent_cmd);
 			hdev->sent_cmd = NULL;
 		}
-- 
2.38.0.rc1.362.ged0d419d3c-goog


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-01-27  2:08 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-26 13:36 [PATCH 6.1 0/1] Bluetooth: hci_sync: cancel cmd_timer if hci_open failed Fedor Pchelkin
2023-01-26 13:36 ` [PATCH 6.1 1/1] " Fedor Pchelkin
2023-01-26 13:38   ` [PATCH 4.14/4.19/5.4/5.10/5.15] " Fedor Pchelkin
2023-01-26 13:43     ` Bluetooth: hci_sync: cancel cmd_timer if hci_open failed, RE: [4.14/4.19/5.4/5.10/5.15] " bluez.test.bot
2023-01-26 13:43   ` bluez.test.bot
2023-01-27  2:07 ` [PATCH 6.1 0/1] " Sasha Levin
  -- strict thread matches above, loose matches on Subject: below --
2022-10-05  7:09 [PATCH] " Archie Pusaka
2022-10-05  7:35 ` bluez.test.bot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.