syzbot


KASAN: use-after-free Read in ax88172a_unbind

Status: fixed on 2020/09/16 22:51
Subsystems: usb
[Documentation on labels]
Reported-by: syzbot+4cd84f527bf4a10fc9c1@syzkaller.appspotmail.com
Fix commit: c28d9a285668 ax88172a: fix ax88172a_unbind() failures
First crash: 1465d, last: 1225d
Cause bisection: introduced by (bisect log) [ignored commit]:
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 ax88172a_unbind (log)
Repro: C syz .config
  
Discussions (10)
Title Replies (including bot) Last reply
[PATCH 4.4 00/54] 4.4.232-rc1 review 57 (57) 2020/07/31 12:47
[PATCH 4.9 00/61] 4.9.232-rc1 review 64 (64) 2020/07/31 12:43
[PATCH 5.7 000/179] 5.7.11-rc1 review 187 (187) 2020/07/29 08:22
[PATCH 4.19 00/86] 4.19.135-rc1 review 109 (109) 2020/07/28 21:18
[PATCH 5.4 000/138] 5.4.54-rc1 review 143 (143) 2020/07/28 18:23
[PATCH 4.14 00/64] 4.14.190-rc1 review 68 (68) 2020/07/28 18:22
[PATCH v2 1/1] ax88172a: fix ax88172a_unbind() failures 2 (2) 2020/07/16 01:30
[PATCH 1/1] ax88172a: fix ax88172a_unbind() failures 7 (7) 2020/07/15 14:01
[PATCH 1/1] ax88172a: fix ax88172a_unbind() failures 2 (2) 2020/07/10 21:42
KASAN: use-after-free Read in ax88172a_unbind 0 (1) 2019/11/29 21:05
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
android-54 KASAN: use-after-free Read in ax88172a_unbind C 38 1224d 1339d 1/2 fixed on 2021/10/13 19:27
Last patch testing requests (2)
Created Duration User Patch Repo Result
2019/12/14 06:40 10m tranmanphong@gmail.com patch https://github.com/google/kasan.git 32b5e2b2 report log
2019/12/02 14:09 10m tranmanphong@gmail.com patch https://github.com/google/kasan.git 32b5e2b2 report log

Sample crash report:
asix 1-1:0.0 eth1: register 'asix' at usb-dummy_hcd.0-1, ASIX AX88172A USB 2.0 Ethernet, c6:0a:e9:e6:07:9a
usb 1-1: USB disconnect, device number 2
asix 1-1:0.0 eth1: unregister 'asix' usb-dummy_hcd.0-1, ASIX AX88172A USB 2.0 Ethernet
==================================================================
BUG: KASAN: use-after-free in ax88172a_remove_mdio drivers/net/usb/ax88172a.c:112 [inline]
BUG: KASAN: use-after-free in ax88172a_unbind+0x76/0xe7 drivers/net/usb/ax88172a.c:263
Read of size 8 at addr ffff8880a6be3700 by task kworker/1:0/17

CPU: 1 PID: 17 Comm: kworker/1:0 Not tainted 5.7.0-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Workqueue: usb_hub_wq hub_event
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x188/0x20d lib/dump_stack.c:118
 print_address_description.constprop.0.cold+0xd3/0x413 mm/kasan/report.c:383
 __kasan_report mm/kasan/report.c:513 [inline]
 kasan_report.cold+0x1f/0x37 mm/kasan/report.c:530
 ax88172a_remove_mdio drivers/net/usb/ax88172a.c:112 [inline]
 ax88172a_unbind+0x76/0xe7 drivers/net/usb/ax88172a.c:263
 usbnet_disconnect+0x145/0x270 drivers/net/usb/usbnet.c:1618
 usb_unbind_interface+0x1bd/0x8a0 drivers/usb/core/driver.c:436
 __device_release_driver drivers/base/dd.c:1110 [inline]
 device_release_driver_internal+0x432/0x500 drivers/base/dd.c:1141
 bus_remove_device+0x2dc/0x4a0 drivers/base/bus.c:533
 device_del+0x481/0xd30 drivers/base/core.c:2734
 usb_disable_device+0x211/0x690 drivers/usb/core/message.c:1245
 usb_disconnect+0x284/0x8d0 drivers/usb/core/hub.c:2217
 hub_port_connect drivers/usb/core/hub.c:5059 [inline]
 hub_port_connect_change drivers/usb/core/hub.c:5348 [inline]
 port_event drivers/usb/core/hub.c:5494 [inline]
 hub_event+0x17ca/0x38f0 drivers/usb/core/hub.c:5576
 process_one_work+0x965/0x16a0 kernel/workqueue.c:2268
 worker_thread+0x96/0xe20 kernel/workqueue.c:2414
 kthread+0x388/0x470 kernel/kthread.c:268
 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:351

