diff options
| author | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2024-10-22 12:31:08 -0400 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-11-01 01:58:30 +0100 |
| commit | d30803f6a972b5b9e26d1d43b583c7ec151de04b (patch) | |
| tree | ef56fdd28dbb20cb13739f786e363d9089bb48a3 /include | |
| parent | 1ba33b327c3f88a7baee598979d73ab5b44d41cc (diff) | |
| download | linux-d30803f6a972b5b9e26d1d43b583c7ec151de04b.tar.gz linux-d30803f6a972b5b9e26d1d43b583c7ec151de04b.tar.bz2 linux-d30803f6a972b5b9e26d1d43b583c7ec151de04b.zip | |
Bluetooth: SCO: Fix UAF on sco_sock_timeout
[ Upstream commit 1bf4470a3939c678fb822073e9ea77a0560bc6bb ]
conn->sk maybe have been unlinked/freed while waiting for sco_conn_lock
so this checks if the conn->sk is still valid by checking if it part of
sco_sk_list.
Reported-by: syzbot+4c0d0c4cde787116d465@syzkaller.appspotmail.com
Tested-by: syzbot+4c0d0c4cde787116d465@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=4c0d0c4cde787116d465
Fixes: ba316be1b6a0 ("Bluetooth: schedule SCO timeouts with delayed_work")
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'include')
| -rw-r--r-- | include/net/bluetooth/bluetooth.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h index e4a6831133f8..4763a47bf8c8 100644 --- a/include/net/bluetooth/bluetooth.h +++ b/include/net/bluetooth/bluetooth.h @@ -403,6 +403,7 @@ int bt_sock_register(int proto, const struct net_proto_family *ops); void bt_sock_unregister(int proto); void bt_sock_link(struct bt_sock_list *l, struct sock *s); void bt_sock_unlink(struct bt_sock_list *l, struct sock *s); +bool bt_sock_linked(struct bt_sock_list *l, struct sock *s); struct sock *bt_sock_alloc(struct net *net, struct socket *sock, struct proto *prot, int proto, gfp_t prio, int kern); int bt_sock_recvmsg(struct socket *sock, struct msghdr *msg, size_t len, |
