Re: [PATCH v1] Bluetooth: hci_conn: Use disable_delayed_work_sync

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Oct 1, 2024 at 12:50 PM Luiz Augusto von Dentz
<luiz.dentz@xxxxxxxxx> wrote:
>
> From: Luiz Augusto von Dentz <luiz.von.dentz@xxxxxxxxx>
>
> This makes use of disable_delayed_work_sync instead
> cancel_delayed_work_sync as it not only cancel the ongoing work but also
> disables new submit which is disarable since the object holding the work
> is about to be freed.
>
> Reported-by: syzbot+2446dd3cb07277388db6@xxxxxxxxxxxxxxxxxxxxxxxxx
> Closes: Reported-by: syzbot+2446dd3cb07277388db6@xxxxxxxxxxxxxxxxxxxxxxxxx
> Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@xxxxxxxxx>
> ---
>  net/bluetooth/hci_conn.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
> index 0c01ece500a9..fb0946eac8a4 100644
> --- a/net/bluetooth/hci_conn.c
> +++ b/net/bluetooth/hci_conn.c
> @@ -1124,9 +1124,9 @@ void hci_conn_del(struct hci_conn *conn)
>
>         hci_conn_unlink(conn);
>
> -       cancel_delayed_work_sync(&conn->disc_work);
> -       cancel_delayed_work_sync(&conn->auto_accept_work);
> -       cancel_delayed_work_sync(&conn->idle_work);
> +       disable_delayed_work_sync(&conn->disc_work);
> +       disable_delayed_work_sync(&conn->auto_accept_work);
> +       disable_delayed_work_sync(&conn->idle_work);
>
>         if (conn->type == ACL_LINK) {
>                 /* Unacked frames */
> --
> 2.46.1
>

#syz test

-- 
Luiz Augusto von Dentz
From db0befd94b95e2607b950b09707a422622e27f59 Mon Sep 17 00:00:00 2001
From: Luiz Augusto von Dentz <luiz.von.dentz@xxxxxxxxx>
Date: Tue, 1 Oct 2024 12:34:06 -0400
Subject: [PATCH v1] Bluetooth: hci_conn: Use disable_delayed_work_sync

This makes use of disable_delayed_work_sync instead
cancel_delayed_work_sync as it not only cancel the ongoing work but also
disables new submit which is disarable since the object holding the work
is about to be freed.

Reported-by: syzbot+2446dd3cb07277388db6@xxxxxxxxxxxxxxxxxxxxxxxxx
Closes: Reported-by: syzbot+2446dd3cb07277388db6@xxxxxxxxxxxxxxxxxxxxxxxxx
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@xxxxxxxxx>
---
 net/bluetooth/hci_conn.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index 0c01ece500a9..fb0946eac8a4 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -1124,9 +1124,9 @@ void hci_conn_del(struct hci_conn *conn)
 
 	hci_conn_unlink(conn);
 
-	cancel_delayed_work_sync(&conn->disc_work);
-	cancel_delayed_work_sync(&conn->auto_accept_work);
-	cancel_delayed_work_sync(&conn->idle_work);
+	disable_delayed_work_sync(&conn->disc_work);
+	disable_delayed_work_sync(&conn->auto_accept_work);
+	disable_delayed_work_sync(&conn->idle_work);
 
 	if (conn->type == ACL_LINK) {
 		/* Unacked frames */
-- 
2.46.1


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux