Luiz Augusto von Dentz
ab4eedb790
Bluetooth: L2CAP: Fix corrupted list in hci_chan_del
This fixes the following trace by reworking the locking of l2cap_conn
so instead of only locking when changing the chan_l list this promotes
chan_lock to a general lock of l2cap_conn so whenever it is being held
it would prevents the likes of l2cap_conn_del to run:
list_del corruption, ffff888021297e00->prev is LIST_POISON2 (dead000000000122)
------------[ cut here ]------------
kernel BUG at lib/list_debug.c:61!
Oops: invalid opcode: 0000 [#1] PREEMPT SMP KASAN PTI
CPU: 1 UID: 0 PID: 5896 Comm: syz-executor213 Not tainted 6.14.0-rc1-next-20250204-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 12/27/2024
RIP: 0010:__list_del_entry_valid_or_report+0x12c/0x190 lib/list_debug.c:59
Code: 8c 4c 89 fe 48 89 da e8 32 8c 37 fc 90 0f 0b 48 89 df e8 27 9f 14 fd 48 c7 c7 a0 c0 60 8c 4c 89 fe 48 89 da e8 15 8c 37 fc 90 <0f> 0b 4c 89 e7 e8 0a 9f 14 fd 42 80 3c 2b 00 74 08 4c 89 e7 e8 cb
RSP: 0018:ffffc90003f6f998 EFLAGS: 00010246
RAX: 000000000000004e RBX: dead000000000122 RCX: 01454d423f7fbf00
RDX: 0000000000000000 RSI: 0000000080000000 RDI: 0000000000000000
RBP: dffffc0000000000 R08: ffffffff819f077c R09: 1ffff920007eded0
R10: dffffc0000000000 R11: fffff520007eded1 R12: dead000000000122
R13: dffffc0000000000 R14: ffff8880352248d8 R15: ffff888021297e00
FS: 00007f7ace6686c0(0000) GS:ffff8880b8700000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f7aceeeb1d0 CR3: 000000003527c000 CR4: 00000000003526f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
__list_del_entry_valid include/linux/list.h:124 [inline]
__list_del_entry include/linux/list.h:215 [inline]
list_del_rcu include/linux/rculist.h:168 [inline]
hci_chan_del+0x70/0x1b0 net/bluetooth/hci_conn.c:2858
l2cap_conn_free net/bluetooth/l2cap_core.c:1816 [inline]
kref_put include/linux/kref.h:65 [inline]
l2cap_conn_put+0x70/0xe0 net/bluetooth/l2cap_core.c:1830
l2cap_sock_shutdown+0xa8a/0x1020 net/bluetooth/l2cap_sock.c:1377
l2cap_sock_release+0x79/0x1d0 net/bluetooth/l2cap_sock.c:1416
__sock_release net/socket.c:642 [inline]
sock_close+0xbc/0x240 net/socket.c:1393
__fput+0x3e9/0x9f0 fs/file_table.c:448
task_work_run+0x24f/0x310 kernel/task_work.c:227
ptrace_notify+0x2d2/0x380 kernel/signal.c:2522
ptrace_report_syscall include/linux/ptrace.h:415 [inline]
ptrace_report_syscall_exit include/linux/ptrace.h:477 [inline]
syscall_exit_work+0xc7/0x1d0 kernel/entry/common.c:173
syscall_exit_to_user_mode_prepare kernel/entry/common.c:200 [inline]
__syscall_exit_to_user_mode_work kernel/entry/common.c:205 [inline]
syscall_exit_to_user_mode+0x24a/0x340 kernel/entry/common.c:218
do_syscall_64+0x100/0x230 arch/x86/entry/common.c:89
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f7aceeaf449
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 41 19 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f7ace668218 EFLAGS: 00000246 ORIG_RAX: 000000000000002a
RAX: fffffffffffffffc RBX: 00007f7acef39328 RCX: 00007f7aceeaf449
RDX: 000000000000000e RSI: 0000000020000100 RDI: 0000000000000004
RBP: 00007f7acef39320 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000003
R13: 0000000000000004 R14: 00007f7ace668670 R15: 000000000000000b
</TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:__list_del_entry_valid_or_report+0x12c/0x190 lib/list_debug.c:59
Code: 8c 4c 89 fe 48 89 da e8 32 8c 37 fc 90 0f 0b 48 89 df e8 27 9f 14 fd 48 c7 c7 a0 c0 60 8c 4c 89 fe 48 89 da e8 15 8c 37 fc 90 <0f> 0b 4c 89 e7 e8 0a 9f 14 fd 42 80 3c 2b 00 74 08 4c 89 e7 e8 cb
RSP: 0018:ffffc90003f6f998 EFLAGS: 00010246
RAX: 000000000000004e RBX: dead000000000122 RCX: 01454d423f7fbf00
RDX: 0000000000000000 RSI: 0000000080000000 RDI: 0000000000000000
RBP: dffffc0000000000 R08: ffffffff819f077c R09: 1ffff920007eded0
R10: dffffc0000000000 R11: fffff520007eded1 R12: dead000000000122
R13: dffffc0000000000 R14: ffff8880352248d8 R15: ffff888021297e00
FS: 00007f7ace6686c0(0000) GS:ffff8880b8600000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f7acef05b08 CR3: 000000003527c000 CR4: 00000000003526f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Reported-by: syzbot+10bd8fe6741eedd2be2e@syzkaller.appspotmail.com
Tested-by: syzbot+10bd8fe6741eedd2be2e@syzkaller.appspotmail.com
Fixes: b4f82f9ed4 ("Bluetooth: L2CAP: Fix slab-use-after-free Read in l2cap_send_cmd")
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
2025-02-13 11:15:37 -05:00
..
2024-05-01 18:07:37 +01:00
2025-02-13 11:15:37 -05:00
2024-10-08 15:33:49 -07:00
2024-12-09 14:44:59 -08:00
2024-09-09 13:15:37 -07:00
2024-10-09 13:42:04 +01:00
2025-01-19 16:41:56 +01:00
2024-12-11 20:17:33 -08:00
2024-11-07 10:21:58 +01:00
2025-01-27 14:37:41 -08:00
2024-10-24 16:03:40 +02:00
2024-08-26 09:37:23 -07:00
2024-01-02 12:41:16 +00:00
2020-02-28 14:51:30 +01:00
2024-10-23 11:43:47 +02:00
2025-01-20 12:16:04 -08:00
2019-05-30 11:26:41 -07:00
2023-12-24 15:22:50 +00:00
2024-06-25 11:10:18 +02:00
2024-08-15 17:18:52 -07:00
2022-07-22 12:53:22 +01:00
2023-03-21 21:32:18 -07:00
2025-01-06 15:57:01 -08:00
2022-08-09 22:14:02 -07:00
2021-12-13 12:34:09 +00:00
2024-08-26 09:37:22 -07:00
2024-08-26 09:37:22 -07:00
2024-11-14 11:16:28 +01:00
2024-08-27 13:11:37 -07:00
2021-03-26 17:43:55 +01:00
2025-01-10 18:07:56 -08:00
2024-10-02 17:23:23 -04:00
2022-11-16 11:31:47 +02:00
2025-01-13 15:34:09 +01:00
2024-03-06 21:01:26 +01:00
2024-10-30 15:29:59 +01:00
2024-10-02 17:23:23 -04:00
2020-03-27 19:40:38 -07:00
2021-12-22 15:03:47 -08:00
2022-07-22 12:53:22 +01:00
2023-07-14 20:39:29 -07:00
2022-07-24 18:39:17 -06:00
2023-07-27 17:17:32 -07:00
2022-07-22 12:53:22 +01:00
2023-01-20 09:33:22 +00:00
2025-01-16 13:04:58 -08:00
2025-01-20 11:27:41 -08:00
2023-08-14 08:01:06 +01:00
2023-10-24 13:08:14 -07:00
2025-01-17 20:01:09 -08:00
2024-05-08 10:35:09 +01:00
2019-12-16 16:09:44 -08:00
2024-08-26 09:37:23 -07:00
2024-08-20 15:22:17 -07:00
2024-05-29 17:34:49 -07:00
2024-12-09 14:44:59 -08:00
2024-11-13 18:49:50 -08:00
2024-08-26 09:37:23 -07:00
2022-07-22 12:53:22 +01:00
2024-04-01 21:27:08 -07:00
2022-07-22 12:53:22 +01:00
2021-12-06 16:06:02 -08:00
2024-10-11 15:35:05 -07:00
2024-10-11 15:35:05 -07:00
2022-07-28 22:21:54 -07:00
2024-07-15 09:14:39 -07:00
2024-10-30 17:33:53 -07:00
2023-11-02 09:31:02 +01:00
2023-04-12 16:40:39 -07:00
2022-12-01 15:09:10 +01:00
2023-08-08 15:58:23 -07:00
2022-07-22 12:53:22 +01:00
2021-10-18 12:54:41 +01:00
2024-12-09 14:44:59 -08:00
2022-10-31 10:43:04 +00:00
2024-04-01 10:49:28 +01:00
2024-05-14 10:49:50 -07:00
2023-06-10 00:11:41 -07:00
2024-05-07 01:35:55 +02:00
2022-07-22 12:53:22 +01:00
2023-07-28 14:07:59 -07:00
2024-04-30 18:46:52 -07:00
2024-08-26 09:37:23 -07:00
2021-06-28 14:29:45 -07:00
2024-05-08 10:35:09 +01:00
2024-10-25 10:44:41 +01:00
2023-11-20 11:43:03 +01:00
2024-02-26 18:40:34 -08:00
2019-04-22 21:50:53 -07:00
2022-07-22 12:53:22 +01:00
2024-08-05 16:27:26 -07:00
2024-05-13 18:19:09 -06:00
2025-01-04 08:17:23 -08:00
2022-02-07 20:12:45 -08:00
2021-10-15 11:33:08 +01:00
2024-05-23 14:14:23 -07:00
2024-08-05 16:22:45 -07:00
2025-01-06 13:49:38 -08:00
2024-12-11 20:17:33 -08:00
2024-12-17 19:37:00 -08:00
2024-02-28 11:19:41 +00:00
2021-11-16 13:16:54 +00:00
2024-10-11 15:35:05 -07:00
2024-07-14 07:34:16 -07:00
2024-04-01 10:49:28 +01:00
2024-11-12 11:24:50 +01:00
2024-10-31 18:10:07 -07:00
2023-04-22 01:39:41 +02:00
2025-02-06 16:14:14 -08:00
2022-09-29 07:18:00 +02:00
2022-07-22 12:53:22 +01:00
2022-10-31 20:14:27 -07:00
2024-08-05 16:27:26 -07:00
2024-12-09 14:44:59 -08:00
2024-10-09 08:53:01 +02:00
2024-08-19 18:36:12 -07:00
2025-02-10 18:09:09 -08:00
2024-12-06 17:43:08 -08:00
2023-08-04 15:33:17 -07:00
2023-08-04 15:33:17 -07:00
2024-07-15 08:51:01 -07:00
2023-07-20 10:46:28 +02:00
2021-10-13 09:40:46 -07:00
2024-08-26 09:37:23 -07:00
2022-07-22 12:53:22 +01:00
2022-07-22 12:53:22 +01:00
2024-07-15 08:51:19 -07:00
2021-11-07 19:25:29 +00:00
2023-08-18 16:05:26 +02:00
2025-01-13 15:34:09 +01:00
2024-10-02 17:23:23 -04:00
2025-01-20 12:20:42 +00:00
2024-11-09 09:04:54 -08:00
2024-11-09 09:04:54 -08:00
2020-03-02 11:16:27 -08:00
2021-03-26 15:14:56 -07:00
2022-07-22 12:53:22 +01:00
2020-05-29 21:20:20 -07:00
2024-09-11 15:57:50 -07:00
2022-11-18 12:14:55 +00:00
2022-07-22 12:53:22 +01:00
2024-08-12 17:23:57 -07:00
2024-11-09 13:22:57 -08:00
2024-11-09 13:22:57 -08:00
2024-11-30 13:41:50 -08:00
2025-02-06 16:14:14 -08:00
2024-10-10 08:30:22 -07:00
2021-12-10 06:38:26 -08:00
2025-01-20 11:44:57 -08:00
2024-09-12 21:00:26 -07:00
2022-07-22 12:53:22 +01:00
2023-11-20 10:15:16 -08:00
2024-11-21 08:28:08 -08:00
2024-12-09 14:44:59 -08:00
2024-12-05 18:41:07 -08:00
2019-11-12 08:18:03 -08:00
2022-07-22 12:53:22 +01:00
2024-08-12 17:50:34 -07:00
2024-08-30 22:30:55 +02:00
2023-07-14 20:39:29 -07:00
2023-08-04 15:33:50 -07:00
2024-04-01 10:49:28 +01:00
2023-07-14 20:39:30 -07:00
2023-06-02 09:55:22 +01:00
2025-01-20 09:21:27 +00:00
2024-02-02 10:57:55 -08:00
2022-07-22 12:53:22 +01:00
2024-04-30 18:46:52 -07:00
2024-03-07 21:12:43 -08:00
2024-07-11 18:11:31 -07:00
2022-07-22 12:53:22 +01:00
2023-04-06 12:01:20 -07:00
2023-03-17 08:56:37 +00:00
2024-08-26 09:37:23 -07:00
2024-08-26 09:37:23 -07:00
2024-06-06 15:18:04 +02:00
2022-08-01 11:59:23 -07:00
2025-02-06 16:14:14 -08:00
2023-06-19 11:32:58 -07:00
2024-04-01 11:28:32 +01:00
2023-07-14 20:39:30 -07:00
2024-08-07 10:24:46 +01:00
2024-11-11 17:26:52 -08:00
2019-04-22 21:47:25 -07:00
2025-02-05 18:32:06 -08:00
2024-12-04 14:42:31 -05:00
2022-07-22 12:53:22 +01:00
2024-05-30 18:29:38 -07:00
2024-06-24 16:41:23 -07:00
2024-05-30 18:29:38 -07:00
2021-04-28 14:06:45 -07:00
2024-04-30 13:24:48 +02:00
2019-10-05 16:29:00 -07:00
2024-08-02 17:16:59 -07:00
2025-01-16 10:34:59 -08:00
2023-10-04 11:49:20 -07:00
2022-07-22 12:53:22 +01:00
2022-07-18 11:24:10 +01:00
2024-02-16 09:36:37 +00:00
2024-02-14 10:49:37 +01:00
2024-11-03 12:10:11 -08:00
2023-12-04 14:45:26 -08:00
2024-12-09 14:44:59 -08:00
2024-07-08 14:07:31 -07:00
2024-05-09 20:25:55 -07:00
2023-07-28 14:07:59 -07:00
2019-10-04 14:07:07 -07:00
2024-12-16 12:47:29 +00:00
2023-08-01 15:06:27 -07:00
2022-12-12 15:04:39 -08:00
2022-07-22 12:53:22 +01:00
2024-04-01 10:49:28 +01:00
2024-11-18 11:56:21 +00:00
2023-09-14 16:16:36 +02:00
2019-11-14 18:12:17 -08:00
2024-12-09 14:47:04 -08:00
2024-08-26 09:37:23 -07:00
2022-07-22 12:53:22 +01:00
2025-01-16 10:34:59 -08:00
2024-07-02 15:26:57 +02:00
2025-01-16 10:34:59 -08:00
2025-01-27 15:15:12 -08:00
2024-12-05 18:41:06 -08:00