Allocated by task 17:
 save_stack+0x1b/0x40 mm/kasan/common.c:48
 set_track mm/kasan/common.c:56 [inline]
 __kasan_kmalloc mm/kasan/common.c:494 [inline]
 __kasan_kmalloc.constprop.0+0xbf/0xd0 mm/kasan/common.c:467
 kmem_cache_alloc_trace+0x153/0x7d0 mm/slab.c:3551
 kmalloc include/linux/slab.h:555 [inline]
 kzalloc include/linux/slab.h:669 [inline]
 ax88172a_bind+0xa3/0x751 drivers/net/usb/ax88172a.c:180
 usbnet_probe+0xb36/0x2600 drivers/net/usb/usbnet.c:1737
 usb_probe_interface+0x305/0x7a0 drivers/usb/core/driver.c:374
 really_probe+0x281/0x6d0 drivers/base/dd.c:520
 driver_probe_device+0x104/0x210 drivers/base/dd.c:697
 __device_attach_driver+0x1c2/0x220 drivers/base/dd.c:804
 bus_for_each_drv+0x162/0x1e0 drivers/base/bus.c:431
 __device_attach+0x21a/0x360 drivers/base/dd.c:870
 bus_probe_device+0x1e4/0x290 drivers/base/bus.c:491
 device_add+0x132d/0x1c10 drivers/base/core.c:2557
 usb_set_configuration+0xec5/0x1740 drivers/usb/core/message.c:2032
 usb_generic_driver_probe+0x9d/0xe0 drivers/usb/core/generic.c:241
 usb_probe_device+0xc6/0x1f0 drivers/usb/core/driver.c:272
 really_probe+0x281/0x6d0 drivers/base/dd.c:520
 driver_probe_device+0x104/0x210 drivers/base/dd.c:697
 __device_attach_driver+0x1c2/0x220 drivers/base/dd.c:804
 bus_for_each_drv+0x162/0x1e0 drivers/base/bus.c:431
 __device_attach+0x21a/0x360 drivers/base/dd.c:870
 bus_probe_device+0x1e4/0x290 drivers/base/bus.c:491
 device_add+0x132d/0x1c10 drivers/base/core.c:2557
 usb_new_device.cold+0x753/0x103d drivers/usb/core/hub.c:2554
 hub_port_connect drivers/usb/core/hub.c:5208 [inline]
 hub_port_connect_change drivers/usb/core/hub.c:5348 [inline]
 port_event drivers/usb/core/hub.c:5494 [inline]
 hub_event+0x1eca/0x38f0 drivers/usb/core/hub.c:5576
 process_one_work+0x965/0x16a0 kernel/workqueue.c:2268
 worker_thread+0x96/0xe20 kernel/workqueue.c:2414
 kthread+0x388/0x470 kernel/kthread.c:268
 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:351

