Archie Pusaka
2033dde6aa
Bluetooth: check for zapped sk before connecting
...
[ Upstream commit 3af70b39fa2d415dc86c370e5b24ddb9fdacbd6f ]
There is a possibility of receiving a zapped sock on
l2cap_sock_connect(). This could lead to interesting crashes, one
such case is tearing down an already tore l2cap_sock as is happened
with this call trace:
__dump_stack lib/dump_stack.c:15 [inline]
dump_stack+0xc4/0x118 lib/dump_stack.c:56
register_lock_class kernel/locking/lockdep.c:792 [inline]
register_lock_class+0x239/0x6f6 kernel/locking/lockdep.c:742
__lock_acquire+0x209/0x1e27 kernel/locking/lockdep.c:3105
lock_acquire+0x29c/0x2fb kernel/locking/lockdep.c:3599
__raw_spin_lock_bh include/linux/spinlock_api_smp.h:137 [inline]
_raw_spin_lock_bh+0x38/0x47 kernel/locking/spinlock.c:175
spin_lock_bh include/linux/spinlock.h:307 [inline]
lock_sock_nested+0x44/0xfa net/core/sock.c:2518
l2cap_sock_teardown_cb+0x88/0x2fb net/bluetooth/l2cap_sock.c:1345
l2cap_chan_del+0xa3/0x383 net/bluetooth/l2cap_core.c:598
l2cap_chan_close+0x537/0x5dd net/bluetooth/l2cap_core.c:756
l2cap_chan_timeout+0x104/0x17e net/bluetooth/l2cap_core.c:429
process_one_work+0x7e3/0xcb0 kernel/workqueue.c:2064
worker_thread+0x5a5/0x773 kernel/workqueue.c:2196
kthread+0x291/0x2a6 kernel/kthread.c:211
ret_from_fork+0x4e/0x80 arch/x86/entry/entry_64.S:604
Signed-off-by: Archie Pusaka <apusaka@chromium.org>
Reported-by: syzbot+abfc0f5e668d4099af73@syzkaller.appspotmail.com
Reviewed-by: Alain Michaud <alainm@chromium.org>
Reviewed-by: Abhishek Pandit-Subedi <abhishekpandit@chromium.org>
Reviewed-by: Guenter Roeck <groeck@chromium.org>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-05-19 10:12:53 +02:00
..
2021-04-07 15:00:08 +02:00
2021-01-17 14:16:55 +01:00
2021-04-07 15:00:08 +02:00
2020-10-31 12:26:30 -07:00
2021-04-14 08:41:59 +02:00
2021-05-19 10:12:53 +02:00
2021-01-27 11:55:07 +01:00
2020-10-15 12:33:24 -07:00
2021-05-19 10:12:53 +02:00
2020-09-05 15:57:05 -07:00
2021-04-14 08:42:07 +02:00
2020-10-12 15:29:27 +02:00
2021-05-14 09:50:40 +02:00
2021-01-23 16:04:01 +01:00
2021-03-30 14:32:01 +02:00
2021-04-14 08:42:07 +02:00
2021-04-21 13:00:57 +02:00
2021-04-14 08:42:02 +02:00
2021-04-21 13:00:53 +02:00
2021-05-14 09:50:46 +02:00
2021-05-14 09:50:44 +02:00
2021-03-07 12:34:05 +01:00
2021-02-13 13:55:02 +01:00
2021-03-17 17:06:11 +01:00
2020-08-27 07:55:59 -07:00
2021-02-10 09:29:14 +01:00
2021-05-14 09:50:34 +02:00
2021-04-14 08:42:13 +02:00
2021-03-17 17:06:11 +01:00
2021-04-14 08:42:09 +02:00
2021-04-14 08:42:08 +02:00
2021-05-14 09:50:40 +02:00
2021-03-17 17:06:15 +01:00
2020-10-09 20:22:32 -07:00
2021-05-14 09:50:44 +02:00
2021-05-11 14:47:34 +02:00
2021-05-14 09:50:38 +02:00
2021-03-07 12:34:07 +01:00
2021-05-07 11:04:31 +02:00
2021-04-14 08:42:09 +02:00
2020-11-12 09:18:06 +01:00
2020-11-20 10:04:58 -08:00
2021-02-17 11:02:28 +01:00
2021-05-19 10:12:53 +02:00
2021-05-14 09:50:46 +02:00
2020-11-19 10:59:19 -08:00
2021-04-07 15:00:04 +02:00
2021-02-07 15:37:12 +01:00
2021-05-19 10:12:52 +02:00
2021-02-23 15:53:23 +01:00
2020-10-15 18:42:13 -07:00
2021-05-14 09:50:41 +02:00
2020-10-02 19:11:11 -07:00
2021-05-14 09:50:00 +02:00
2020-12-02 17:26:36 -08:00
2021-05-14 09:50:28 +02:00
2021-04-21 13:00:51 +02:00
2020-10-03 00:02:13 -04:00
2020-09-30 18:01:26 -07:00
2020-10-05 18:40:01 -07:00