[syzbot] [kernel?] general protection fault in xpad_probe

18 views
Skip to first unread message

syzbot

unread,
Apr 11, 2023, 2:54:47 AM4/11/23
to gre...@linuxfoundation.org, linux-...@vger.kernel.org, raf...@kernel.org, syzkall...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 6a53bda3aaf3 Add linux-next specific files for 20230404
git tree: linux-next
console output: https://syzkaller.appspot.com/x/log.txt?x=16cde443c80000
kernel config: https://syzkaller.appspot.com/x/.config?x=2da90e7abb20c1a
dashboard link: https://syzkaller.appspot.com/bug?extid=a3f758b8d8cb7e49afec
compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/1b162a671d14/disk-6a53bda3.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/2a0dbf376db5/vmlinux-6a53bda3.xz
kernel image: https://storage.googleapis.com/syzbot-assets/6d48fe3fd998/bzImage-6a53bda3.xz

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

usb 6-1: config 0 interface 65 has no altsetting 0
usb 6-1: New USB device found, idVendor=12ab, idProduct=90a1, bcdDevice=1e.eb
usb 6-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
usb 6-1: config 0 descriptor??
general protection fault, probably for non-canonical address 0xdffffc0000000068: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x0000000000000340-0x0000000000000347]
CPU: 0 PID: 20530 Comm: kworker/0:1 Not tainted 6.3.0-rc5-next-20230404-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/02/2023
Workqueue: usb_hub_wq hub_event
RIP: 0010:dev_name include/linux/device.h:706 [inline]
RIP: 0010:__dev_printk+0x3b/0x270 drivers/base/core.c:4869
Code: f5 53 e8 88 8e 6f fc 48 85 ed 0f 84 cb 01 00 00 e8 7a 8e 6f fc 48 8d 7d 50 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 <80> 3c 02 00 0f 85 d7 01 00 00 48 8b 5d 50 48 85 db 0f 84 b5 00 00
RSP: 0018:ffffc90004c66f70 EFLAGS: 00010202
RAX: dffffc0000000000 RBX: fffff5200098cdf5 RCX: ffffc90014c8c000
RDX: 0000000000000068 RSI: ffffffff8513c496 RDI: 0000000000000340
RBP: 00000000000002f0 R08: 0000000000000005 R09: 0000000000000000
R10: 00000000ffffff92 R11: 0000000000000000 R12: ffffffff8ace0700
R13: ffffc90004c66fc8 R14: ffff88804962d264 R15: 0000000000000000
FS: 0000000000000000(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000001b2cd2c000 CR3: 00000000458ec000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
_dev_warn+0xdc/0x120 drivers/base/core.c:4913
xpad_probe+0x197e/0x2020 drivers/input/joystick/xpad.c:2035
usb_probe_interface+0x30f/0x960 drivers/usb/core/driver.c:396
call_driver_probe drivers/base/dd.c:579 [inline]
really_probe+0x240/0xca0 drivers/base/dd.c:658
__driver_probe_device+0x1df/0x4d0 drivers/base/dd.c:795
driver_probe_device+0x4c/0x1a0 drivers/base/dd.c:825
__device_attach_driver+0x1d4/0x2e0 drivers/base/dd.c:953
bus_for_each_drv+0x149/0x1d0 drivers/base/bus.c:457
__device_attach+0x1e4/0x4b0 drivers/base/dd.c:1025
bus_probe_device+0x17c/0x1c0 drivers/base/bus.c:532
device_add+0x112d/0x1a50 drivers/base/core.c:3627
usb_set_configuration+0x1196/0x1bc0 drivers/usb/core/message.c:2211
usb_generic_driver_probe+0xcf/0x130 drivers/usb/core/generic.c:238
usb_probe_device+0xd8/0x2c0 drivers/usb/core/driver.c:293
call_driver_probe drivers/base/dd.c:579 [inline]
really_probe+0x240/0xca0 drivers/base/dd.c:658
__driver_probe_device+0x1df/0x4d0 drivers/base/dd.c:795
driver_probe_device+0x4c/0x1a0 drivers/base/dd.c:825
__device_attach_driver+0x1d4/0x2e0 drivers/base/dd.c:953
bus_for_each_drv+0x149/0x1d0 drivers/base/bus.c:457
__device_attach+0x1e4/0x4b0 drivers/base/dd.c:1025
bus_probe_device+0x17c/0x1c0 drivers/base/bus.c:532
device_add+0x112d/0x1a50 drivers/base/core.c:3627
usb_new_device+0xcb2/0x19d0 drivers/usb/core/hub.c:2575
hub_port_connect drivers/usb/core/hub.c:5407 [inline]
hub_port_connect_change drivers/usb/core/hub.c:5551 [inline]
port_event drivers/usb/core/hub.c:5711 [inline]
hub_event+0x2d9e/0x4e40 drivers/usb/core/hub.c:5793
process_one_work+0x99a/0x15e0 kernel/workqueue.c:2405
worker_thread+0x67d/0x10c0 kernel/workqueue.c:2552
kthread+0x33e/0x440 kernel/kthread.c:379
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308
</TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:dev_name include/linux/device.h:706 [inline]
RIP: 0010:__dev_printk+0x3b/0x270 drivers/base/core.c:4869
Code: f5 53 e8 88 8e 6f fc 48 85 ed 0f 84 cb 01 00 00 e8 7a 8e 6f fc 48 8d 7d 50 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 <80> 3c 02 00 0f 85 d7 01 00 00 48 8b 5d 50 48 85 db 0f 84 b5 00 00
RSP: 0018:ffffc90004c66f70 EFLAGS: 00010202
RAX: dffffc0000000000 RBX: fffff5200098cdf5 RCX: ffffc90014c8c000
RDX: 0000000000000068 RSI: ffffffff8513c496 RDI: 0000000000000340
RBP: 00000000000002f0 R08: 0000000000000005 R09: 0000000000000000
R10: 00000000ffffff92 R11: 0000000000000000 R12: ffffffff8ace0700
R13: ffffc90004c66fc8 R14: ffff88804962d264 R15: 0000000000000000
FS: 0000000000000000(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000000c012c4b000 CR3: 000000002c080000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
0: f5 cmc
1: 53 push %rbx
2: e8 88 8e 6f fc callq 0xfc6f8e8f
7: 48 85 ed test %rbp,%rbp
a: 0f 84 cb 01 00 00 je 0x1db
10: e8 7a 8e 6f fc callq 0xfc6f8e8f
15: 48 8d 7d 50 lea 0x50(%rbp),%rdi
19: 48 b8 00 00 00 00 00 movabs $0xdffffc0000000000,%rax
20: fc ff df
23: 48 89 fa mov %rdi,%rdx
26: 48 c1 ea 03 shr $0x3,%rdx
* 2a: 80 3c 02 00 cmpb $0x0,(%rdx,%rax,1) <-- trapping instruction
2e: 0f 85 d7 01 00 00 jne 0x20b
34: 48 8b 5d 50 mov 0x50(%rbp),%rbx
38: 48 85 db test %rbx,%rbx
3b: 0f .byte 0xf
3c: 84 .byte 0x84
3d: b5 00 mov $0x0,%ch


---
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

unread,
Apr 29, 2023, 9:47:44 AM4/29/23
to chao...@gmail.com, dan.ca...@linaro.org, dmitry....@gmail.com, dz...@hust.edu.cn, err...@gmail.com, gre...@linuxfoundation.org, hust-os-ker...@googlegroups.com, kernel-...@vger.kernel.org, linux...@vger.kernel.org, linux-...@vger.kernel.org, linu...@vger.kernel.org, matthias...@gmail.com, mkorpe...@baylibre.com, mudongl...@gmail.com, na...@yocom.org, pgri...@valvesoftware.com, radon...@gmail.com, raf...@kernel.org, rojt...@gmail.com, s.dem...@gmail.com, syzkall...@googlegroups.com, v...@endrift.com
syzbot has found a reproducer for the following issue on:

HEAD commit: 92e815cf07ed Add linux-next specific files for 20230428
git tree: linux-next
console output: https://syzkaller.appspot.com/x/log.txt?x=104cb844280000
kernel config: https://syzkaller.appspot.com/x/.config?x=c8c8ae4d47d23592
dashboard link: https://syzkaller.appspot.com/bug?extid=a3f758b8d8cb7e49afec
compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=14a5408c280000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=10d3b0e4280000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/c9e94856e6c9/disk-92e815cf.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/4c1c05a548a7/vmlinux-92e815cf.xz
kernel image: https://storage.googleapis.com/syzbot-assets/2a1bff6a133b/bzImage-92e815cf.xz

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

usb 1-1: config 0 has no interface number 0
usb 1-1: New USB device found, idVendor=1949, idProduct=5e70, bcdDevice=d7.a2
usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
usb 1-1: config 0 descriptor??
usb 1-1: string descriptor 0 read error: -71
general protection fault, probably for non-canonical address 0xdffffc0000000068: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x0000000000000340-0x0000000000000347]
CPU: 0 PID: 9 Comm: kworker/0:1 Not tainted 6.3.0-next-20230428-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/14/2023
Workqueue: usb_hub_wq hub_event
RIP: 0010:dev_name include/linux/device.h:706 [inline]
RIP: 0010:__dev_printk+0x3b/0x270 drivers/base/core.c:4863
Code: f5 53 e8 c8 c3 6b fc 48 85 ed 0f 84 cb 01 00 00 e8 ba c3 6b fc 48 8d 7d 50 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 <80> 3c 02 00 0f 85 d7 01 00 00 48 8b 5d 50 48 85 db 0f 84 b5 00 00
RSP: 0018:ffffc900000e6f70 EFLAGS: 00010202
RAX: dffffc0000000000 RBX: fffff5200001cdf5 RCX: 0000000000000000
RDX: 0000000000000068 RSI: ffffffff85188a06 RDI: 0000000000000340
RBP: 00000000000002f0 R08: 0000000000000005 R09: 0000000000000000
R10: 00000000ffffffb9 R11: ffffffff81d6ff05 R12: ffffffff8ace98e0
R13: ffffc900000e6fc8 R14: ffff88801ed25a64 R15: 0000000000000000
FS: 0000000000000000(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f1361dc1111 CR3: 00000000210fe000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
_dev_warn+0xdc/0x120 drivers/base/core.c:4907
xpad_probe+0x197e/0x2020 drivers/input/joystick/xpad.c:2053
usb_probe_interface+0x30f/0x960 drivers/usb/core/driver.c:396
call_driver_probe drivers/base/dd.c:579 [inline]
really_probe+0x240/0xca0 drivers/base/dd.c:658
__driver_probe_device+0x1df/0x4b0 drivers/base/dd.c:800
driver_probe_device+0x4c/0x1a0 drivers/base/dd.c:830
__device_attach_driver+0x1d4/0x2e0 drivers/base/dd.c:958
bus_for_each_drv+0x149/0x1d0 drivers/base/bus.c:457
__device_attach+0x1e4/0x4b0 drivers/base/dd.c:1030
bus_probe_device+0x17c/0x1c0 drivers/base/bus.c:532
device_add+0x112d/0x1a40 drivers/base/core.c:3625
usb_set_configuration+0x1196/0x1bc0 drivers/usb/core/message.c:2211
usb_generic_driver_probe+0xcf/0x130 drivers/usb/core/generic.c:238
usb_probe_device+0xd8/0x2c0 drivers/usb/core/driver.c:293
call_driver_probe drivers/base/dd.c:579 [inline]
really_probe+0x240/0xca0 drivers/base/dd.c:658
__driver_probe_device+0x1df/0x4b0 drivers/base/dd.c:800
driver_probe_device+0x4c/0x1a0 drivers/base/dd.c:830
__device_attach_driver+0x1d4/0x2e0 drivers/base/dd.c:958
bus_for_each_drv+0x149/0x1d0 drivers/base/bus.c:457
__device_attach+0x1e4/0x4b0 drivers/base/dd.c:1030
bus_probe_device+0x17c/0x1c0 drivers/base/bus.c:532
device_add+0x112d/0x1a40 drivers/base/core.c:3625
usb_new_device+0xcb2/0x19d0 drivers/usb/core/hub.c:2575
hub_port_connect drivers/usb/core/hub.c:5407 [inline]
hub_port_connect_change drivers/usb/core/hub.c:5551 [inline]
port_event drivers/usb/core/hub.c:5711 [inline]
hub_event+0x2d9e/0x4e40 drivers/usb/core/hub.c:5793
process_one_work+0x99a/0x15e0 kernel/workqueue.c:2405
worker_thread+0x67d/0x10c0 kernel/workqueue.c:2552
kthread+0x344/0x440 kernel/kthread.c:379
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308
</TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:dev_name include/linux/device.h:706 [inline]
RIP: 0010:__dev_printk+0x3b/0x270 drivers/base/core.c:4863
Code: f5 53 e8 c8 c3 6b fc 48 85 ed 0f 84 cb 01 00 00 e8 ba c3 6b fc 48 8d 7d 50 48 b8 00 00 00 00 00 fc ff df 48 89
----------------
Code disassembly (best guess):
0: f5 cmc
1: 53 push %rbx
2: e8 c8 c3 6b fc callq 0xfc6bc3cf
7: 48 85 ed test %rbp,%rbp
a: 0f 84 cb 01 00 00 je 0x1db
10: e8 ba c3 6b fc callq 0xfc6bc3cf
15: 48 8d 7d 50 lea 0x50(%rbp),%rdi
19: 48 b8 00 00 00 00 00 movabs $0xdffffc0000000000,%rax
20: fc ff df
23: 48 89 fa mov %rdi,%rdx
26: 48 c1 ea 03 shr $0x3,%rdx
* 2a: 80 3c 02 00 cmpb $0x0,(%rdx,%rax,1) <-- trapping instruction
2e: 0f 85 d7 01 00 00 jne 0x20b
34: 48 8b 5d 50 mov 0x50(%rbp),%rbx
38: 48 85 db test %rbx,%rbx
3b: 0f .byte 0xf
3c: 84 .byte 0x84
3d: b5 00 mov $0x0,%ch


---
If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.

Alan Stern

unread,
Apr 29, 2023, 2:09:40 PM4/29/23
to syzbot, dmitry....@gmail.com, chao...@gmail.com, dan.ca...@linaro.org, dz...@hust.edu.cn, err...@gmail.com, gre...@linuxfoundation.org, hust-os-ker...@googlegroups.com, kernel-...@vger.kernel.org, linux...@vger.kernel.org, linux-...@vger.kernel.org, linu...@vger.kernel.org, matthias...@gmail.com, mkorpe...@baylibre.com, mudongl...@gmail.com, na...@yocom.org, pgri...@valvesoftware.com, radon...@gmail.com, raf...@kernel.org, rojt...@gmail.com, s.dem...@gmail.com, syzkall...@googlegroups.com, v...@endrift.com
Dmitry:
It looks like the problem is caused by commit db7220c48d8d ("Input:
xpad - fix support for some third-party controllers"). In the line

dev_warn(&xpad->dev->dev,

the xpad->dev ought to be xpad->udev.

Alan Stern

Hillf Danton

unread,
Apr 29, 2023, 9:45:45 PM4/29/23
to syzbot, linux-...@vger.kernel.org, syzkall...@googlegroups.com
On 29 Apr 2023 06:47:43 -0700
> HEAD commit: 92e815cf07ed Add linux-next specific files for 20230428
> git tree: linux-next
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=10d3b0e4280000

Print warning for the correct dev.

#syz test https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git 92e815cf07ed

--- x/drivers/input/joystick/xpad.c
+++ y/drivers/input/joystick/xpad.c
@@ -2050,7 +2050,7 @@ static int xpad_probe(struct usb_interfa
dummy, sizeof(dummy),
25, GFP_KERNEL);
if (error)
- dev_warn(&xpad->dev->dev,
+ dev_warn(&udev->dev,
"unable to receive magic message: %d\n",
error);
}
--

syzbot

unread,
Apr 29, 2023, 10:43:25 PM4/29/23
to hda...@sina.com, linux-...@vger.kernel.org, syzkall...@googlegroups.com
Hello,

syzbot has tested the proposed patch and the reproducer did not trigger any issue:

Reported-and-tested-by: syzbot+a3f758...@syzkaller.appspotmail.com

Tested on:

commit: 92e815cf Add linux-next specific files for 20230428
git tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
console output: https://syzkaller.appspot.com/x/log.txt?x=17eb28f8280000
kernel config: https://syzkaller.appspot.com/x/.config?x=c8c8ae4d47d23592
dashboard link: https://syzkaller.appspot.com/bug?extid=a3f758b8d8cb7e49afec
compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2
patch: https://syzkaller.appspot.com/x/patch.diff?x=1578fdf0280000

Note: testing is done by a robot and is best-effort only.

syzbot

unread,
Apr 30, 2023, 1:19:26 AM4/30/23
to chao...@gmail.com, dan.ca...@linaro.org, dmitry....@gmail.com, dz...@hust.edu.cn, err...@gmail.com, gre...@linuxfoundation.org, hda...@sina.com, hust-os-ker...@googlegroups.com, kernel-...@vger.kernel.org, linux...@vger.kernel.org, linux-...@vger.kernel.org, linu...@vger.kernel.org, matthias...@gmail.com, mkorpe...@baylibre.com, mudongl...@gmail.com, na...@yocom.org, pgri...@valvesoftware.com, radon...@gmail.com, raf...@kernel.org, rojt...@gmail.com, s.dem...@gmail.com, st...@rowland.harvard.edu, syzkall...@googlegroups.com, v...@endrift.com
syzbot has bisected this issue to:

commit db7220c48d8d71476f881a7ae1285e1df4105409
Author: Vicki Pfau <v...@endrift.com>
Date: Fri Mar 24 17:42:27 2023 +0000

Input: xpad - fix support for some third-party controllers

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=1028a1f8280000
start commit: 92e815cf07ed Add linux-next specific files for 20230428
git tree: linux-next
final oops: https://syzkaller.appspot.com/x/report.txt?x=1228a1f8280000
console output: https://syzkaller.appspot.com/x/log.txt?x=1428a1f8280000
Reported-by: syzbot+a3f758...@syzkaller.appspotmail.com
Fixes: db7220c48d8d ("Input: xpad - fix support for some third-party controllers")

For information about bisection process see: https://goo.gl/tpsmEJ#bisection

Dongliang Mu

unread,
Apr 30, 2023, 4:48:30 AM4/30/23
to Alan Stern, syzbot, dmitry....@gmail.com, chao...@gmail.com, dan.ca...@linaro.org, err...@gmail.com, gre...@linuxfoundation.org, hust-os-ker...@googlegroups.com, kernel-...@vger.kernel.org, linux...@vger.kernel.org, linux-...@vger.kernel.org, linu...@vger.kernel.org, matthias...@gmail.com, mkorpe...@baylibre.com, mudongl...@gmail.com, na...@yocom.org, pgri...@valvesoftware.com, radon...@gmail.com, raf...@kernel.org, rojt...@gmail.com, s.dem...@gmail.com, syzkall...@googlegroups.com, v...@endrift.com
Hi Alan,

Vicki had prepared and sent a patch to fix this kernel bug. Please take
a look at the following threads[1][2].


[1] https://www.spinics.net/lists/linux-input/msg84905.html

[2] https://groups.google.com/g/hust-os-kernel-patches/c/CQY-rdr4kqE
Reply all
Reply to author
Forward
0 new messages