general protection fault in __device_attach

6 views
Skip to first unread message

syzbot

unread,
Jan 3, 2023, 2:29:39 AM1/3/23
to syzkaller-a...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: c73b4619ad86 ANDROID: abi preservation for fscrypt change ..
git tree: android13-5.15-lts
console output: https://syzkaller.appspot.com/x/log.txt?x=11662334480000
kernel config: https://syzkaller.appspot.com/x/.config?x=d7c9bd3bb9661aad
dashboard link: https://syzkaller.appspot.com/bug?extid=8145e8e53f9bd803cfbd
compiler: Debian clang version 13.0.1-++20220126092033+75e33f71c2da-1~exp1~20220126212112.63, GNU ld (GNU Binutils for Debian) 2.35.2
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=14d4031a480000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=116e2742480000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/d4a785f6c196/disk-c73b4619.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/e2fba875c9ab/vmlinux-c73b4619.xz
kernel image: https://storage.googleapis.com/syzbot-assets/a870e2543ec9/bzImage-c73b4619.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+8145e8...@syzkaller.appspotmail.com

general protection fault, probably for non-canonical address 0xdffffc000000001a: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x00000000000000d0-0x00000000000000d7]
CPU: 1 PID: 830 Comm: syz-executor144 Not tainted 5.15.78-syzkaller-00911-gc73b4619ad86 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022
RIP: 0010:__device_attach+0xb4/0x530 drivers/base/dd.c:950
Code: 5c 24 68 48 89 d8 48 c1 e8 03 42 80 3c 30 00 74 08 48 89 df e8 fd 01 d2 fe 4c 8b 2b 49 8d 9d d0 00 00 00 48 89 d8 48 c1 e8 03 <42> 8a 04 30 84 c0 0f 85 e1 03 00 00 0f b6 1b 89 de 83 e6 01 45 31
RSP: 0018:ffffc90001a874e0 EFLAGS: 00010202
RAX: 000000000000001a RBX: 00000000000000d0 RCX: ffff88810ccba780
RDX: 0000000000000001 RSI: 0000000000000008 RDI: ffffc90001a87460
RBP: ffffc90001a875b0 R08: dffffc0000000000 R09: fffff52000350e8d
R10: fffff52000350e8d R11: 1ffff92000350e8c R12: ffff88810cc85030
R13: 0000000000000000 R14: dffffc0000000000 R15: ffff88810cc85030
FS: 00007f377c3ee700(0000) GS:ffff8881f7100000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f377c38b718 CR3: 000000011fb73000 CR4: 00000000003506a0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
device_attach+0x17/0x20 drivers/base/dd.c:1017
proc_ioctl+0x41e/0x600 drivers/usb/core/devio.c:2344
proc_ioctl_compat drivers/usb/core/devio.c:2393 [inline]
usbdev_do_ioctl drivers/usb/core/devio.c:2709 [inline]
usbdev_ioctl+0x3712/0x6d50 drivers/usb/core/devio.c:2795
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:874 [inline]
__se_sys_ioctl+0x115/0x190 fs/ioctl.c:860
__x64_sys_ioctl+0x7b/0x90 fs/ioctl.c:860
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x61/0xcb
RIP: 0033:0x7f377c44b8b9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 31 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 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f377c3ee1d8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007f377c4d0268 RCX: 00007f377c44b8b9
RDX: 0000000020000040 RSI: 00000000c00c5512 RDI: 0000000000000006
RBP: 00007f377c4d0260 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007f377c4d026c
R13: 00007ffdcf051adf R14: 00007f377c3ee300 R15: 0000000000022000
</TASK>
Modules linked in:
---[ end trace 096505cfdb9fc9cb ]---
RIP: 0010:__device_attach+0xb4/0x530 drivers/base/dd.c:950
Code: 5c 24 68 48 89 d8 48 c1 e8 03 42 80 3c 30 00 74 08 48 89 df e8 fd 01 d2 fe 4c 8b 2b 49 8d 9d d0 00 00 00 48 89 d8 48 c1 e8 03 <42> 8a 04 30 84 c0 0f 85 e1 03 00 00 0f b6 1b 89 de 83 e6 01 45 31
RSP: 0018:ffffc90001a874e0 EFLAGS: 00010202
RAX: 000000000000001a RBX: 00000000000000d0 RCX: ffff88810ccba780
RDX: 0000000000000001 RSI: 0000000000000008 RDI: ffffc90001a87460
RBP: ffffc90001a875b0 R08: dffffc0000000000 R09: fffff52000350e8d
R10: fffff52000350e8d R11: 1ffff92000350e8c R12: ffff88810cc85030
R13: 0000000000000000 R14: dffffc0000000000 R15: ffff88810cc85030
FS: 00007f377c3ee700(0000) GS:ffff8881f7000000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f377c495038 CR3: 000000011fb73000 CR4: 00000000003506b0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
0: 5c pop %rsp
1: 24 68 and $0x68,%al
3: 48 89 d8 mov %rbx,%rax
6: 48 c1 e8 03 shr $0x3,%rax
a: 42 80 3c 30 00 cmpb $0x0,(%rax,%r14,1)
f: 74 08 je 0x19
11: 48 89 df mov %rbx,%rdi
14: e8 fd 01 d2 fe callq 0xfed20216
19: 4c 8b 2b mov (%rbx),%r13
1c: 49 8d 9d d0 00 00 00 lea 0xd0(%r13),%rbx
23: 48 89 d8 mov %rbx,%rax
26: 48 c1 e8 03 shr $0x3,%rax
* 2a: 42 8a 04 30 mov (%rax,%r14,1),%al <-- trapping instruction
2e: 84 c0 test %al,%al
30: 0f 85 e1 03 00 00 jne 0x417
36: 0f b6 1b movzbl (%rbx),%ebx
39: 89 de mov %ebx,%esi
3b: 83 e6 01 and $0x1,%esi
3e: 45 rex.RB
3f: 31 .byte 0x31


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
syzbot can test patches for this issue, for details see:
https://goo.gl/tpsmEJ#testing-patches

