syzbot


WARNING in media_create_pad_link

Status: upstream: reported C repro on 2020/05/14 20:18
Reported-by: syzbot+dd320d114deb3f5bb79b@syzkaller.appspotmail.com
First crash: 783d, last: 115d

Cause bisection: introduced by (bisect log) :
commit f2c2e717642c66f7fe7e5dd69b2e8ff5849f4d10
Author: Andrey Konovalov <andreyknvl@google.com>
Date: Mon Feb 24 16:13:03 2020 +0000

  usb: gadget: add raw-gadget interface

Crash: KASAN: use-after-free Read in __media_entity_remove_links (log)
Repro: C syz .config

Fix bisection: fixed by (bisect log) :
commit adb6e6ac20eedcf1dce19dc75b224e63c0828ea1
Author: Bastien Nocera <hadess@hadess.net>
Date: Tue Aug 18 11:04:43 2020 +0000

  USB: Also match device drivers using the ->match vfunc


Sample crash report:
usb 5-1: config 0 has 1 interface, different from the descriptor's value: 65
usb 5-1: New USB device found, idVendor=0bd3, idProduct=0555, bcdDevice=69.6a
usb 5-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
usb 5-1: config 0 descriptor??
usb 5-1: string descriptor 0 read error: -71
usb 5-1: Found UVC 0.00 device <unnamed> (0bd3:0555)
uvcvideo 5-1:0.0: Entity type for entity Output 1 was not initialized!
------------[ cut here ]------------
WARNING: CPU: 3 PID: 969 at drivers/media/mc/mc-entity.c:649 media_create_pad_link+0x4de/0x650 drivers/media/mc/mc-entity.c:649
Modules linked in:
CPU: 3 PID: 969 Comm: kworker/3:2 Not tainted 5.17.0-rc7-syzkaller-00235-gaad611a868d1 #0
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-2 04/01/2014
Workqueue: usb_hub_wq hub_event
RIP: 0010:media_create_pad_link+0x4de/0x650 drivers/media/mc/mc-entity.c:649
Code: e8 49 8e fb 44 89 e0 48 83 c4 18 5b 5d 41 5c 41 5d 41 5e 41 5f c3 e8 d1 49 8e fb 0f 0b 41 bc ea ff ff ff eb da e8 c2 49 8e fb <0f> 0b 41 bc ea ff ff ff eb cb e8 b3 49 8e fb 0f 0b 41 bc ea ff ff
RSP: 0018:ffffc90004e36e98 EFLAGS: 00010293
RAX: 0000000000000000 RBX: ffff88801857c880 RCX: 0000000000000000
RDX: ffff888013f58000 RSI: ffffffff85e9abce RDI: 0000000000000003
RBP: ffff88801c1aa880 R08: 0000000000000003 R09: 0000000000000001
R10: ffffffff85e9a765 R11: 0000000000000000 R12: 0000000000000001
R13: 0000000000000000 R14: 0000000000000000 R15: ffff88801c1aa880
FS:  0000000000000000(0000) GS:ffff88802cd00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000563eeb0b7f70 CR3: 000000002140f000 CR4: 0000000000150ee0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 uvc_mc_create_links drivers/media/usb/uvc/uvc_entity.c:50 [inline]
 uvc_mc_register_entities+0x5cd/0x910 drivers/media/usb/uvc/uvc_entity.c:151
 uvc_register_chains drivers/media/usb/uvc/uvc_driver.c:2331 [inline]
 uvc_probe.cold+0x283b/0x2bef drivers/media/usb/uvc/uvc_driver.c:2468
 usb_probe_interface+0x315/0x7f0 drivers/usb/core/driver.c:396
 call_driver_probe drivers/base/dd.c:517 [inline]
 really_probe+0x245/0xcc0 drivers/base/dd.c:596
 __driver_probe_device+0x338/0x4d0 drivers/base/dd.c:755
 driver_probe_device+0x4c/0x1a0 drivers/base/dd.c:785
 __device_attach_driver+0x20b/0x2f0 drivers/base/dd.c:902
 bus_for_each_drv+0x15f/0x1e0 drivers/base/bus.c:427
 __device_attach+0x228/0x4a0 drivers/base/dd.c:973
 bus_probe_device+0x1e4/0x290 drivers/base/bus.c:487
 device_add+0xb83/0x1e20 drivers/base/core.c:3405
 usb_set_configuration+0x101e/0x1900 drivers/usb/core/message.c:2170
 usb_generic_driver_probe+0xba/0x100 drivers/usb/core/generic.c:238
 usb_probe_device+0xd9/0x2c0 drivers/usb/core/driver.c:293
 call_driver_probe drivers/base/dd.c:517 [inline]
 really_probe+0x245/0xcc0 drivers/base/dd.c:596
 __driver_probe_device+0x338/0x4d0 drivers/base/dd.c:755
 driver_probe_device+0x4c/0x1a0 drivers/base/dd.c:785
 __device_attach_driver+0x20b/0x2f0 drivers/base/dd.c:902
 bus_for_each_drv+0x15f/0x1e0 drivers/base/bus.c:427
 __device_attach+0x228/0x4a0 drivers/base/dd.c:973
 bus_probe_device+0x1e4/0x290 drivers/base/bus.c:487
 device_add+0xb83/0x1e20 drivers/base/core.c:3405
 usb_new_device.cold+0x63f/0x108e drivers/usb/core/hub.c:2566
 hub_port_connect drivers/usb/core/hub.c:5358 [inline]
 hub_port_connect_change drivers/usb/core/hub.c:5502 [inline]
 port_event drivers/usb/core/hub.c:5660 [inline]
 hub_event+0x2585/0x44d0 drivers/usb/core/hub.c:5742
 process_one_work+0x9ac/0x1650 kernel/workqueue.c:2307
 worker_thread+0x657/0x1110 kernel/workqueue.c:2454
 kthread+0x2e9/0x3a0 kernel/kthread.c:377
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295
 </TASK>

