syzbot


KASAN: slab-out-of-bounds Write in __ext4_expand_extra_isize

Status: fixed on 2019/12/13 00:31
Subsystems: ext4
[Documentation on labels]
Reported-by: syzbot+f8d6f8386ceacdbfff57@syzkaller.appspotmail.com
Fix commit: 4ea99936a163 ext4: add more paranoia checking in ext4_expand_extra_isize handling
First crash: 2116d, last: 1773d
Discussions (9)
Title Replies (including bot) Last reply
[PATCH 4.19 000/321] 4.19.88-stable review 352 (352) 2020/02/09 12:41
[PATCH 4.4 00/76] 4.4.211-stable review 81 (81) 2020/01/22 20:52
[PATCH 4.9 00/97] 4.9.211-stable review 102 (102) 2020/01/22 20:52
[PATCH 3.16 00/63] 3.16.81-rc1 review 68 (68) 2020/01/10 16:01
[PATCH 4.14 000/209] 4.14.158-stable review 223 (223) 2019/12/10 00:52
[PATCH 5.4 00/46] 5.4.2-stable review 58 (58) 2019/12/06 13:05
[PATCH 5.3 000/135] 5.3.15-stable review 140 (140) 2019/12/04 19:13
[PATCH] ext4: add more paranoia checking in ext4_expand_extra_isize handling 6 (6) 2019/11/19 04:36
KASAN: slab-out-of-bounds Write in __ext4_expand_extra_isize 0 (1) 2018/09/03 09:24
Similar bugs (3)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
android-414 KASAN: slab-out-of-bounds Write in __ext4_expand_extra_isize 2 1670d 1745d 0/1 auto-closed as invalid on 2020/03/21 10:22
linux-4.14 KASAN: slab-out-of-bounds Write in __ext4_expand_extra_isize 1 1667d 1667d 0/1 auto-closed as invalid on 2020/03/24 05:12
linux-4.19 KASAN: slab-out-of-bounds Write in __ext4_expand_extra_isize 1 1744d 1744d 0/1 auto-closed as invalid on 2020/01/07 20:38

Sample crash report:
==================================================================
BUG: KASAN: slab-out-of-bounds in memset include/linux/string.h:344 [inline]
BUG: KASAN: slab-out-of-bounds in __ext4_expand_extra_isize+0x1ab/0x290 fs/ext4/inode.c:5948
Write of size 83886048 at addr ffff88808a7972a0 by task syz-executor.0/10392

CPU: 0 PID: 10392 Comm: syz-executor.0 Not tainted 5.3.0-rc3+ #106
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x172/0x1f0 lib/dump_stack.c:113
 print_address_description.cold+0xd4/0x306 mm/kasan/report.c:351
 __kasan_report.cold+0x1b/0x36 mm/kasan/report.c:482
 kasan_report+0x12/0x17 mm/kasan/common.c:612
 check_memory_region_inline mm/kasan/generic.c:185 [inline]
 check_memory_region+0x134/0x1a0 mm/kasan/generic.c:192
 memset+0x24/0x40 mm/kasan/common.c:105
 memset include/linux/string.h:344 [inline]
 __ext4_expand_extra_isize+0x1ab/0x290 fs/ext4/inode.c:5948
 ext4_try_to_expand_extra_isize fs/ext4/inode.c:6000 [inline]
 ext4_mark_inode_dirty+0x74e/0x9b0 fs/ext4/inode.c:6076
 ext4_rmdir fs/ext4/namei.c:3120 [inline]
 ext4_rmdir+0x983/0xcd0 fs/ext4/namei.c:3053
 vfs_rmdir fs/namei.c:3878 [inline]
 vfs_rmdir+0x19a/0x4f0 fs/namei.c:3857
 do_rmdir+0x39e/0x420 fs/namei.c:3940
 __do_sys_rmdir fs/namei.c:3958 [inline]
 __se_sys_rmdir fs/namei.c:3956 [inline]
 __x64_sys_rmdir+0x36/0x40 fs/namei.c:3956
 do_syscall_64+0xfd/0x6a0 arch/x86/entry/common.c:296
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x459597
Code: 00 66 90 b8 57 00 00 00 0f 05 48 3d 01 f0 ff ff 0f 83 7d ba fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 b8 54 00 00 00 0f 05 <48> 3d 01 f0 ff ff 0f 83 5d ba fb ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007ffca3cf38a8 EFLAGS: 00000207 ORIG_RAX: 0000000000000054
RAX: ffffffffffffffda RBX: 0000000000000065 RCX: 0000000000459597
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 00007ffca3cf4a40
RBP: 0000000000000692 R08: 0000000000000000 R09: 0000000000000001
R10: 0000000000000005 R11: 0000000000000207 R12: 00007ffca3cf4a40
R13: 00005555555b2980 R14: 0000000000000000 R15: 00007ffca3cf5ad0

