From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-il1-f197.google.com (mail-il1-f197.google.com [209.85.166.197]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6F718CA5A for ; Tue, 25 Nov 2025 13:46:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.197 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764078364; cv=none; b=t4yzvax89Us193Zn/YWt0deIaC/zT/v5x+431m9KrWCfdHmNQg0es3THujrVx/WlNBaHYUXKtLBpkfuWbLP21E8cEa3/+iJjL2Am1RwhO9fXJyGxBdy0FABcOOSqDGib6bA/1qh4SS3vkjx56tLaCYULxIFg4untEiEDxkd35zM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764078364; c=relaxed/simple; bh=y4mcjL6+HQhDjJzuQNVF9fD8l0xSJKrqAHNe6QBp8RA=; h=MIME-Version:Date:In-Reply-To:Message-ID:Subject:From:To: Content-Type; b=je+6GFGzUghzRzB1CPm4vL73cAuTG5hdQf9le5WXvKmggDfVlU9UYWgHsCcyvxpR7c9SyMDMqisPl41850xd2lDCV+i4x8tGZuwtlVzzT+LsG1CnO0b5Ipw2UaPMALeQcWosvXkzmbfpmZsGZR0rrOnIruD6hIJPjZwOIKbIBCc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com; arc=none smtp.client-ip=209.85.166.197 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com Received: by mail-il1-f197.google.com with SMTP id e9e14a558f8ab-43335646758so45445695ab.3 for ; Tue, 25 Nov 2025 05:46:02 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764078361; x=1764683161; h=to:from:subject:message-id:in-reply-to:date:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=qaoGt2mQVl1oJqxOMx0VTDV7b83i09WYMjvtw3V3Fn4=; b=tCz5NJUHI2jpqlEYVikI+fy1K3sowScqwguZxPwNmILostUHl2jwIROFBFtIw6RUL8 LmgfeNt3z1WWEuNajR9Uua5UZEXnKxFEDd13RqmjT23IFormf3OI4QS96Tn760/GUYmz dB+JTJ+PswXL61DUF+SMs7PzCPX/pk1nfUnJ27yNafSX0lkAMmT2GlAnCYB0IkHo24Gm DLUyY25eZ2UilXwZMcgukKvwIi4b1yHExJrjoB2JyWQTjAvF57YX9ek8uUqklxpj2/x1 TY44/XoJKfkqh9JUIOQeGnRxxoz6tx/rNIZbhxCwuaQ1zZZhC8D3tSjHTdqWSUeofKwt kohw== X-Forwarded-Encrypted: i=1; AJvYcCWNld23tCV6y/e6sWHFN+JepBmoKpLFjV9wfVgKfjBRgphLtyaM5XsCE6kJsr0D+an6FAADLRBh9JlpK9M=@vger.kernel.org X-Gm-Message-State: AOJu0YyNog8Yz5L4xZ/KKZ+IfqXaMH5kTaLkh+SJ/K6UiAr29xAobra+ 29W6L/ykzXCaxtRWhg/vkXLmm2a9u4N5iL67SlGk4Q670oDrvynA/i6v0QHMfRU5WzmTpYd6pmB qbM1VRiASvEz6Zpoc5pXaDAt5qa4FCZcnGKf/45HuHn6th5EVu/HC+h84Ou0= X-Google-Smtp-Source: AGHT+IFQsg+Q4eNVPndOhv1vBzMCfQUik1s3deeFhabZThvPnm+AryZr0jIj9j09UPFP0i9BkrB5wnS5ok6p12MMq9UGVBZoGyi+ Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Received: by 2002:a05:6e02:2162:b0:433:30e0:6f68 with SMTP id e9e14a558f8ab-435b8eb45c3mr121533515ab.24.1764078361625; Tue, 25 Nov 2025 05:46:01 -0800 (PST) Date: Tue, 25 Nov 2025 05:46:01 -0800 In-Reply-To: X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <6925b319.a70a0220.d98e3.00a9.GAE@google.com> Subject: Re: [syzbot] [bluetooth?] KASAN: slab-use-after-free Read in l2cap_sock_new_connection_cb From: syzbot To: eadavis@qq.com, linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com Content-Type: text/plain; charset="UTF-8" Hello, syzbot has tested the proposed patch but the reproducer is still triggering an issue: possible deadlock in l2cap_sock_shutdown ====================================================== WARNING: possible circular locking dependency detected syzkaller #0 Not tainted ------------------------------------------------------ syz.2.19/6669 is trying to acquire lock: ffff88803a345588 (&chan->lock/2){+.+.}-{4:4}, at: l2cap_chan_lock include/net/bluetooth/l2cap.h:827 [inline] ffff88803a345588 (&chan->lock/2){+.+.}-{4:4}, at: l2cap_sock_shutdown+0x9f3/0x1130 net/bluetooth/l2cap_sock.c:1374 but task is already holding lock: ffffffff8e9e3238 (ra_lock){+.+.}-{4:4}, at: class_mutex_constructor include/linux/mutex.h:228 [inline] ffffffff8e9e3238 (ra_lock){+.+.}-{4:4}, at: l2cap_sock_release+0x5e/0x260 net/bluetooth/l2cap_sock.c:1427 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (ra_lock){+.+.}-{4:4}: lock_acquire+0x120/0x360 kernel/locking/lockdep.c:5868 __mutex_lock_common kernel/locking/rtmutex_api.c:535 [inline] mutex_lock_nested+0x5a/0x1d0 kernel/locking/rtmutex_api.c:547 class_mutex_constructor include/linux/mutex.h:228 [inline] l2cap_sock_new_connection_cb+0x4e/0x300 net/bluetooth/l2cap_sock.c:1477 l2cap_connect_cfm+0x37a/0x1040 net/bluetooth/l2cap_core.c:7288 hci_connect_cfm+0x95/0x140 include/net/bluetooth/hci_core.h:2107 le_conn_complete_evt+0xfb8/0x1500 net/bluetooth/hci_event.c:5799 hci_le_conn_complete_evt+0x187/0x450 net/bluetooth/hci_event.c:5825 hci_event_func net/bluetooth/hci_event.c:7586 [inline] hci_event_packet+0x78f/0x1200 net/bluetooth/hci_event.c:7643 hci_rx_work+0x46a/0xe80 net/bluetooth/hci_core.c:4099 process_one_work kernel/workqueue.c:3263 [inline] process_scheduled_works+0xae1/0x17b0 kernel/workqueue.c:3346 worker_thread+0x8a0/0xda0 kernel/workqueue.c:3427 kthread+0x711/0x8a0 kernel/kthread.c:463 ret_from_fork+0x4bc/0x870 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 -> #0 (&chan->lock/2){+.+.}-{4:4}: check_prev_add kernel/locking/lockdep.c:3165 [inline] check_prevs_add kernel/locking/lockdep.c:3284 [inline] validate_chain+0xb9b/0x2140 kernel/locking/lockdep.c:3908 __lock_acquire+0xab9/0xd20 kernel/locking/lockdep.c:5237 lock_acquire+0x120/0x360 kernel/locking/lockdep.c:5868 __mutex_lock_common kernel/locking/rtmutex_api.c:535 [inline] mutex_lock_nested+0x5a/0x1d0 kernel/locking/rtmutex_api.c:547 l2cap_chan_lock include/net/bluetooth/l2cap.h:827 [inline] l2cap_sock_shutdown+0x9f3/0x1130 net/bluetooth/l2cap_sock.c:1374 l2cap_sock_release+0x82/0x260 net/bluetooth/l2cap_sock.c:1432 __sock_release net/socket.c:662 [inline] sock_close+0xc3/0x240 net/socket.c:1455 __fput+0x45b/0xa80 fs/file_table.c:468 task_work_run+0x1d4/0x260 kernel/task_work.c:227 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline] exit_to_user_mode_loop+0xe9/0x130 kernel/entry/common.c:43 exit_to_user_mode_prepare include/linux/irq-entry-common.h:225 [inline] syscall_exit_to_user_mode_work include/linux/entry-common.h:175 [inline] syscall_exit_to_user_mode include/linux/entry-common.h:210 [inline] do_syscall_64+0x2bd/0xfa0 arch/x86/entry/syscall_64.c:100 entry_SYSCALL_64_after_hwframe+0x77/0x7f other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(ra_lock); lock(&chan->lock/2); lock(ra_lock); lock(&chan->lock/2); *** DEADLOCK *** 2 locks held by syz.2.19/6669: #0: ffff8880480cd6f8 (&sb->s_type->i_mutex_key#10){+.+.}-{4:4}, at: inode_lock include/linux/fs.h:980 [inline] #0: ffff8880480cd6f8 (&sb->s_type->i_mutex_key#10){+.+.}-{4:4}, at: __sock_release net/socket.c:661 [inline] #0: ffff8880480cd6f8 (&sb->s_type->i_mutex_key#10){+.+.}-{4:4}, at: sock_close+0x9b/0x240 net/socket.c:1455 #1: ffffffff8e9e3238 (ra_lock){+.+.}-{4:4}, at: class_mutex_constructor include/linux/mutex.h:228 [inline] #1: ffffffff8e9e3238 (ra_lock){+.+.}-{4:4}, at: l2cap_sock_release+0x5e/0x260 net/bluetooth/l2cap_sock.c:1427 stack backtrace: CPU: 1 UID: 0 PID: 6669 Comm: syz.2.19 Not tainted syzkaller #0 PREEMPT_{RT,(full)} Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/25/2025 Call Trace: dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120 print_circular_bug+0x2ee/0x310 kernel/locking/lockdep.c:2043 check_noncircular+0x134/0x160 kernel/locking/lockdep.c:2175 check_prev_add kernel/locking/lockdep.c:3165 [inline] check_prevs_add kernel/locking/lockdep.c:3284 [inline] validate_chain+0xb9b/0x2140 kernel/locking/lockdep.c:3908 __lock_acquire+0xab9/0xd20 kernel/locking/lockdep.c:5237 lock_acquire+0x120/0x360 kernel/locking/lockdep.c:5868 __mutex_lock_common kernel/locking/rtmutex_api.c:535 [inline] mutex_lock_nested+0x5a/0x1d0 kernel/locking/rtmutex_api.c:547 l2cap_chan_lock include/net/bluetooth/l2cap.h:827 [inline] l2cap_sock_shutdown+0x9f3/0x1130 net/bluetooth/l2cap_sock.c:1374 l2cap_sock_release+0x82/0x260 net/bluetooth/l2cap_sock.c:1432 __sock_release net/socket.c:662 [inline] sock_close+0xc3/0x240 net/socket.c:1455 __fput+0x45b/0xa80 fs/file_table.c:468 task_work_run+0x1d4/0x260 kernel/task_work.c:227 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline] exit_to_user_mode_loop+0xe9/0x130 kernel/entry/common.c:43 exit_to_user_mode_prepare include/linux/irq-entry-common.h:225 [inline] syscall_exit_to_user_mode_work include/linux/entry-common.h:175 [inline] syscall_exit_to_user_mode include/linux/entry-common.h:210 [inline] do_syscall_64+0x2bd/0xfa0 arch/x86/entry/syscall_64.c:100 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fc22a98f749 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fff1d93f9c8 EFLAGS: 00000246 ORIG_RAX: 00000000000001b4 RAX: 0000000000000000 RBX: 00007fc22abe7da0 RCX: 00007fc22a98f749 RDX: 0000000000000000 RSI: 000000000000001e RDI: 0000000000000003 RBP: 00007fc22abe7da0 R08: 0000000000000000 R09: 000000141d93fcbf R10: 000000000003fd20 R11: 0000000000000246 R12: 000000000002b06f R13: 00007fff1d93fac0 R14: ffffffffffffffff R15: 00007fff1d93fae0 Tested on: commit: ac3fd01e Linux 6.18-rc7 git tree: upstream console output: https://syzkaller.appspot.com/x/log.txt?x=155ec57c580000 kernel config: https://syzkaller.appspot.com/x/.config?x=38a0c4cddc846161 dashboard link: https://syzkaller.appspot.com/bug?extid=cdae834448ec8c3602fe compiler: Debian clang version 20.1.8 (++20250708063551+0c9f909b7976-1~exp1~20250708183702.136), Debian LLD 20.1.8 patch: https://syzkaller.appspot.com/x/patch.diff?x=1280cf42580000