syzbot


general protection fault in __media_entity_remove_link
Status: upstream: reported on 2022/02/15 11:10
Reported-by: syzbot+3a40339fb2628236d307@syzkaller.appspotmail.com
First crash: 105d, last: 39d

Sample crash report:
usb 3-1: USB disconnect, device number 3
general protection fault, probably for non-canonical address 0xdffffc0000000003: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x0000000000000018-0x000000000000001f]
CPU: 0 PID: 4036 Comm: kworker/0:4 Not tainted 5.17.0-rc6-syzkaller-00100-g98d107b84614 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Workqueue: usb_hub_wq hub_event
RIP: 0010:__media_entity_remove_link+0x53/0xa10 drivers/media/mc/mc-entity.c:590
Code: 48 89 fa 48 c1 ea 03 80 3c 02 00 0f 85 14 09 00 00 48 b8 00 00 00 00 00 fc ff df 49 8b 5e 30 48 8d 7b 20 48 89 fa 48 c1 ea 03 <80> 3c 02 00 0f 85 e7 08 00 00 4c 8b 7b 20 4c 3b 7c 24 18 0f 84 84
RSP: 0018:ffffc900015f7450 EFLAGS: 00010207
RAX: dffffc0000000000 RBX: ffffffffffffffff RCX: ffffc90007c42000
RDX: 0000000000000003 RSI: ffffffff8412203b RDI: 000000000000001f
RBP: ffffffffffffffff R08: 0000000000000001 R09: ffffffff8a7ed7cf
R10: 0000000000000001 R11: 0000000000000000 R12: ffff888131f6c300
R13: ffff888131f6c350 R14: ffff888231f6c330 R15: ffff888231f6c330
FS:  0000000000000000(0000) GS:ffff8881f6800000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000001b2c22c000 CR3: 0000000131615000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 __media_entity_remove_links+0x86/0x160 drivers/media/mc/mc-entity.c:768
 __media_device_unregister_entity+0x187/0x300 drivers/media/mc/mc-device.c:597
 media_device_unregister_entity+0x49/0x70 drivers/media/mc/mc-device.c:689
 dvb_media_device_free+0x1d5/0x680 drivers/media/dvb-core/dvbdev.c:216
 dvb_remove_device.part.0+0x9c/0x260 drivers/media/dvb-core/dvbdev.c:558
 dvb_remove_device drivers/media/dvb-core/dvbdev.c:551 [inline]
 dvb_unregister_device+0x1b/0x60 drivers/media/dvb-core/dvbdev.c:580
 dvb_dmxdev_release+0x1a0/0x630 drivers/media/dvb-core/dmxdev.c:1461
 dvb_usb_adapter_dvb_exit+0x93/0x230 drivers/media/usb/dvb-usb/dvb-usb-dvb.c:224
 dvb_usb_adapter_exit drivers/media/usb/dvb-usb/dvb-usb-init.c:126 [inline]
 dvb_usb_exit drivers/media/usb/dvb-usb/dvb-usb-init.c:141 [inline]
 dvb_usb_device_exit+0x20a/0x510 drivers/media/usb/dvb-usb/dvb-usb-init.c:336
 usb_unbind_interface+0x1d8/0x8e0 drivers/usb/core/driver.c:458
 __device_release_driver+0x627/0x760 drivers/base/dd.c:1209
 device_release_driver_internal drivers/base/dd.c:1242 [inline]
 device_release_driver+0x26/0x40 drivers/base/dd.c:1265
 bus_remove_device+0x2eb/0x5a0 drivers/base/bus.c:529
 device_del+0x4f3/0xc80 drivers/base/core.c:3592
 usb_disable_device+0x35b/0x7b0 drivers/usb/core/message.c:1419
 usb_disconnect.cold+0x27a/0x78e drivers/usb/core/hub.c:2228
 hub_port_connect drivers/usb/core/hub.c:5207 [inline]
 hub_port_connect_change drivers/usb/core/hub.c:5507 [inline]
 port_event drivers/usb/core/hub.c:5665 [inline]
 hub_event+0x1e39/0x44d0 drivers/usb/core/hub.c:5747
 process_one_work+0x9ac/0x1650 kernel/workqueue.c:2307
 worker_thread+0x657/0x1110 kernel/workqueue.c:2454
 kthread+0x2ef/0x3a0 kernel/kthread.c:377
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:__media_entity_remove_link+0x53/0xa10 drivers/media/mc/mc-entity.c:590
Code: 48 89 fa 48 c1 ea 03 80 3c 02 00 0f 85 14 09 00 00 48 b8 00 00 00 00 00 fc ff df 49 8b 5e 30 48 8d 7b 20 48 89 fa 48 c1 ea 03 <80> 3c 02 00 0f 85 e7 08 00 00 4c 8b 7b 20 4c 3b 7c 24 18 0f 84 84
RSP: 0018:ffffc900015f7450 EFLAGS: 00010207
RAX: dffffc0000000000 RBX: ffffffffffffffff RCX: ffffc90007c42000
RDX: 0000000000000003 RSI: ffffffff8412203b RDI: 000000000000001f
RBP: ffffffffffffffff R08: 0000000000000001 R09: ffffffff8a7ed7cf
R10: 0000000000000001 R11: 0000000000000000 R12: ffff888131f6c300
R13: ffff888131f6c350 R14: ffff888231f6c330 R15: ffff888231f6c330
FS:  0000000000000000(0000) GS:ffff8881f6800000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000001b2c22c000 CR3: 0000000131615000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
   0:	48 89 fa             	mov    %rdi,%rdx
   3:	48 c1 ea 03          	shr    $0x3,%rdx
   7:	80 3c 02 00          	cmpb   $0x0,(%rdx,%rax,1)
   b:	0f 85 14 09 00 00    	jne    0x925
  11:	48 b8 00 00 00 00 00 	movabs $0xdffffc0000000000,%rax
  18:	fc ff df
  1b:	49 8b 5e 30          	mov    0x30(%r14),%rbx
  1f:	48 8d 7b 20          	lea    0x20(%rbx),%rdi
  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 e7 08 00 00    	jne    0x91b
  34:	4c 8b 7b 20          	mov    0x20(%rbx),%r15
  38:	4c 3b 7c 24 18       	cmp    0x18(%rsp),%r15
  3d:	0f                   	.byte 0xf
  3e:	84                   	.byte 0x84
  3f:	84                   	.byte 0x84

Crashes (5):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci2-upstream-usb 2022/03/04 14:16 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 98d107b84614 45a13a73 .config log report info general protection fault in __media_entity_remove_link
ci2-upstream-usb 2022/02/25 23:45 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing f6a9a2d64dd1 45a13a73 .config log report info general protection fault in __media_entity_remove_link
ci2-upstream-usb 2022/02/19 23:19 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing a5d847b0afd3 3cd800e4 .config log report info general protection fault in __media_entity_remove_link
ci2-upstream-usb 2022/02/11 10:49 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing c3c9cee59282 0b33604d .config log report info general protection fault in __media_entity_remove_link
ci2-upstream-usb 2022/04/18 17:43 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 312310928417 8bcc32a6 .config log report info BUG: unable to handle kernel paging request in __media_entity_remove_link