Re: [syzbot] [bluetooth?] KASAN: slab-use-after-free Read in __timer_delete
From: Hillf Danton
Date: Thu Nov 28 2024 - 06:30:24 EST
On Wed, 27 Nov 2024 10:59:25 -0800
> syzbot found the following issue on:
>
> HEAD commit: 2c22dc1ee3a1 Merge tag 'mailbox-v6.13' of git://git.kernel..
> git tree: upstream
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=16143778580000
#syz test
--- x/net/bluetooth/sco.c
+++ y/net/bluetooth/sco.c
@@ -192,7 +192,6 @@ static struct sco_conn *sco_conn_add(str
conn->hcon = hcon;
sco_conn_unlock(conn);
}
- sco_conn_put(conn);
return conn;
}
@@ -201,6 +200,7 @@ static struct sco_conn *sco_conn_add(str
return NULL;
kref_init(&conn->ref);
+ kref_get(&conn->ref);
spin_lock_init(&conn->lock);
INIT_DELAYED_WORK(&conn->timeout_work, sco_sock_timeout);
--