syzbot


KASAN: use-after-free Read in disk_unblock_events (2)

Status: public: reported C repro on 2019/04/11 08:44
Reported-by: syzbot+133a70fae4291d38f1fe@syzkaller.appspotmail.com
First crash: 1965d, last: 1640d
Similar bugs (5)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
android-44 KASAN: use-after-free Read in disk_unblock_events C 367 1637d 1874d 0/2 public: reported C repro on 2019/04/12 00:00
android-49 KASAN: use-after-free Read in disk_unblock_events C 665 1970d 2410d 0/3 closed as invalid on 2019/01/08 21:30
upstream KASAN: use-after-free Read in disk_unblock_events block C 65 2296d 2402d 5/26 fixed on 2018/04/09 09:36
linux-4.14 KASAN: use-after-free Read in disk_unblock_events C error 129 627d 1866d 0/1 upstream: reported C repro on 2019/04/19 06:17
android-414 KASAN: use-after-free Read in disk_unblock_events C 114 1642d 1875d 0/1 public: reported C repro on 2019/04/11 00:00

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in disk_unblock_events+0x55/0x60 block/genhd.c:1550
Read of size 8 at addr ffff8801c5bb0560 by task blkid/2381

CPU: 1 PID: 2381 Comm: blkid Not tainted 4.9.194+ #0
 ffff8801c91ff730 ffffffff81b67001 0000000000000000 ffffea000716ec00
 ffff8801c5bb0560 0000000000000008 ffffffff81b3b4b5 ffff8801c91ff768
 ffffffff8150c4f1 0000000000000000 ffff8801c5bb0560 ffff8801c5bb0560
Call Trace:
 [<000000008a45bb9a>] __dump_stack lib/dump_stack.c:15 [inline]
 [<000000008a45bb9a>] dump_stack+0xc1/0x120 lib/dump_stack.c:51
 [<00000000412b4002>] print_address_description+0x6f/0x23a mm/kasan/report.c:256
 [<000000008b8811cd>] kasan_report_error mm/kasan/report.c:355 [inline]
 [<000000008b8811cd>] kasan_report mm/kasan/report.c:413 [inline]
 [<000000008b8811cd>] kasan_report.cold+0x8c/0x2ba mm/kasan/report.c:397
 [<0000000065cd7325>] __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:434
 [<0000000047a3d189>] disk_unblock_events+0x55/0x60 block/genhd.c:1550
 [<000000004220f0e3>] __blkdev_get+0x6ba/0xeb0 fs/block_dev.c:1368
 [<000000003d174a7f>] blkdev_get+0x2e8/0x920 fs/block_dev.c:1424
 [<0000000069856456>] blkdev_open+0x1aa/0x250 fs/block_dev.c:1579
 [<0000000075e1378a>] do_dentry_open+0x422/0xd20 fs/open.c:791
 [<00000000f44537d4>] vfs_open+0x105/0x230 fs/open.c:904
 [<000000008dbca49e>] do_last fs/namei.c:3541 [inline]
 [<000000008dbca49e>] path_openat+0xbf5/0x2f60 fs/namei.c:3665
 [<00000000297890fe>] do_filp_open+0x1a1/0x280 fs/namei.c:3699
 [<00000000bef1367e>] do_sys_open+0x2f0/0x610 fs/open.c:1097
 [<0000000012e345b9>] SYSC_open fs/open.c:1115 [inline]
 [<0000000012e345b9>] SyS_open+0x2d/0x40 fs/open.c:1110
 [<000000003f55834e>] do_syscall_64+0x1ad/0x5c0 arch/x86/entry/common.c:288
 [<00000000a386bb98>] entry_SYSCALL_64_after_swapgs+0x5d/0xdb

