syzbot


KASAN: use-after-free Read in disk_unblock_events

Status: public: reported C repro on 2019/04/12 00:00
Reported-by: syzbot+c77157a4eff0270621e7@syzkaller.appspotmail.com
First crash: 2354d, last: 1638d
Similar bugs (5)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
android-49 KASAN: use-after-free Read in disk_unblock_events C 665 1971d 2411d 0/3 closed as invalid on 2019/01/08 21:30
android-49 KASAN: use-after-free Read in disk_unblock_events (2) C 200 1641d 1875d 0/3 public: reported C repro on 2019/04/11 08:44
upstream KASAN: use-after-free Read in disk_unblock_events block C 65 2297d 2403d 5/26 fixed on 2018/04/09 09:36
linux-4.14 KASAN: use-after-free Read in disk_unblock_events C error 129 628d 1867d 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 1643d 1876d 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:1543
Read of size 8 at addr ffff8801cee2f3e8 by task blkid/2193

CPU: 0 PID: 2193 Comm: blkid Not tainted 4.4.174+ #4
 0000000000000000 de0d443612faf0c5 ffff8800b55ef730 ffffffff81aad1a1
 0000000000000000 ffffea00073b8a00 ffff8801cee2f3e8 0000000000000008
 0000000000000000 ffff8800b55ef768 ffffffff81490120 0000000000000000
Call Trace:
 [<ffffffff81aad1a1>] __dump_stack lib/dump_stack.c:15 [inline]
 [<ffffffff81aad1a1>] dump_stack+0xc1/0x120 lib/dump_stack.c:51
 [<ffffffff81490120>] print_address_description+0x6f/0x21b mm/kasan/report.c:252
 [<ffffffff81490358>] kasan_report_error mm/kasan/report.c:351 [inline]
 [<ffffffff81490358>] kasan_report mm/kasan/report.c:408 [inline]
 [<ffffffff81490358>] kasan_report.cold+0x8c/0x2be mm/kasan/report.c:393
 [<ffffffff81484ed4>] __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:429
 [<ffffffff81a82965>] disk_unblock_events+0x55/0x60 block/genhd.c:1543
 [<ffffffff8154efcc>] __blkdev_get+0x70c/0xdf0 fs/block_dev.c:1297
 [<ffffffff81551938>] blkdev_get+0x2e8/0x920 fs/block_dev.c:1353
 [<ffffffff8155219a>] blkdev_open+0x1aa/0x250 fs/block_dev.c:1508
 [<ffffffff8149154f>] do_dentry_open+0x38f/0xbd0 fs/open.c:749
 [<ffffffff81494d3b>] vfs_open+0x10b/0x210 fs/open.c:862
 [<ffffffff814c5ddf>] do_last fs/namei.c:3269 [inline]
 [<ffffffff814c5ddf>] path_openat+0x136f/0x4470 fs/namei.c:3406
 [<ffffffff814ccab1>] do_filp_open+0x1a1/0x270 fs/namei.c:3440
 [<ffffffff81495668>] do_sys_open+0x2f8/0x600 fs/open.c:1038
 [<ffffffff8149599d>] SYSC_open fs/open.c:1056 [inline]
 [<ffffffff8149599d>] SyS_open+0x2d/0x40 fs/open.c:1051
 [<ffffffff82718ba1>] entry_SYSCALL_64_fastpath+0x1e/0x9a