Crashes (51):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci-qemu-upstream 2022/03/13 08:21 upstream aad611a868d1 9e8eaa75 .config log report syz C WARNING in media_create_pad_link
ci-qemu-upstream 2022/03/04 20:07 upstream 38f80f42147f 45a13a73 .config log report syz C WARNING in media_create_pad_link
ci-upstream-kasan-gce-selinux-root 2022/02/21 18:41 upstream cfb92440ee71 3cd800e4 .config log report syz C WARNING in media_create_pad_link
ci-upstream-kasan-gce-smack-root 2022/01/06 05:43 upstream 49ef78e59b07 6acc789a .config log report syz C WARNING in media_create_pad_link
ci-upstream-kasan-gce-root 2021/12/20 17:08 upstream a7904a538933 021b36cb .config log report syz C WARNING in media_create_pad_link
ci-upstream-kasan-gce-selinux-root 2021/07/08 07:00 upstream 3dbdb38e2869 95793bce .config log report syz C WARNING in media_create_pad_link
ci-upstream-kasan-gce 2021/06/20 17:36 upstream 913ec3c22ef4 aba2b2fb .config log report syz C WARNING in media_create_pad_link
ci-upstream-kasan-gce-smack-root 2021/05/29 07:46 upstream 5ff2756afde0 858ea628 .config log report syz C WARNING in media_create_pad_link
ci-upstream-kasan-gce-root 2021/05/26 11:56 upstream ad9f25d33860 54f0bcf1 .config log report syz C WARNING in media_create_pad_link
ci-upstream-linux-next-kasan-gce-root 2021/06/20 00:46 linux-next a1f92694393a aba2b2fb .config log report syz C WARNING in media_create_pad_link
ci-upstream-kasan-gce-root 2020/05/29 22:00 upstream 75caf310d16c 3905eaae .config log report syz C
ci-upstream-kasan-gce 2020/05/28 22:06 upstream b0c3ba31be3e 0d951763 .config log report syz C
ci-upstream-kasan-gce-selinux-root 2020/05/21 21:34 upstream b85051e755b0 1f30020f .config log report syz C
ci-upstream-kasan-gce-root 2020/05/21 19:55 upstream b85051e755b0 1f30020f .config log report syz C
ci-upstream-kasan-gce-smack-root 2020/05/21 16:00 upstream b85051e755b0 1f30020f .config log report syz C
ci2-upstream-usb 2020/12/08 06:16 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 08a02f954b0d 51a9082e .config log report syz C
ci-upstream-linux-next-kasan-gce-root 2020/05/28 22:01 linux-next ff387fc20c69 0d951763 .config log report syz C
ci2-upstream-usb 2020/05/28 21:37 https://github.com/google/kasan.git usb-fuzzer d19c64b3d097 c7192a2f .config log report syz C
ci2-upstream-usb 2020/05/14 03:16 https://github.com/google/kasan.git usb-fuzzer 059e7e0ff26c a885920d .config log report syz C
ci-upstream-kasan-gce-386 2020/05/28 22:10 upstream b0c3ba31be3e 0d951763 .config log report syz
ci-upstream-kasan-gce 2022/02/22 18:19 upstream 038101e6b2cd 6e821dbf .config log report info WARNING in media_create_pad_link
ci-upstream-kasan-gce-root 2021/12/16 04:04 upstream 2b14864acbaa 572bcb40 .config log report info WARNING in media_create_pad_link
ci-upstream-kasan-gce-root 2021/04/12 23:31 upstream d434405aaab7 bfeda1b1 .config log report info WARNING in media_create_pad_link
ci-upstream-kasan-gce-smack-root 2021/04/02 18:15 upstream 1678e493d530 6a81331a .config log report info WARNING in media_create_pad_link
ci-upstream-kasan-gce 2021/04/02 13:53 upstream 1678e493d530 6a81331a .config log report info WARNING in media_create_pad_link
ci-upstream-kasan-gce 2021/04/02 11:00 upstream ffd9fb546d49 6a81331a .config log report info WARNING in media_create_pad_link
ci-upstream-kasan-gce-386 2022/01/15 11:18 upstream 112450df61b7 723cfaf0 .config log report info WARNING in media_create_pad_link
ci-upstream-kasan-gce-386 2021/05/13 23:57 upstream c06a2ba62fc4 80f9b418 .config log report info WARNING in media_create_pad_link
ci-upstream-kasan-gce-386 2021/05/10 05:38 upstream 6efb943b8616 bc5434be .config log report info WARNING in media_create_pad_link
ci-upstream-kasan-gce-386 2021/05/07 05:05 upstream d2b6f8a17919 06585184 .config log report info WARNING in media_create_pad_link
ci-upstream-kasan-gce-386 2021/04/02 16:11 upstream 1678e493d530 6a81331a .config log report info WARNING in media_create_pad_link
ci2-upstream-usb 2021/10/29 06:42 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 79a4479a17b8 be531bb4 .config log report info WARNING in media_create_pad_link
ci2-upstream-usb 2021/10/28 18:34 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 79a4479a17b8 be531bb4 .config log report info WARNING in media_create_pad_link
ci2-upstream-usb 2021/05/09 18:02 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 31a8503589c4 bc5434be .config log report info WARNING in media_create_pad_link
ci2-upstream-usb 2021/04/20 00:07 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 4b853c236c7b 4285c989 .config log report info WARNING in media_create_pad_link
ci2-upstream-usb 2021/04/15 16:07 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 4b853c236c7b fcdb12ba .config log report info WARNING in media_create_pad_link
ci2-upstream-usb 2021/04/11 10:51 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 3db53374405f 6a81331a .config log report info WARNING in media_create_pad_link
ci2-upstream-usb 2021/04/10 09:47 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 496960274153 6a81331a .config log report info WARNING in media_create_pad_link
ci-upstream-linux-next-kasan-gce-root 2021/04/02 11:44 linux-next 454c576c3f5e 6a81331a .config log report info WARNING in media_create_pad_link
ci2-upstream-usb 2021/04/02 11:37 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing e5242861ec6a 6a81331a .config log report info WARNING in media_create_pad_link
ci2-upstream-usb 2021/03/24 06:21 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 049d3db625a6 e613994b .config log report info WARNING in media_create_pad_link
ci2-upstream-usb 2021/02/05 18:07 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 23e32a595e11 23a562df .config log report info WARNING in media_create_pad_link
ci2-upstream-usb 2021/02/01 01:47 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 3c648d3deb0f fc9fd31e .config log report info WARNING in media_create_pad_link
ci-upstream-kasan-gce-root 2020/08/14 15:59 upstream a1d21081a60d 424dd8e7 .config log report
ci-upstream-kasan-gce-selinux-root 2020/07/03 14:33 upstream cd77006e01b3 bed10395 .config log report
ci2-upstream-usb 2020/12/13 22:10 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing a256e24021bf 8f160dd5 .config log report info
ci2-upstream-usb 2020/06/28 12:22 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing b3a5ce874c26 a2cdad9d .config log report
ci2-upstream-usb 2020/06/16 14:49 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing b3a9e3b9622a 4ea9d964 .config log report
ci2-upstream-usb 2020/06/12 17:08 https://github.com/google/kasan.git usb-fuzzer b791d1bdf921 3036d6fd .config log report