Tudor Ambarus

unread,
Jan 3, 2023, 2:37:40 AM1/3/23
to syzbot+8145e8...@syzkaller.appspotmail.com, jone...@google.com, syzkaller-a...@googlegroups.com

syzbot

unread,
Jan 3, 2023, 6:54:21 AM1/3/23
to jone...@google.com, syzkaller-a...@googlegroups.com, tudor....@linaro.org
Hello,

syzbot has tested the proposed patch but the reproducer is still triggering an issue:
general protection fault in __device_attach

general protection fault, probably for non-canonical address 0xdffffc000000001a: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x00000000000000d0-0x00000000000000d7]
CPU: 0 PID: 525 Comm: syz-executor.2 Not tainted 6.2.0-rc2-syzkaller-00127-g69b41ac87e4a #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022
RIP: 0010:__device_attach+0xb4/0x530 drivers/base/dd.c:984
Code: 5c 24 48 48 89 d8 48 c1 e8 03 42 80 3c 30 00 74 08 48 89 df e8 dd c4 ba fe 4c 8b 2b 49 8d 9d d0 00 00 00 48 89 d8 48 c1 e8 03 <42> 8a 04 30 84 c0 0f 85 d8 03 00 00 0f b6 1b 89 de 83 e6 01 45 31
RSP: 0018:ffffc900034bf500 EFLAGS: 00010202
RAX: 000000000000001a RBX: 00000000000000d0 RCX: ffff88811a073000
RDX: 0000000000000001 RSI: 0000000000000008 RDI: ffffc900034bf480
RBP: ffffc900034bf5d0 R08: dffffc0000000000 R09: fffff52000697e91
R10: fffff52000697e91 R11: 1ffff92000697e90 R12: ffff88811a4d5030
R13: 0000000000000000 R14: dffffc0000000000 R15: ffff88811a4d5030
FS: 00007fa355388700(0000) GS:ffff8881f7000000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f4d6239c718 CR3: 000000011a351000 CR4: 00000000003506b0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
device_attach+0x17/0x20 drivers/base/dd.c:1051
proc_ioctl+0x41e/0x600 drivers/usb/core/devio.c:2356
proc_ioctl_compat drivers/usb/core/devio.c:2405 [inline]
usbdev_do_ioctl drivers/usb/core/devio.c:2721 [inline]
usbdev_ioctl+0x3712/0x6d50 drivers/usb/core/devio.c:2807
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:870 [inline]
__se_sys_ioctl+0x115/0x190 fs/ioctl.c:856
__x64_sys_ioctl+0x7b/0x90 fs/ioctl.c:856
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x2f/0x50 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7fa35468c0a9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 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 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fa355388168 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007fa3547abf80 RCX: 00007fa35468c0a9
RDX: 0000000020000040 RSI: 00000000c00c5512 RDI: 0000000000000006
RBP: 00007fa3546e7ae9 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007ffeec50954f R14: 00007fa355388300 R15: 0000000000022000
</TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:__device_attach+0xb4/0x530 drivers/base/dd.c:984
Code: 5c 24 48 48 89 d8 48 c1 e8 03 42 80 3c 30 00 74 08 48 89 df e8 dd c4 ba fe 4c 8b 2b 49 8d 9d d0 00 00 00 48 89 d8 48 c1 e8 03 <42> 8a 04 30 84 c0 0f 85 d8 03 00 00 0f b6 1b 89 de 83 e6 01 45 31
RSP: 0018:ffffc900034bf500 EFLAGS: 00010202
RAX: 000000000000001a RBX: 00000000000000d0 RCX: ffff88811a073000
RDX: 0000000000000001 RSI: 0000000000000008 RDI: ffffc900034bf480
RBP: ffffc900034bf5d0 R08: dffffc0000000000 R09: fffff52000697e91
R10: fffff52000697e91 R11: 1ffff92000697e90 R12: ffff88811a4d5030
R13: 0000000000000000 R14: dffffc0000000000 R15: ffff88811a4d5030
FS: 00007fa355388700(0000) GS:ffff8881f7000000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f040b347d38 CR3: 000000011a351000 CR4: 00000000003506b0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
0: 5c pop %rsp
1: 24 48 and $0x48,%al
3: 48 89 d8 mov %rbx,%rax
6: 48 c1 e8 03 shr $0x3,%rax
a: 42 80 3c 30 00 cmpb $0x0,(%rax,%r14,1)
f: 74 08 je 0x19
11: 48 89 df mov %rbx,%rdi
14: e8 dd c4 ba fe callq 0xfebac4f6
19: 4c 8b 2b mov (%rbx),%r13
1c: 49 8d 9d d0 00 00 00 lea 0xd0(%r13),%rbx
23: 48 89 d8 mov %rbx,%rax
26: 48 c1 e8 03 shr $0x3,%rax
* 2a: 42 8a 04 30 mov (%rax,%r14,1),%al <-- trapping instruction
2e: 84 c0 test %al,%al
30: 0f 85 d8 03 00 00 jne 0x40e
36: 0f b6 1b movzbl (%rbx),%ebx
39: 89 de mov %ebx,%esi
3b: 83 e6 01 and $0x1,%esi
3e: 45 rex.RB
3f: 31 .byte 0x31


Tested on:

commit: 69b41ac8 Merge tag 'for-6.2-rc2-tag' of git://git.kern..
git tree: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
console output: https://syzkaller.appspot.com/x/log.txt?x=113674ec480000
kernel config: https://syzkaller.appspot.com/x/.config?x=fb3b16ad6f6aed37
dashboard link: https://syzkaller.appspot.com/bug?extid=8145e8e53f9bd803cfbd
compiler: Debian clang version 13.0.1-++20220126092033+75e33f71c2da-1~exp1~20220126212112.63, GNU ld (GNU Binutils for Debian) 2.35.2

Note: no patches were applied.
Reply all
Reply to author
Forward
0 new messages