Allocated by task 2181:
 [<ffffffff8102e3c6>] save_stack_trace+0x26/0x50 arch/x86/kernel/stacktrace.c:63
 [<ffffffff81483f22>] save_stack mm/kasan/kasan.c:512 [inline]
 [<ffffffff81483f22>] set_track mm/kasan/kasan.c:524 [inline]
 [<ffffffff81483f22>] kasan_kmalloc.part.0+0x62/0xf0 mm/kasan/kasan.c:616
 [<ffffffff81484197>] kasan_kmalloc+0xb7/0xd0 mm/kasan/kasan.c:601
 [<ffffffff814801a3>] kmem_cache_alloc_trace+0x123/0x2d0 mm/slub.c:2642
 [<ffffffff81a81b50>] kmem_cache_alloc_node_trace include/linux/slab.h:367 [inline]
 [<ffffffff81a81b50>] kmalloc_node include/linux/slab.h:514 [inline]
 [<ffffffff81a81b50>] kzalloc_node include/linux/slab.h:631 [inline]
 [<ffffffff81a81b50>] alloc_disk_node+0x50/0x3c0 block/genhd.c:1282
 [<ffffffff81a81edb>] alloc_disk+0x1b/0x20 block/genhd.c:1274
 [<ffffffff81d436d0>] loop_add+0x380/0x830 drivers/block/loop.c:1857
 [<ffffffff81d440a8>] loop_control_ioctl+0x138/0x2f0 drivers/block/loop.c:1988
 [<ffffffff814d23f7>] vfs_ioctl fs/ioctl.c:43 [inline]
 [<ffffffff814d23f7>] file_ioctl fs/ioctl.c:470 [inline]
 [<ffffffff814d23f7>] do_vfs_ioctl+0x6e7/0xfa0 fs/ioctl.c:605
 [<ffffffff814d2d3f>] SYSC_ioctl fs/ioctl.c:622 [inline]
 [<ffffffff814d2d3f>] SyS_ioctl+0x8f/0xc0 fs/ioctl.c:613
 [<ffffffff82718ba1>] entry_SYSCALL_64_fastpath+0x1e/0x9a

Freed by task 2193:
 [<ffffffff8102e3c6>] save_stack_trace+0x26/0x50 arch/x86/kernel/stacktrace.c:63
 [<ffffffff81484820>] save_stack mm/kasan/kasan.c:512 [inline]
 [<ffffffff81484820>] set_track mm/kasan/kasan.c:524 [inline]
 [<ffffffff81484820>] kasan_slab_free+0xb0/0x190 mm/kasan/kasan.c:589
 [<ffffffff81481c44>] slab_free_hook mm/slub.c:1383 [inline]
 [<ffffffff81481c44>] slab_free_freelist_hook mm/slub.c:1405 [inline]
 [<ffffffff81481c44>] slab_free mm/slub.c:2859 [inline]
 [<ffffffff81481c44>] kfree+0xf4/0x310 mm/slub.c:3749
 [<ffffffff81a80375>] disk_release+0x255/0x330 block/genhd.c:1118
 [<ffffffff81cf785d>] device_release+0x7d/0x220 drivers/base/core.c:247
 [<ffffffff81ab309c>] kobject_cleanup lib/kobject.c:643 [inline]
 [<ffffffff81ab309c>] kobject_release lib/kobject.c:672 [inline]
 [<ffffffff81ab309c>] kref_sub include/linux/kref.h:73 [inline]
 [<ffffffff81ab309c>] kref_put include/linux/kref.h:98 [inline]
 [<ffffffff81ab309c>] kobject_put+0x14c/0x260 lib/kobject.c:689
 [<ffffffff81a7e013>] put_disk+0x23/0x30 block/genhd.c:1346
 [<ffffffff8154ef2c>] __blkdev_get+0x66c/0xdf0 fs/block_dev.c:1290
 [<ffffffff81551938>] blkdev_get+0x2e8/0x920 fs/block_dev.c:1353
 [<ffffffff8155219a>] blkdev_open+0x1aa/0x250 fs/block_dev.c:1508
 [<ffffffff8149154f>] do_dentry_open+0x38f/0xbd0 fs/open.c:749
 [<ffffffff81494d3b>] vfs_open+0x10b/0x210 fs/open.c:862
 [<ffffffff814c5ddf>] do_last fs/namei.c:3269 [inline]
 [<ffffffff814c5ddf>] path_openat+0x136f/0x4470 fs/namei.c:3406
 [<ffffffff814ccab1>] do_filp_open+0x1a1/0x270 fs/namei.c:3440
 [<ffffffff81495668>] do_sys_open+0x2f8/0x600 fs/open.c:1038
 [<ffffffff8149599d>] SYSC_open fs/open.c:1056 [inline]
 [<ffffffff8149599d>] SyS_open+0x2d/0x40 fs/open.c:1051
 [<ffffffff82718ba1>] entry_SYSCALL_64_fastpath+0x1e/0x9a

