syzbot


KASAN: use-after-free Read in ext4_data_block_valid

Status: auto-closed as invalid on 2019/09/11 10:38
Reported-by: syzbot+6bcc8c972a987a81b623@syzkaller.appspotmail.com
First crash: 2285d, last: 2090d
Similar bugs (6)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.14 KASAN: use-after-free Read in ext4_data_block_valid 5 1648d 1937d 0/1 auto-closed as invalid on 2020/09/26 20:10
android-414 KASAN: use-after-free Read in ext4_data_block_valid (2) 6 1837d 1899d 0/1 auto-closed as invalid on 2020/03/21 21:05
upstream KASAN: use-after-free Read in ext4_data_block_valid ext4 108 1959d 2406d 13/28 fixed on 2019/10/15 23:40
linux-4.19 KASAN: use-after-free Read in ext4_data_block_valid 2 1895d 1958d 0/1 auto-closed as invalid on 2020/01/24 00:27
android-49 KASAN: use-after-free Read in ext4_data_block_valid 21 2164d 2060d 0/3 auto-closed as invalid on 2019/06/29 18:27
android-49 KASAN: use-after-free Read in ext4_data_block_valid (2) 1 1835d 1835d 0/3 auto-closed as invalid on 2020/03/24 07:08

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in ext4_data_block_valid+0x279/0x2d0 fs/ext4/block_validity.c:211
Read of size 8 at addr ffff8881d582cbb0 by task udevd/9536

CPU: 0 PID: 9536 Comm: udevd Not tainted 4.14.106+ #30
Call Trace:
 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0xb9/0x10e lib/dump_stack.c:53
 print_address_description+0x60/0x226 mm/kasan/report.c:252
 kasan_report_error mm/kasan/report.c:351 [inline]
 kasan_report mm/kasan/report.c:409 [inline]
 kasan_report.cold+0x88/0x2a5 mm/kasan/report.c:393

Allocated by task 1:
 save_stack mm/kasan/kasan.c:447 [inline]
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_kmalloc.part.0+0x4f/0xd0 mm/kasan/kasan.c:551
 slab_post_alloc_hook mm/slab.h:442 [inline]
 slab_alloc_node mm/slub.c:2723 [inline]
 slab_alloc mm/slub.c:2731 [inline]
 kmem_cache_alloc+0xd2/0x2d0 mm/slub.c:2736
 add_system_zone+0x29b/0x530 fs/ext4/block_validity.c:85
 ext4_setup_system_zone+0x2e2/0x470 fs/ext4/block_validity.c:169

Freed by task 9534:
 save_stack mm/kasan/kasan.c:447 [inline]
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_slab_free+0xb0/0x190 mm/kasan/kasan.c:524
 slab_free_hook mm/slub.c:1389 [inline]
 slab_free_freelist_hook mm/slub.c:1410 [inline]
 slab_free mm/slub.c:2966 [inline]
 kmem_cache_free+0xc4/0x330 mm/slub.c:2988
 ext4_release_system_zone+0x68/0xe0 fs/ext4/block_validity.c:187
 ext4_setup_system_zone+0x3a3/0x470 fs/ext4/block_validity.c:151
 ext4_remount+0xf14/0x1d30 fs/ext4/super.c:5292
 do_remount_sb2+0x35a/0x5e0 fs/super.c:878
 do_remount fs/namespace.c:2388 [inline]
 do_mount+0x1305/0x26a0 fs/namespace.c:2894
 SYSC_mount fs/namespace.c:3119 [inline]
 SyS_mount+0xa8/0x120 fs/namespace.c:3096
 do_syscall_64+0x19b/0x4b0 arch/x86/entry/common.c:289

The buggy address belongs to the object at ffff8881d582cb98
 which belongs to the cache ext4_system_zone of size 40
The buggy address is located 24 bytes inside of
 40-byte region [ffff8881d582cb98, ffff8881d582cbc0)
The buggy address belongs to the page:
page:ffffea0007560b00 count:1 mapcount:0 mapping:          (null) index:0xffff8881d582cb60
flags: 0x4000000000000100(slab)
raw: 4000000000000100 0000000000000000 ffff8881d582cb60 0000000180490019
raw: dead000000000100 dead000000000200 ffff8881d9018200 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8881d582ca80: fb fb fb fb fb fc fc fb fb fb fb fb fc fc fb fb
 ffff8881d582cb00: fb fb fb fc fc fb fb fb fb fb fc fc fb fb fb fb
>ffff8881d582cb80: fb fc fc fb fb fb fb fb fc fc fc fc fc fc fc fc
                                     ^
 ffff8881d582cc00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff8881d582cc80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================

Crashes (12):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2019/03/15 10:37 android-4.14 8ed9bc6e6401 bab43553 .config console log report ci-android-414-kasan-gce-root
2019/03/04 20:27 android-4.14 934272e9380b 7c693b52 .config console log report ci-android-414-kasan-gce-root
2019/02/24 15:46 android-4.14 6bdf39bb26fd 7a06e792 .config console log report ci-android-414-kasan-gce-root
2019/01/18 08:50 android-4.14 42506d99b820 5bf17c30 .config console log report ci-android-414-kasan-gce-root
2018/12/05 17:11 android-4.14 d11d7f1ccfb1 ac6c0578 .config console log report ci-android-414-kasan-gce-root
2018/11/28 09:43 android-4.14 f544ad0b1547 4b6d14f2 .config console log report ci-android-414-kasan-gce-root
2018/11/16 20:35 android-4.14 4e76528bd48d b08ee62a .config console log report ci-android-414-kasan-gce-root
2018/11/16 10:58 android-4.14 4e76528bd48d f5e275d1 .config console log report ci-android-414-kasan-gce-root
2018/11/07 03:24 android-4.14 d4e5dea08bbf 8bd6bd63 .config console log report ci-android-414-kasan-gce-root
2018/11/06 00:03 android-4.14 d4e5dea08bbf 8bd6bd63 .config console log report ci-android-414-kasan-gce-root
2018/10/12 18:12 android-4.14 b7e40c3d444a caf12900 .config console log report ci-android-414-kasan-gce-root
2018/09/01 14:37 android-4.14 47350a9f13c6 a4718693 .config console log report ci-android-414-kasan-gce-root
* Struck through repros no longer work on HEAD.