Freed by task 17:
 save_stack+0x1b/0x40 mm/kasan/common.c:48
 set_track mm/kasan/common.c:56 [inline]
 kasan_set_free_info mm/kasan/common.c:316 [inline]
 __kasan_slab_free+0xf7/0x140 mm/kasan/common.c:455
 __cache_free mm/slab.c:3426 [inline]
 kfree+0x109/0x2b0 mm/slab.c:3757
 ax88172a_bind.cold+0xad/0x1df drivers/net/usb/ax88172a.c:239
 usbnet_probe+0xb36/0x2600 drivers/net/usb/usbnet.c:1737
 usb_probe_interface+0x305/0x7a0 drivers/usb/core/driver.c:374
 really_probe+0x281/0x6d0 drivers/base/dd.c:520
 driver_probe_device+0x104/0x210 drivers/base/dd.c:697
 __device_attach_driver+0x1c2/0x220 drivers/base/dd.c:804
 bus_for_each_drv+0x162/0x1e0 drivers/base/bus.c:431
 __device_attach+0x21a/0x360 drivers/base/dd.c:870
 bus_probe_device+0x1e4/0x290 drivers/base/bus.c:491
 device_add+0x132d/0x1c10 drivers/base/core.c:2557
 usb_set_configuration+0xec5/0x1740 drivers/usb/core/message.c:2032
 usb_generic_driver_probe+0x9d/0xe0 drivers/usb/core/generic.c:241
 usb_probe_device+0xc6/0x1f0 drivers/usb/core/driver.c:272
 really_probe+0x281/0x6d0 drivers/base/dd.c:520
 driver_probe_device+0x104/0x210 drivers/base/dd.c:697
 __device_attach_driver+0x1c2/0x220 drivers/base/dd.c:804
 bus_for_each_drv+0x162/0x1e0 drivers/base/bus.c:431
 __device_attach+0x21a/0x360 drivers/base/dd.c:870
 bus_probe_device+0x1e4/0x290 drivers/base/bus.c:491
 device_add+0x132d/0x1c10 drivers/base/core.c:2557
 usb_new_device.cold+0x753/0x103d drivers/usb/core/hub.c:2554
 hub_port_connect drivers/usb/core/hub.c:5208 [inline]
 hub_port_connect_change drivers/usb/core/hub.c:5348 [inline]
 port_event drivers/usb/core/hub.c:5494 [inline]
 hub_event+0x1eca/0x38f0 drivers/usb/core/hub.c:5576
 process_one_work+0x965/0x16a0 kernel/workqueue.c:2268
 worker_thread+0x96/0xe20 kernel/workqueue.c:2414
 kthread+0x388/0x470 kernel/kthread.c:268
 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:351

The buggy address belongs to the object at ffff8880a6be3700
 which belongs to the cache kmalloc-64 of size 64
The buggy address is located 0 bytes inside of
 64-byte region [ffff8880a6be3700, ffff8880a6be3740)
The buggy address belongs to the page:
page:ffffea00029af8c0 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0
flags: 0xfffe0000000200(slab)
raw: 00fffe0000000200 ffffea000258df48 ffffea00028e3588 ffff8880aa000380
raw: 0000000000000000 ffff8880a6be3000 0000000100000020 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8880a6be3600: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc
 ffff8880a6be3680: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc
>ffff8880a6be3700: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
                   ^
 ffff8880a6be3780: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
 ffff8880a6be3800: 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc fc
==================================================================