The buggy address belongs to the page:
page:ffffea000229e5c0 refcount:2 mapcount:0 mapping:ffff88821a318ad8 index:0x428
def_blk_aops 
flags: 0x1fffc000000203a(referenced|dirty|lru|active|private)
raw: 01fffc000000203a ffffea000239ad08 ffffea00002df548 ffff88821a318ad8
raw: 0000000000000428 ffff888092feb498 00000002ffffffff ffff88821b6eaac0
page dumped because: kasan: bad access detected
page->mem_cgroup:ffff88821b6eaac0

Memory state around the buggy address:
 ffff88808a800680: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff88808a800700: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff88808a800780: 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc fc
                                  ^
 ffff88808a800800: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff88808a800880: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================

Crashes (16):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2019/08/12 01:02 upstream 296d05cb0d3c acb51638 .config console log report ci-upstream-kasan-gce-root
2019/04/17 07:49 upstream 444fe9913539 b0e8efcb .config console log report ci-upstream-kasan-gce-smack-root
2019/04/15 15:16 upstream dc4060a5dc25 505ab413 .config console log report ci-upstream-kasan-gce-selinux-root
2019/03/22 14:22 upstream 0939221e6468 dce6e62f .config console log report ci-upstream-kasan-gce-smack-root
2018/11/05 07:41 upstream 4710e78940d8 8bd6bd63 .config console log report ci-upstream-kasan-gce-selinux-root
2018/11/01 22:13 upstream 5b7449810ae6 1f38e9ae .config console log report ci-upstream-kasan-gce-selinux-root
2018/11/01 22:00 upstream 82aa4671516a 1f38e9ae .config console log report ci-upstream-kasan-gce-smack-root
2018/10/30 03:49 upstream 4b42745211af 2f1090da .config console log report ci-upstream-kasan-gce-smack-root
2018/10/26 17:03 upstream e5f6d9afa341 a8292de9 .config console log report ci-upstream-kasan-gce-selinux-root
2018/10/22 23:48 upstream 84df9525b0c2 ecb386fe .config console log report ci-upstream-kasan-gce-smack-root
2018/10/18 23:32 upstream fa520c47eaa1 9aba67b5 .config console log report ci-upstream-kasan-gce-smack-root
2018/10/01 03:05 upstream 17b57b1883c1 41e4b329 .config console log report ci-upstream-kasan-gce-smack-root
2019/07/05 02:41 linux-next f9ca7f5a1eb9 429efa16 .config console log report ci-upstream-linux-next-kasan-gce-root
2019/02/17 08:07 linux-next 7a92eb7cc1dc f42dee6d .config console log report ci-upstream-linux-next-kasan-gce-root
2018/12/17 04:00 linux-next d14b746c6c1c def91db3 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/09/02 17:00 linux-next a880148cb2af a4718693 .config console log report ci-upstream-linux-next-kasan-gce-root
* Struck through repros no longer work on HEAD.