diff mbox series

[v1] Bluetooth: hci_conn: Use disable_delayed_work_sync

Message ID 20241001165055.3111289-1-luiz.dentz@gmail.com (mailing list archive)
State Accepted
Commit 6774cca543da1248a24bf8ae6b8c5a424e6293ec
Headers show
Series [v1] Bluetooth: hci_conn: Use disable_delayed_work_sync | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
tedd_an/CheckPatch warning WARNING: 'Closes:' should be followed by a public http(s) link #97: Closes: Reported-by: syzbot+2446dd3cb07277388db6@syzkaller.appspotmail.com WARNING: The commit message has 'syzkaller', perhaps it also needs a 'Fixes:' tag? total: 0 errors, 2 warnings, 0 checks, 12 lines checked NOTE: For some of the reported defects, checkpatch may be able to mechanically convert to the typical style using --fix or --fix-inplace. /github/workspace/src/src/13818553.patch has style problems, please review. NOTE: Ignored message types: UNKNOWN_COMMIT_ID NOTE: If any of the errors are false positives, please report them to the maintainer, see CHECKPATCH in MAINTAINERS.
tedd_an/GitLint success Gitlint PASS
tedd_an/SubjectPrefix success Gitlint PASS
tedd_an/BuildKernel success BuildKernel PASS
tedd_an/CheckAllWarning success CheckAllWarning PASS
tedd_an/CheckSparse success CheckSparse PASS

Commit Message

Luiz Augusto von Dentz Oct. 1, 2024, 4:50 p.m. UTC
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

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@syzkaller.appspotmail.com
Closes: Reported-by: syzbot+2446dd3cb07277388db6@syzkaller.appspotmail.com
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
---
 net/bluetooth/hci_conn.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Luiz Augusto von Dentz Oct. 1, 2024, 4:56 p.m. UTC | #1
On Tue, Oct 1, 2024 at 12:50 PM Luiz Augusto von Dentz
<luiz.dentz@gmail.com> wrote:
>
> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
>
> 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@syzkaller.appspotmail.com
> Closes: Reported-by: syzbot+2446dd3cb07277388db6@syzkaller.appspotmail.com
> Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> ---
>  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
syzbot Oct. 1, 2024, 5:22 p.m. UTC | #2
Hello,

syzbot has tested the proposed patch and the reproducer did not trigger any issue:

Reported-by: syzbot+2446dd3cb07277388db6@syzkaller.appspotmail.com
Tested-by: syzbot+2446dd3cb07277388db6@syzkaller.appspotmail.com

Tested on:

commit:         e32cde8d Merge tag 'sched_ext-for-6.12-rc1-fixes-1' of..
git tree:       upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=14d28927980000
kernel config:  https://syzkaller.appspot.com/x/.config?x=3fccdad3e2ebaa0c
dashboard link: https://syzkaller.appspot.com/bug?extid=2446dd3cb07277388db6
compiler:       gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40
patch:          https://syzkaller.appspot.com/x/patch.diff?x=14060307980000

Note: testing is done by a robot and is best-effort only.
patchwork-bot+bluetooth@kernel.org Oct. 1, 2024, 7:50 p.m. UTC | #3
Hello:

This patch was applied to bluetooth/bluetooth-next.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:

On Tue,  1 Oct 2024 12:50:55 -0400 you wrote:
> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> 
> 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.
> 
> [...]

Here is the summary with links:
  - [v1] Bluetooth: hci_conn: Use disable_delayed_work_sync
    https://git.kernel.org/bluetooth/bluetooth-next/c/6774cca543da

You are awesome, thank you!
diff mbox series

Patch

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 */