Crashes (2723):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2020/06/19 22:20 upstream 7ae77150d94d 81abc331 .config console log report syz C ci-upstream-kasan-gce-root
2020/06/19 20:27 upstream 7ae77150d94d 81abc331 .config console log report syz C ci-upstream-kasan-gce-selinux-root
2020/06/19 20:12 upstream 7ae77150d94d 81abc331 .config console log report syz C ci-upstream-kasan-gce
2020/06/19 19:30 upstream 7ae77150d94d 81abc331 .config console log report syz C ci-upstream-kasan-gce-smack-root
2020/06/19 19:30 upstream 7ae77150d94d 81abc331 .config console log report syz C ci-upstream-kasan-gce-386
2020/06/19 19:42 linux-next e7b08814b16b 81abc331 .config console log report syz C ci-upstream-linux-next-kasan-gce-root
2020/06/19 17:59 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing f8f02d5c671f 123cf502 .config console log report syz C ci2-upstream-usb
2020/04/03 17:04 https://github.com/google/kasan.git usb-fuzzer 0fa84af850a4 5ed396e6 .config console log report syz C ci2-upstream-usb
2020/03/08 13:17 https://github.com/google/kasan.git usb-fuzzer d6ff8147a51c 2e9971bb .config console log report syz C ci2-upstream-usb
2020/02/28 19:50 https://github.com/google/kasan.git usb-fuzzer d6ff8147a51c c88c7b75 .config console log report syz C ci2-upstream-usb
2020/02/07 19:14 https://github.com/google/kasan.git usb-fuzzer e5cd56e94edd 06150bf1 .config console log report syz C ci2-upstream-usb
2020/01/26 16:57 https://github.com/google/kasan.git usb-fuzzer cd234325a5f1 dd56146d .config console log report syz C ci2-upstream-usb
2020/01/22 21:59 https://github.com/google/kasan.git usb-fuzzer 4cc301ee04d9 3334d684 .config console log report syz C ci2-upstream-usb
2020/01/09 16:48 https://github.com/google/kasan.git usb-fuzzer ae1794106b94 4de4e9f0 .config console log report syz C ci2-upstream-usb
2019/12/26 00:32 https://github.com/google/kasan.git usb-fuzzer ecdf2214f472 be5c2c81 .config console log report syz C ci2-upstream-usb
2019/12/23 08:13 https://github.com/google/kasan.git usb-fuzzer ecdf2214f472 8b967267 .config console log report syz C ci2-upstream-usb
2019/12/20 17:42 https://github.com/google/kasan.git usb-fuzzer ecdf2214f472 34011c05 .config console log report syz C ci2-upstream-usb
2019/12/19 20:03 https://github.com/google/kasan.git usb-fuzzer ecdf2214f472 36650b4b .config console log report syz C ci2-upstream-usb
2019/12/17 01:50 https://github.com/google/kasan.git usb-fuzzer 4cc037ecf2cb d13d7958 .config console log report syz C ci2-upstream-usb
2019/12/06 18:48 https://github.com/google/kasan.git usb-fuzzer 1f22d15c209f 85f26751 .config console log report syz C ci2-upstream-usb
2019/11/29 16:35 https://github.com/google/kasan.git usb-fuzzer 32b5e2b28188 4f7e1d0f .config console log report syz C ci2-upstream-usb
2020/07/23 13:22 upstream d15be546031c 340ea530 .config console log report ci-upstream-kasan-gce-smack-root
2020/07/22 15:18 upstream 4fa640dc5230 128cd85f .config console log report ci-upstream-kasan-gce-selinux-root
2020/07/11 08:35 upstream a581387e415b 18d18b59 .config console log report ci-upstream-kasan-gce
2020/07/07 00:44 upstream 7cc2a8ea1048 51095195 .config console log report ci-upstream-kasan-gce-root
2020/07/23 12:00 upstream 8c26c87b0532 340ea530 .config console log report ci-upstream-kasan-gce-386
2020/07/27 05:46 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 9a360a7cae11 51265195 .config console log report ci2-upstream-usb
2020/07/26 22:03 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 9a360a7cae11 51265195 .config console log report ci2-upstream-usb
2020/07/26 18:00 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 9a360a7cae11 51265195 .config console log report ci2-upstream-usb
2020/07/26 13:34 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 9a360a7cae11 51265195 .config console log report ci2-upstream-usb
2020/07/26 12:23 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 9a360a7cae11 51265195 .config console log report ci2-upstream-usb
2020/07/26 11:16 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 9a360a7cae11 51265195 .config console log report ci2-upstream-usb
2020/07/26 10:09 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 9a360a7cae11 51265195 .config console log report ci2-upstream-usb
2020/07/26 08:22 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 9a360a7cae11 1f7cc1ca .config console log report ci2-upstream-usb
2020/07/26 06:03 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 9a360a7cae11 1f7cc1ca .config console log report ci2-upstream-usb
2020/07/26 04:31 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 9a360a7cae11 1f7cc1ca .config console log report ci2-upstream-usb
2020/07/26 02:38 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 9a360a7cae11 1f7cc1ca .config console log report ci2-upstream-usb
2020/07/26 00:18 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 9a360a7cae11 1f7cc1ca .config console log report ci2-upstream-usb
2020/07/25 22:35 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 9a360a7cae11 1f7cc1ca .config console log report ci2-upstream-usb
2020/07/25 20:48 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 9a360a7cae11 1f7cc1ca .config console log report ci2-upstream-usb
2020/07/25 19:46 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 9a360a7cae11 1f7cc1ca .config console log report ci2-upstream-usb
2020/07/25 17:39 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 9a360a7cae11 1f7cc1ca .config console log report ci2-upstream-usb
2020/07/25 16:08 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 9a360a7cae11 1f7cc1ca .config console log report ci2-upstream-usb
2020/07/25 15:03 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 9a360a7cae11 1f7cc1ca .config console log report ci2-upstream-usb
2020/07/25 13:36 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 9a360a7cae11 1f7cc1ca .config console log report ci2-upstream-usb
2020/07/25 12:31 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 9a360a7cae11 1f7cc1ca .config console log report ci2-upstream-usb
2020/07/25 11:07 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 9a360a7cae11 1f7cc1ca .config console log report ci2-upstream-usb
2020/07/25 07:44 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 9a360a7cae11 0a13649c .config console log report ci2-upstream-usb
2020/07/25 05:19 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 9a360a7cae11 0a13649c .config console log report ci2-upstream-usb
2020/07/25 02:38 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 9a360a7cae11 0a13649c .config console log report ci2-upstream-usb
2020/07/25 00:00 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 9a360a7cae11 0a13649c .config console log report ci2-upstream-usb
2020/07/24 22:02 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 9a360a7cae11 554af388 .config console log report ci2-upstream-usb
2020/07/24 19:03 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 9a360a7cae11 554af388 .config console log report ci2-upstream-usb
2020/07/24 18:22 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 9a360a7cae11 554af388 .config console log report ci2-upstream-usb
2020/07/24 17:19 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 9a360a7cae11 554af388 .config console log report ci2-upstream-usb
2020/07/24 15:10 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 9a360a7cae11 554af388 .config console log report ci2-upstream-usb
2020/07/24 13:38 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 9a360a7cae11 554af388 .config console log report ci2-upstream-usb
2020/07/24 12:25 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 9a360a7cae11 554af388 .config console log report ci2-upstream-usb
2020/07/24 08:19 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 9a360a7cae11 70c104a1 .config console log report ci2-upstream-usb
2020/07/24 07:07 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 9a360a7cae11 70c104a1 .config console log report ci2-upstream-usb
2020/07/24 06:06 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 9a360a7cae11 70c104a1 .config console log report ci2-upstream-usb
2020/07/24 04:33 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 9a360a7cae11 70c104a1 .config console log report ci2-upstream-usb
2020/07/24 02:20 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 9a360a7cae11 70c104a1 .config console log report ci2-upstream-usb
2020/07/24 00:14 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 9a360a7cae11 70c104a1 .config console log report ci2-upstream-usb
2020/07/23 22:26 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 9a360a7cae11 70c104a1 .config console log report ci2-upstream-usb
2020/07/23 21:24 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 9a360a7cae11 70c104a1 .config console log report ci2-upstream-usb
2020/07/23 20:08 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 9a360a7cae11 70c104a1 .config console log report ci2-upstream-usb
2020/07/23 18:53 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 9a360a7cae11 70c104a1 .config console log report ci2-upstream-usb
2020/07/23 17:44 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 9a360a7cae11 70c104a1 .config console log report ci2-upstream-usb
2020/07/03 00:54 linux-next aab2003999e7 bed10395 .config console log report ci-upstream-linux-next-kasan-gce-root
* Struck through repros no longer work on HEAD.