The buggy address belongs to the object at ffff8801cee2ee80
 which belongs to the cache kmalloc-2048 of size 2048
The buggy address is located 1384 bytes inside of
 2048-byte region [ffff8801cee2ee80, ffff8801cee2f680)
The buggy address belongs to the page:
kasan: CONFIG_KASAN_INLINE enabled
kasan: GPF could be caused by NULL-ptr deref or user memory access[   23.665431] ------------[ cut here ]------------
WARNING: CPU: 1 PID: 2071 at kernel/sched/core.c:7941 __might_sleep+0x138/0x1a0 kernel/sched/core.c:7941()
do not call blocking ops when !TASK_RUNNING; state=1 set at [<ffffffff810de6f5>] do_wait+0x265/0xa00 kernel/exit.c:1511

Crashes (367):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2019/08/25 02:50 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b d21c5d9d .config console log report syz C ci-android-44-kasan-gce
2019/07/25 09:21 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b 32329ceb .config console log report syz C ci-android-44-kasan-gce
2019/07/22 05:05 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b 1656845f .config console log report syz C ci-android-44-kasan-gce
2019/07/17 09:38 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b 0d10349c .config console log report syz C ci-android-44-kasan-gce
2019/06/08 09:06 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b cf9c3a50 .config console log report syz C ci-android-44-kasan-gce
2019/04/16 20:07 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b 505ab413 .config console log report syz C ci-android-44-kasan-gce
2019/03/14 14:35 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b d09a902e .config console log report syz C ci-android-44-kasan-gce
2019/02/27 19:32 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b 083cfd0e .config console log report syz C ci-android-44-kasan-gce
2019/02/10 01:14 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b d75f7686 .config console log report syz C ci-android-44-kasan-gce
2019/01/28 14:30 https://android.googlesource.com/kernel/common android-4.4 b3e9e81ee068 629c2a27 .config console log report syz C ci-android-44-kasan-gce
2019/01/23 02:45 https://android.googlesource.com/kernel/common android-4.4 24189101975d b1ff06b2 .config console log report syz C ci-android-44-kasan-gce
2019/01/14 15:50 https://android.googlesource.com/kernel/common android-4.4 241f76b17c36 95485883 .config console log report syz C ci-android-44-kasan-gce
2018/12/03 17:11 https://android.googlesource.com/kernel/common android-4.4 4c4bedf5b3fd 819002b0 .config console log report syz C ci-android-44-kasan-gce
2018/12/02 16:29 https://android.googlesource.com/kernel/common android-4.4 4c4bedf5b3fd e0d8c853 .config console log report syz C ci-android-44-kasan-gce
2018/12/02 02:30 https://android.googlesource.com/kernel/common android-4.4 4c4bedf5b3fd 5a581673 .config console log report syz C ci-android-44-kasan-gce
2018/11/01 06:41 https://android.googlesource.com/kernel/common android-4.4 c4b00eb70496 1f38e9ae .config console log report syz C ci-android-44-kasan-gce
2018/10/28 01:15 https://android.googlesource.com/kernel/common android-4.4 c4b00eb70496 8efba39a .config console log report syz C ci-android-44-kasan-gce
2019/11/08 19:12 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b 1e35461e .config console log report syz C ci-android-44-kasan-gce-386
2019/07/25 09:22 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b 32329ceb .config console log report syz C ci-android-44-kasan-gce-386
2019/07/22 05:04 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b 1656845f .config console log report syz C ci-android-44-kasan-gce-386
2019/07/17 09:38 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b 0d10349c .config console log report syz C ci-android-44-kasan-gce-386
2019/06/08 09:06 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b cf9c3a50 .config console log report syz C ci-android-44-kasan-gce-386
2019/04/16 20:05 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b 505ab413 .config console log report syz C ci-android-44-kasan-gce-386
2019/04/07 13:24 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b c34fde03 .config console log report syz C ci-android-44-kasan-gce-386
2019/03/14 15:57 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b d09a902e .config console log report syz C ci-android-44-kasan-gce-386
2019/02/27 19:31 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b 083cfd0e .config console log report syz C ci-android-44-kasan-gce-386
2019/02/09 23:28 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b d75f7686 .config console log report syz C ci-android-44-kasan-gce-386
2019/02/03 18:07 https://android.googlesource.com/kernel/common android-4.4 b3e9e81ee068 c198d5dd .config console log report syz C ci-android-44-kasan-gce-386
2019/02/02 06:34 https://android.googlesource.com/kernel/common android-4.4 b3e9e81ee068 564f9a4f .config console log report syz C ci-android-44-kasan-gce-386
2019/01/28 14:34 https://android.googlesource.com/kernel/common android-4.4 b3e9e81ee068 629c2a27 .config console log report syz C ci-android-44-kasan-gce-386
2019/01/23 03:02 https://android.googlesource.com/kernel/common android-4.4 24189101975d b1ff06b2 .config console log report syz C ci-android-44-kasan-gce-386
2019/01/14 15:51 https://android.googlesource.com/kernel/common android-4.4 241f76b17c36 95485883 .config console log report syz C ci-android-44-kasan-gce-386
2018/12/03 17:35 https://android.googlesource.com/kernel/common android-4.4 4c4bedf5b3fd 819002b0 .config console log report syz C ci-android-44-kasan-gce-386
2018/12/02 15:39 https://android.googlesource.com/kernel/common android-4.4 4c4bedf5b3fd e0d8c853 .config console log report syz C ci-android-44-kasan-gce-386
2018/12/02 02:38 https://android.googlesource.com/kernel/common android-4.4 4c4bedf5b3fd 5a581673 .config console log report syz C ci-android-44-kasan-gce-386
2018/11/01 08:03 https://android.googlesource.com/kernel/common android-4.4 c4b00eb70496 1f38e9ae .config console log report syz C ci-android-44-kasan-gce-386
2018/10/28 01:17 https://android.googlesource.com/kernel/common android-4.4 c4b00eb70496 8efba39a .config console log report syz C ci-android-44-kasan-gce-386
2018/10/18 06:31 https://android.googlesource.com/kernel/common android-4.4 7a95540418be b2695b95 .config console log report syz C ci-android-44-kasan-gce-386
2019/11/08 19:05 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b 1e35461e .config console log report syz ci-android-44-kasan-gce
2019/04/07 13:13 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b c34fde03 .config console log report syz ci-android-44-kasan-gce
2019/02/03 17:57 https://android.googlesource.com/kernel/common android-4.4 b3e9e81ee068 c198d5dd .config console log report syz ci-android-44-kasan-gce
2018/12/26 11:15 https://android.googlesource.com/kernel/common android-4.4 dfca92bab267 8a41a0ad .config console log report syz ci-android-44-kasan-gce
2019/01/10 16:34 https://android.googlesource.com/kernel/common android-4.4 d08574b6f0ae db9b6579 .config console log report syz ci-android-44-kasan-gce-386
2019/12/04 12:14 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b 0ecb9746 .config console log report ci-android-44-kasan-gce
2019/12/01 00:47 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b a76bf83f .config console log report ci-android-44-kasan-gce
2019/11/07 06:20 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b d797d201 .config console log report ci-android-44-kasan-gce
2019/10/23 12:22 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b d0686497 .config console log report ci-android-44-kasan-gce
2019/10/17 18:29 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b 8c88c9c1 .config console log report ci-android-44-kasan-gce
2019/09/27 20:41 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b d8074e0b .config console log report ci-android-44-kasan-gce
2019/09/25 19:15 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b a3355dba .config console log report ci-android-44-kasan-gce
2019/08/30 16:12 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b fd37b39e .config console log report ci-android-44-kasan-gce
2019/08/24 16:44 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b 78ded196 .config console log report ci-android-44-kasan-gce
2019/08/19 07:10 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b b8ceabfc .config console log report ci-android-44-kasan-gce
2019/08/18 19:42 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b 55bf8926 .config console log report ci-android-44-kasan-gce
2019/08/16 04:58 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b 8fd428a1 .config console log report ci-android-44-kasan-gce
2019/08/15 19:56 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b 0d298d6b .config console log report ci-android-44-kasan-gce
2019/08/15 14:04 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b 0d298d6b .config console log report ci-android-44-kasan-gce
2019/08/15 12:49 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b 0d298d6b .config console log report ci-android-44-kasan-gce
2019/08/15 02:12 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b 0d298d6b .config console log report ci-android-44-kasan-gce
2019/08/14 05:53 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b ef801a3e .config console log report ci-android-44-kasan-gce
2019/08/02 14:08 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b 835dffe7 .config console log report ci-android-44-kasan-gce
2019/07/16 12:59 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b db842eb6 .config console log report ci-android-44-kasan-gce
2019/03/08 00:08 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b 4b69c3cb .config console log report ci-android-44-kasan-gce
2019/03/05 05:39 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b 7c693b52 .config console log report ci-android-44-kasan-gce
2019/02/27 14:27 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b 083cfd0e .config console log report ci-android-44-kasan-gce
2019/02/25 14:12 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b a70141bf .config console log report ci-android-44-kasan-gce
2019/02/23 22:32 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b 7a06e792 .config console log report ci-android-44-kasan-gce
2019/02/11 20:46 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b 73f5f452 .config console log report ci-android-44-kasan-gce
2019/02/07 12:35 https://android.googlesource.com/kernel/common android-4.4 64b564428faa aa4feb03 .config console log report ci-android-44-kasan-gce
2019/12/02 23:01 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b ab342da3 .config console log report ci-android-44-kasan-gce-386
2019/11/25 19:05 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b 371caf77 .config console log report ci-android-44-kasan-gce-386
2019/08/28 01:25 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b fd37b39e .config console log report ci-android-44-kasan-gce-386
2019/08/12 10:02 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b acb51638 .config console log report ci-android-44-kasan-gce-386
2019/07/25 20:31 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b 732bc5a0 .config console log report ci-android-44-kasan-gce-386
2019/06/25 19:09 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b 0a8d1a96 .config console log report ci-android-44-kasan-gce-386
2019/05/12 14:27 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b c017728b .config console log report ci-android-44-kasan-gce-386
2019/04/18 00:57 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b b0e8efcb .config console log report ci-android-44-kasan-gce-386
2019/03/21 20:48 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b dce6e62f .config console log report ci-android-44-kasan-gce-386
2019/03/18 15:45 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b 4656beca .config console log report ci-android-44-kasan-gce-386
2019/03/16 12:22 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b bab43553 .config console log report ci-android-44-kasan-gce-386
2019/03/12 21:11 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b a71bfb62 .config console log report ci-android-44-kasan-gce-386
2019/03/08 11:42 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b 12365b99 .config console log report ci-android-44-kasan-gce-386
2019/03/07 22:04 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b 4b69c3cb .config console log report ci-android-44-kasan-gce-386
2019/03/06 14:39 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b 05cf83bf .config console log report ci-android-44-kasan-gce-386
2019/03/01 21:59 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b 68d9e495 .config console log report ci-android-44-kasan-gce-386
2019/03/01 13:00 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b 8a4b3a6b .config console log report ci-android-44-kasan-gce-386
2019/02/28 20:19 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b 09aeeba4 .config console log report ci-android-44-kasan-gce-386
2019/02/12 11:45 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b 65a0d619 .config console log report ci-android-44-kasan-gce-386
2019/02/11 12:03 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b 73f5f452 .config console log report ci-android-44-kasan-gce-386
* Struck through repros no longer work on HEAD.