Allocated by task 2371:
 save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:57
 save_stack mm/kasan/kasan.c:512 [inline]
 set_track mm/kasan/kasan.c:524 [inline]
 kasan_kmalloc.part.0+0x62/0xf0 mm/kasan/kasan.c:616
 kasan_kmalloc+0xb7/0xd0 mm/kasan/kasan.c:601
 kmem_cache_alloc_trace+0x115/0x2d0 mm/slub.c:2742
 kmem_cache_alloc_node_trace include/linux/slab.h:381 [inline]
 kmalloc_node include/linux/slab.h:528 [inline]
 kzalloc_node include/linux/slab.h:647 [inline]
 alloc_disk_node+0x50/0x3c0 block/genhd.c:1294
 alloc_disk+0x1b/0x20 block/genhd.c:1286
 loop_add+0x37e/0x7d0 drivers/block/loop.c:1849
 loop_control_ioctl+0x138/0x320 drivers/block/loop.c:1981
 vfs_ioctl fs/ioctl.c:43 [inline]
 file_ioctl fs/ioctl.c:493 [inline]
 do_vfs_ioctl+0xb87/0x11d0 fs/ioctl.c:677
 SYSC_ioctl fs/ioctl.c:694 [inline]
 SyS_ioctl+0x8f/0xc0 fs/ioctl.c:685
 do_syscall_64+0x1ad/0x5c0 arch/x86/entry/common.c:288
 entry_SYSCALL_64_after_swapgs+0x5d/0xdb

Freed by task 2381:
 save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:57
 save_stack mm/kasan/kasan.c:512 [inline]
 set_track mm/kasan/kasan.c:524 [inline]
 kasan_slab_free+0xb0/0x190 mm/kasan/kasan.c:589
 slab_free_hook mm/slub.c:1355 [inline]
 slab_free_freelist_hook mm/slub.c:1377 [inline]
 slab_free mm/slub.c:2958 [inline]
 kfree+0xfc/0x310 mm/slub.c:3878
 disk_release+0x255/0x330 block/genhd.c:1147
 device_release+0x7d/0x220 drivers/base/core.c:247
 kobject_cleanup lib/kobject.c:643 [inline]
 kobject_release lib/kobject.c:672 [inline]
 kref_sub include/linux/kref.h:73 [inline]
 kref_put include/linux/kref.h:98 [inline]
 kobject_put+0x150/0x260 lib/kobject.c:689
 put_disk+0x23/0x30 block/genhd.c:1358
 __blkdev_get+0x61a/0xeb0 fs/block_dev.c:1361
 blkdev_get+0x2e8/0x920 fs/block_dev.c:1424
 blkdev_open+0x1aa/0x250 fs/block_dev.c:1579
 do_dentry_open+0x422/0xd20 fs/open.c:791
 vfs_open+0x105/0x230 fs/open.c:904
 do_last fs/namei.c:3541 [inline]
 path_openat+0xbf5/0x2f60 fs/namei.c:3665
 do_filp_open+0x1a1/0x280 fs/namei.c:3699
 do_sys_open+0x2f0/0x610 fs/open.c:1097
 SYSC_open fs/open.c:1115 [inline]
 SyS_open+0x2d/0x40 fs/open.c:1110
 do_syscall_64+0x1ad/0x5c0 arch/x86/entry/common.c:288
 entry_SYSCALL_64_after_swapgs+0x5d/0xdb

The buggy address belongs to the object at ffff8801c5bb0000
 which belongs to the cache kmalloc-2048 of size 2048
The buggy address is located 1376 bytes inside of
 2048-byte region [ffff8801c5bb0000, ffff8801c5bb0800)
The buggy address belongs to the page:
page:ffffea000716ec00 count:1 mapcount:0 mapping:          (null) index:0x0 compound_mapcount: 0
flags: 0x4000000000010200(slab|head)
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8801c5bb0400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff8801c5bb0480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff8801c5bb0500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                                       ^
 ffff8801c5bb0580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff8801c5bb0600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (200):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2019/11/08 19:07 https://android.googlesource.com/kernel/common android-4.9 7fe05eede1c8 1e35461e .config console log report syz C ci-android-49-kasan-gce-root
