syzbot


general protection fault in sco_conn_add

Status: fixed on 2023/10/12 12:48
Subsystems: bluetooth
[Documentation on labels]
Reported-by: syzbot+37acd5d80d00d609d233@syzkaller.appspotmail.com
Fix commit: b4066eb04bb6 Bluetooth: hci_conn: return ERR_PTR instead of NULL when there is no link
First crash: 297d, last: 283d
Cause bisection: introduced by (bisect log) :
commit 06149746e7203d5ffe2d6faf9799ee36203aa8b8
Author: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Date: Tue Apr 11 23:02:22 2023 +0000

  Bluetooth: hci_conn: Add support for linking multiple hcon

Crash: general protection fault in sco_conn_add (log)
Repro: C syz .config
  
Discussions (2)
Title Replies (including bot) Last reply
[PATCH] Bluetooth: hci_conn: return ERR_PTR instead of NULL when there is no link 1 (1) 2023/07/11 13:13
[syzbot] [bluetooth?] general protection fault in sco_conn_add 0 (1) 2023/07/09 08:07
Last patch testing requests (2)
Created Duration User Patch Repo Result
2023/07/11 12:49 20m code@siddh.me patch https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master OK log
2023/07/09 09:14 21m hdanton@sina.com patch https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git 3674fbf0451d OK log

Sample crash report:
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00007f09bc777879
RDX: 0000000000000008 RSI: 0000000020000200 RDI: 0000000000000004
RBP: 0000000000000003 R08: 0000000000000001 R09: 0000000800000015
R10: 0000000000000000 R11: 0000000000000246 R12: 0000555555a6d2b8
R13: 00007ffe17db6850 R14: 0000000000000072 R15: 00007ffe17db6860
 </TASK>
general protection fault, probably for non-canonical address 0xdffffc000000013b: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x00000000000009d8-0x00000000000009df]
CPU: 1 PID: 5013 Comm: syz-executor238 Not tainted 6.4.0-rc7-syzkaller-01944-g3674fbf0451d #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/27/2023
RIP: 0010:sco_conn_add+0x2a/0x330 net/bluetooth/sco.c:127
Code: 41 57 41 56 41 55 49 89 fd 41 54 55 49 8d ad d8 09 00 00 53 e8 b7 f1 5a f8 48 89 ea 48 b8 00 00 00 00 00 fc ff df 48 c1 ea 03 <80> 3c 02 00 0f 85 8b 02 00 00 4d 8b a5 d8 09 00 00 4d 85 e4 74 13
RSP: 0018:ffffc90003a8fd50 EFLAGS: 00010202
RAX: dffffc0000000000 RBX: ffff888028830000 RCX: 0000000000000000
RDX: 000000000000013b RSI: ffffffff892957a9 RDI: 0000000000000000
RBP: 00000000000009d8 R08: 0000000000000005 R09: 0000000000000000
R10: 0000000000000010 R11: 0000000000000001 R12: 0000000000000000
R13: 0000000000000000 R14: ffff8880203cf540 R15: ffff888028830010
FS:  0000555555a6d300(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f09bc7db6e3 CR3: 0000000025e98000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 sco_connect net/bluetooth/sco.c:274 [inline]
 sco_sock_connect+0x321/0xae0 net/bluetooth/sco.c:610
 __sys_connect_file+0x153/0x1a0 net/socket.c:1991
 __sys_connect+0x165/0x1a0 net/socket.c:2008
 __do_sys_connect net/socket.c:2018 [inline]
 __se_sys_connect net/socket.c:2015 [inline]
 __x64_sys_connect+0x73/0xb0 net/socket.c:2015
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f09bc777879
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 c1 18 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 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffe17db67f8 EFLAGS: 00000246 ORIG_RAX: 000000000000002a
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00007f09bc777879
RDX: 0000000000000008 RSI: 0000000020000200 RDI: 0000000000000004
RBP: 0000000000000003 R08: 0000000000000001 R09: 0000000800000015
R10: 0000000000000000 R11: 0000000000000246 R12: 0000555555a6d2b8
R13: 00007ffe17db6850 R14: 0000000000000072 R15: 00007ffe17db6860
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:sco_conn_add+0x2a/0x330 net/bluetooth/sco.c:127
Code: 41 57 41 56 41 55 49 89 fd 41 54 55 49 8d ad d8 09 00 00 53 e8 b7 f1 5a f8 48 89 ea 48 b8 00 00 00 00 00 fc ff df 48 c1 ea 03 <80> 3c 02 00 0f 85 8b 02 00 00 4d 8b a5 d8 09 00 00 4d 85 e4 74 13
RSP: 0018:ffffc90003a8fd50 EFLAGS: 00010202
RAX: dffffc0000000000 RBX: ffff888028830000 RCX: 0000000000000000
RDX: 000000000000013b RSI: ffffffff892957a9 RDI: 0000000000000000
RBP: 00000000000009d8 R08: 0000000000000005 R09: 0000000000000000
R10: 0000000000000010 R11: 0000000000000001 R12: 0000000000000000
R13: 0000000000000000 R14: ffff8880203cf540 R15: ffff888028830010
FS:  0000555555a6d300(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00005653cab3d008 CR3: 0000000025e98000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
   0:	41 57                	push   %r15
   2:	41 56                	push   %r14
   4:	41 55                	push   %r13
   6:	49 89 fd             	mov    %rdi,%r13
   9:	41 54                	push   %r12
   b:	55                   	push   %rbp
   c:	49 8d ad d8 09 00 00 	lea    0x9d8(%r13),%rbp
  13:	53                   	push   %rbx
  14:	e8 b7 f1 5a f8       	callq  0xf85af1d0
  19:	48 89 ea             	mov    %rbp,%rdx
  1c:	48 b8 00 00 00 00 00 	movabs $0xdffffc0000000000,%rax
  23:	fc ff df
  26:	48 c1 ea 03          	shr    $0x3,%rdx
* 2a:	80 3c 02 00          	cmpb   $0x0,(%rdx,%rax,1) <-- trapping instruction
  2e:	0f 85 8b 02 00 00    	jne    0x2bf
  34:	4d 8b a5 d8 09 00 00 	mov    0x9d8(%r13),%r12
  3b:	4d 85 e4             	test   %r12,%r12
  3e:	74 13                	je     0x53

Crashes (4):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/07/05 09:00 net 3674fbf0451d 80298b6f .config strace log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-net-this-kasan-gce general protection fault in sco_conn_add
2023/07/05 09:39 net-next ae230642190a 80298b6f .config strace log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce general protection fault in sco_conn_add
2023/07/05 08:04 net 3674fbf0451d 80298b6f .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-this-kasan-gce general protection fault in sco_conn_add
2023/07/18 19:51 net-next d3750076d464 022df2bb .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce general protection fault in sco_conn_add
* Struck through repros no longer work on HEAD.