syzbot


general protection fault in hci_uart_tty_ioctl

Status: upstream: reported C repro on 2023/05/29 05:45
Bug presence: origin:upstream
Labels: missing-backport
[Documentation on labels]
Reported-by: syzbot+78b6113e48e122fc1a82@syzkaller.appspotmail.com
First crash: 272d, last: 72d
Fix commit to backport (bisect log) :
tree: upstream
commit 9c33663af9ad115f90c076a1828129a3fbadea98
Author: Lee, Chun-Yi <joeyli.kernel@gmail.com>
Date: Mon Jul 10 15:17:23 2023 +0000

  Bluetooth: hci_ldisc: check HCI_UART_PROTO_READY flag in HCIUARTGETPROTO

  
Fix bisection: the issue occurs on the latest tested release (bisect log)
Crash: general protection fault in hci_uart_tty_ioctl (log)
Repro: C syz .config
  
Bug presence (3)
Date Name Commit Repro Result
2023/10/12 linux-5.15.y (ToT) 02e21884dcf2 C [report] general protection fault in hci_uart_tty_ioctl
2023/05/29 upstream (ToT) e338142b39cf C [report] general protection fault in hci_uart_tty_ioctl
2023/10/12 upstream (ToT) e8c127b05766 C Didn't crash
Similar bugs (3)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-6.1 general protection fault in hci_uart_tty_ioctl origin:upstream missing-backport C done 1 175d 266d 0/3 upstream: reported C repro on 2023/06/04 06:24
upstream general protection fault in hci_uart_tty_ioctl bluetooth C error done 4 180d 558d 0/26 auto-obsoleted due to no activity on 2023/12/07 13:40
android-54 general protection fault in hci_uart_tty_ioctl C 2 590d 590d 0/2 auto-obsoleted due to no activity on 2023/04/19 15:38
Fix bisection attempts (5)
Created Duration User Patch Repo Result
2024/01/06 17:25 8h34m fix candidate upstream job log (1)
2023/12/15 12:21 2h44m bisect fix linux-5.15.y job log (0) log
2023/11/14 22:54 2h17m bisect fix linux-5.15.y job log (0) log
2023/09/12 22:04 3h00m bisect fix linux-5.15.y job log (0) log
2023/06/29 03:43 1h08m bisect fix linux-5.15.y job log (0) log

Sample crash report:
general protection fault, probably for non-canonical address 0xdffffc0000000000: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007]
CPU: 1 PID: 3630 Comm: syz-executor178 Not tainted 5.15.113-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/25/2023
RIP: 0010:hci_uart_tty_ioctl+0x2dc/0xa70 drivers/bluetooth/hci_ldisc.c:772
Code: fa 4c 89 f3 48 81 c3 b8 00 00 00 48 89 d8 48 c1 e8 03 80 3c 28 00 74 08 48 89 df e8 7e 9f 6d fa 48 8b 1b 48 89 d8 48 c1 e8 03 <0f> b6 04 28 84 c0 0f 85 87 06 00 00 8b 2b e9 4f 07 00 00 e8 dc 43
RSP: 0018:ffffc9000303fe40 EFLAGS: 00010246
RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffff88807c3c0000
RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000000
RBP: dffffc0000000000 R08: ffffffff875ba4e7 R09: ffffed100482a004
R10: 0000000000000000 R11: dffffc0000000001 R12: 00000000800455c9
R13: ffff888016eab000 R14: ffff888024150000 R15: 0000000000000000
FS:  00007fe0e13a3700(0000) GS:ffff8880b9b00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fed9efa3445 CR3: 000000002330b000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 tty_ioctl+0x8ff/0xc50 drivers/tty/tty_io.c:2816
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:874 [inline]
 __se_sys_ioctl+0xf1/0x160 fs/ioctl.c:860
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x61/0xcb
RIP: 0033:0x7fe0e1412ac9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 11 15 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:00007fe0e13a3208 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007fe0e149a3f8 RCX: 00007fe0e1412ac9
RDX: 0000000000000000 RSI: 00000000800455c9 RDI: 0000000000000003
RBP: 00007fe0e149a3f0 R08: 00007fe0e13a3700 R09: 0000000000000000
R10: 00007fe0e13a3700 R11: 0000000000000246 R12: 00007fe0e149a3fc
R13: 00007ffeeb044c3f R14: 00007fe0e13a3300 R15: 0000000000022000
 </TASK>
Modules linked in:
---[ end trace 7edf9da721f00b32 ]---
RIP: 0010:hci_uart_tty_ioctl+0x2dc/0xa70 drivers/bluetooth/hci_ldisc.c:772
Code: fa 4c 89 f3 48 81 c3 b8 00 00 00 48 89 d8 48 c1 e8 03 80 3c 28 00 74 08 48 89 df e8 7e 9f 6d fa 48 8b 1b 48 89 d8 48 c1 e8 03 <0f> b6 04 28 84 c0 0f 85 87 06 00 00 8b 2b e9 4f 07 00 00 e8 dc 43
RSP: 0018:ffffc9000303fe40 EFLAGS: 00010246
RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffff88807c3c0000
RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000000
RBP: dffffc0000000000 R08: ffffffff875ba4e7 R09: ffffed100482a004
R10: 0000000000000000 R11: dffffc0000000001 R12: 00000000800455c9
R13: ffff888016eab000 R14: ffff888024150000 R15: 0000000000000000
FS:  00007fe0e13a3700(0000) GS:ffff8880b9b00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fed9efa3445 CR3: 000000002330b000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
   0:	fa                   	cli
   1:	4c 89 f3             	mov    %r14,%rbx
   4:	48 81 c3 b8 00 00 00 	add    $0xb8,%rbx
   b:	48 89 d8             	mov    %rbx,%rax
   e:	48 c1 e8 03          	shr    $0x3,%rax
  12:	80 3c 28 00          	cmpb   $0x0,(%rax,%rbp,1)
  16:	74 08                	je     0x20
  18:	48 89 df             	mov    %rbx,%rdi
  1b:	e8 7e 9f 6d fa       	callq  0xfa6d9f9e
  20:	48 8b 1b             	mov    (%rbx),%rbx
  23:	48 89 d8             	mov    %rbx,%rax
  26:	48 c1 e8 03          	shr    $0x3,%rax
* 2a:	0f b6 04 28          	movzbl (%rax,%rbp,1),%eax <-- trapping instruction
  2e:	84 c0                	test   %al,%al
  30:	0f 85 87 06 00 00    	jne    0x6bd
  36:	8b 2b                	mov    (%rbx),%ebp
  38:	e9 4f 07 00 00       	jmpq   0x78c
  3d:	e8                   	.byte 0xe8
  3e:	dc                   	.byte 0xdc
  3f:	43                   	rex.XB

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/05/29 05:45 linux-5.15.y 1fe619a7d252 cf184559 .config console log report syz C [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan general protection fault in hci_uart_tty_ioctl
* Struck through repros no longer work on HEAD.