2019/11/05 21:38 https://android.googlesource.com/kernel/common android-4.9 7fe05eede1c8 0f3ec414 .config console log report syz C ci-android-49-kasan-gce-root
2019/08/25 02:50 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 d21c5d9d .config console log report syz C ci-android-49-kasan-gce
2019/08/25 02:48 https://android.googlesource.com/kernel/common android-4.9 bb6401356c78 d21c5d9d .config console log report syz C ci-android-49-kasan-gce-root
2019/07/25 10:09 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 32329ceb .config console log report syz C ci-android-49-kasan-gce
2019/07/22 05:04 https://android.googlesource.com/kernel/common android-4.9 5e2c340821b1 1656845f .config console log report syz C ci-android-49-kasan-gce-root
2019/07/17 11:33 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 0d10349c .config console log report syz C ci-android-49-kasan-gce
2019/07/17 09:19 https://android.googlesource.com/kernel/common android-4.9 5e2c340821b1 0d10349c .config console log report syz C ci-android-49-kasan-gce-root
2019/07/02 11:41 https://android.googlesource.com/kernel/common android-4.9 ab758e1039d6 cccc4302 .config console log report syz C ci-android-49-kasan-gce-root
2019/06/08 09:08 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 cf9c3a50 .config console log report syz C ci-android-49-kasan-gce
2019/06/08 08:44 https://android.googlesource.com/kernel/common android-4.9 83ae225d5ce3 cf9c3a50 .config console log report syz C ci-android-49-kasan-gce-root
2019/04/16 20:03 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 505ab413 .config console log report syz C ci-android-49-kasan-gce
2019/04/16 20:02 https://android.googlesource.com/kernel/common android-4.9 fc67a895f0a5 505ab413 .config console log report syz C ci-android-49-kasan-gce-root
2019/04/07 13:16 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 c34fde03 .config console log report syz C ci-android-49-kasan-gce
2019/04/07 13:15 https://android.googlesource.com/kernel/common android-4.9 286f971000f1 c34fde03 .config console log report syz C ci-android-49-kasan-gce-root
2019/04/03 15:22 https://android.googlesource.com/kernel/common android-4.9 e1a8babe929c dfd3394d .config console log report syz C ci-android-49-kasan-gce-root
2019/03/14 14:41 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 d09a902e .config console log report syz C ci-android-49-kasan-gce
2019/03/14 14:17 https://android.googlesource.com/kernel/common android-4.9 1597fdfe52ba d09a902e .config console log report syz C ci-android-49-kasan-gce-root
2019/02/27 20:21 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 083cfd0e .config console log report syz C ci-android-49-kasan-gce
2019/02/27 19:58 https://android.googlesource.com/kernel/common android-4.9 1597fdfe52ba 083cfd0e .config console log report syz C ci-android-49-kasan-gce-root
2019/02/09 23:22 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 d75f7686 .config console log report syz C ci-android-49-kasan-gce
2019/02/09 23:21 https://android.googlesource.com/kernel/common android-4.9 1597fdfe52ba d75f7686 .config console log report syz C ci-android-49-kasan-gce-root
2019/01/14 15:32 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 95485883 .config console log report syz C ci-android-49-kasan-gce
2019/07/25 09:23 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 32329ceb .config console log report syz C ci-android-49-kasan-gce-386
2019/07/22 05:06 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 1656845f .config console log report syz C ci-android-49-kasan-gce-386
2019/07/17 13:37 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 0d10349c .config console log report syz C ci-android-49-kasan-gce-386
2019/04/16 20:05 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 505ab413 .config console log report syz C ci-android-49-kasan-gce-386
2019/04/07 13:16 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 c34fde03 .config console log report syz C ci-android-49-kasan-gce-386
2019/03/14 15:47 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 d09a902e .config console log report syz C ci-android-49-kasan-gce-386
2019/02/27 19:32 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 083cfd0e .config console log report syz C ci-android-49-kasan-gce-386
2019/02/09 23:22 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 d75f7686 .config console log report syz C ci-android-49-kasan-gce-386
2019/11/08 19:07 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 1e35461e .config console log report syz ci-android-49-kasan-gce
2019/10/26 19:50 https://android.googlesource.com/kernel/common android-4.9 7fe05eede1c8 25bb509e .config console log report syz ci-android-49-kasan-gce-root
2019/09/24 17:08 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 0942eab8 .config console log report syz ci-android-49-kasan-gce
2019/09/24 11:17 https://android.googlesource.com/kernel/common android-4.9 7fe05eede1c8 c68252d2 .config console log report syz ci-android-49-kasan-gce-root
2019/07/22 05:02 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 1656845f .config console log report syz ci-android-49-kasan-gce
2019/11/08 19:07 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 1e35461e .config console log report syz ci-android-49-kasan-gce-386
2019/11/05 20:33 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 0f3ec414 .config console log report syz ci-android-49-kasan-gce-386
2019/09/24 15:57 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 0942eab8 .config console log report syz ci-android-49-kasan-gce-386
2019/08/25 02:49 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 d21c5d9d .config console log report syz ci-android-49-kasan-gce-386
2019/06/08 09:04 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 cf9c3a50 .config console log report syz ci-android-49-kasan-gce-386
2019/03/19 09:31 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 46264c32 .config console log report syz ci-android-49-kasan-gce-386
2019/01/10 15:11 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 db9b6579 .config console log report syz ci-android-49-kasan-gce-386
2019/12/01 18:55 android-4.9 a36b5017c810 a76bf83f .config console log report ci-android-49-kasan-gce-root
2019/11/26 04:14 android-4.9 13ff5130ff6e f746151a .config console log report ci-android-49-kasan-gce-root
2019/11/25 23:55 android-4.9 13ff5130ff6e f746151a .config console log report ci-android-49-kasan-gce-root
2019/11/24 13:32 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 598ca6c8 .config console log report ci-android-49-kasan-gce
2019/11/22 12:23 android-4.9 258971b8e1ac 598ca6c8 .config console log report ci-android-49-kasan-gce-root
2019/11/18 08:37 android-4.9 258971b8e1ac d5696d51 .config console log report ci-android-49-kasan-gce-root
2019/11/17 07:15 android-4.9 258971b8e1ac d5696d51 .config console log report ci-android-49-kasan-gce-root
2019/11/16 16:58 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 d5696d51 .config console log report ci-android-49-kasan-gce
2019/11/15 00:10 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 a24fe792 .config console log report ci-android-49-kasan-gce
2019/11/12 02:04 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 048f2d49 .config console log report ci-android-49-kasan-gce
2019/11/11 18:21 https://android.googlesource.com/kernel/common android-4.9 7fe05eede1c8 048f2d49 .config console log report ci-android-49-kasan-gce-root
2019/11/09 08:05 https://android.googlesource.com/kernel/common android-4.9 7fe05eede1c8 dc438b91 .config console log report ci-android-49-kasan-gce-root
2019/11/06 00:34 https://android.googlesource.com/kernel/common android-4.9 7fe05eede1c8 0f3ec414 .config console log report ci-android-49-kasan-gce-root
2019/11/04 14:37 https://android.googlesource.com/kernel/common android-4.9 7fe05eede1c8 18e12644 .config console log report ci-android-49-kasan-gce-root
2019/11/03 06:13 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 a41ca8fa .config console log report ci-android-49-kasan-gce
2019/10/29 06:27 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 5ea87a66 .config console log report ci-android-49-kasan-gce
2019/10/24 00:53 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 b602d64b .config console log report ci-android-49-kasan-gce
2019/10/22 12:18 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 c59a7cd8 .config console log report ci-android-49-kasan-gce
2019/10/22 09:13 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 c59a7cd8 .config console log report ci-android-49-kasan-gce
2019/10/15 22:17 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 b5268b89 .config console log report ci-android-49-kasan-gce
2019/10/12 05:47 https://android.googlesource.com/kernel/common android-4.9 7fe05eede1c8 426631dd .config console log report ci-android-49-kasan-gce-root
2019/10/11 20:45 https://android.googlesource.com/kernel/common android-4.9 7fe05eede1c8 426631dd .config console log report ci-android-49-kasan-gce-root
2019/10/10 18:11 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 a4efa8c0 .config console log report ci-android-49-kasan-gce
2019/10/10 16:25 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 a4efa8c0 .config console log report ci-android-49-kasan-gce
2019/10/06 01:05 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 f3f7d9c8 .config console log report ci-android-49-kasan-gce
2019/10/02 12:05 https://android.googlesource.com/kernel/common android-4.9 7fe05eede1c8 2e29b534 .config console log report ci-android-49-kasan-gce-root
2019/09/29 00:05 https://android.googlesource.com/kernel/common android-4.9 7fe05eede1c8 eb6b9855 .config console log report ci-android-49-kasan-gce-root
2019/09/25 13:03 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 e38a6630 .config console log report ci-android-49-kasan-gce
2019/09/18 01:08 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 03e0d245 .config console log report ci-android-49-kasan-gce
2019/09/17 12:55 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 13dcda9b .config console log report ci-android-49-kasan-gce
2019/09/12 01:28 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 f4e53c10 .config console log report ci-android-49-kasan-gce
2019/09/05 02:56 https://android.googlesource.com/kernel/common android-4.9 d342ee64906f 040fda58 .config console log report ci-android-49-kasan-gce-root
2019/09/03 11:46 https://android.googlesource.com/kernel/common android-4.9 1488597c127f 48448e71 .config console log report ci-android-49-kasan-gce-root
2019/08/25 07:22 https://android.googlesource.com/kernel/common android-4.9 bb6401356c78 d21c5d9d .config console log report ci-android-49-kasan-gce-root
2019/08/23 19:50 https://android.googlesource.com/kernel/common android-4.9 bb6401356c78 78ded196 .config console log report ci-android-49-kasan-gce-root
2019/08/12 09:06 https://android.googlesource.com/kernel/common android-4.9 2970e785e9bf acb51638 .config console log report ci-android-49-kasan-gce-root
2019/08/06 19:09 https://android.googlesource.com/kernel/common android-4.9 d4fff2d0a879 c6f01e54 .config console log report ci-android-49-kasan-gce-root
2019/08/06 06:46 https://android.googlesource.com/kernel/common android-4.9 712595fe9d6c 6affd8e8 .config console log report ci-android-49-kasan-gce-root
2019/08/01 02:12 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 c692b5bd .config console log report ci-android-49-kasan-gce
2019/01/10 12:40 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 db9b6579 .config console log report ci-android-49-kasan-gce
2019/11/26 22:36 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 1048481f .config console log report ci-android-49-kasan-gce-386
2019/11/08 18:36 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 1e35461e .config console log report ci-android-49-kasan-gce-386
2019/11/04 21:41 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 76630fc9 .config console log report ci-android-49-kasan-gce-386
2019/10/29 18:30 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 5ea87a66 .config console log report ci-android-49-kasan-gce-386
2019/10/26 02:34 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 c2e837da .config console log report ci-android-49-kasan-gce-386
2019/10/21 18:49 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 b24d2b8a .config console log report ci-android-49-kasan-gce-386
2019/10/13 22:01 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 2f661ec4 .config console log report ci-android-49-kasan-gce-386
2019/10/11 16:16 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 1a3bad90 .config console log report ci-android-49-kasan-gce-386
2019/09/19 08:08 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 46c0be24 .config console log report ci-android-49-kasan-gce-386
2019/09/07 10:31 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 a60cb4cd .config console log report ci-android-49-kasan-gce-386
2019/08/19 23:45 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 ee12860b .config console log report ci-android-49-kasan-gce-386
2019/08/07 21:47 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 e6ebef88 .config console log report ci-android-49-kasan-gce-386
* Struck through repros no longer work on HEAD.