syzbot


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

Status: auto-closed as invalid on 2020/03/21 10:22
Reported-by: syzbot+401dfa07dd81434cb867@syzkaller.appspotmail.com
First crash: 1901d, last: 1826d
Similar bugs (3)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.14 KASAN: slab-out-of-bounds Write in __ext4_expand_extra_isize 1 1823d 1823d 0/1 auto-closed as invalid on 2020/03/24 05:12
upstream KASAN: slab-out-of-bounds Write in __ext4_expand_extra_isize ext4 16 1928d 2271d 15/28 fixed on 2019/12/13 00:31
linux-4.19 KASAN: slab-out-of-bounds Write in __ext4_expand_extra_isize 1 1899d 1899d 0/1 auto-closed as invalid on 2020/01/07 20:38

Sample crash report:
rtc_cmos 00:00: Alarms can be up to one day in the future
rtc_cmos 00:00: Alarms can be up to one day in the future
EXT4-fs (sda1): Unrecognized mount option "inie" or missing value
==================================================================
BUG: KASAN: slab-out-of-bounds in memset include/linux/string.h:332 [inline]
BUG: KASAN: slab-out-of-bounds in __ext4_expand_extra_isize.isra.0+0x10b/0x1c0 fs/ext4/inode.c:5832
Write of size 2147483615 at addr ffff8881cfd023a0 by task syz-executor.5/32016

CPU: 0 PID: 32016 Comm: syz-executor.5 Not tainted 4.14.155-syzkaller #0
Call Trace:
 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0xe5/0x154 lib/dump_stack.c:58
 print_address_description+0x60/0x226 mm/kasan/report.c:187
 __kasan_report.cold+0x1a/0x41 mm/kasan/report.c:316
 memset+0x20/0x40 mm/kasan/common.c:113
 memset include/linux/string.h:332 [inline]
 __ext4_expand_extra_isize.isra.0+0x10b/0x1c0 fs/ext4/inode.c:5832
 ext4_try_to_expand_extra_isize fs/ext4/inode.c:5884 [inline]
 ext4_mark_inode_dirty+0x471/0x7f0 fs/ext4/inode.c:5960
 ext4_dirty_inode+0x6c/0x90 fs/ext4/inode.c:5994
 __mark_inode_dirty+0x69c/0x1080 fs/fs-writeback.c:2144
 mark_inode_dirty_sync include/linux/fs.h:2055 [inline]
 dquot_claim_block include/linux/quotaops.h:352 [inline]
 ext4_da_update_reserve_space+0x3f4/0x780 fs/ext4/inode.c:378
 ext4_ext_map_blocks+0x2b31/0x4a40 fs/ext4/extents.c:4610
 ext4_map_blocks+0x7f4/0x1600 fs/ext4/inode.c:636
 mpage_map_one_extent fs/ext4/inode.c:2481 [inline]
 mpage_map_and_submit_extent fs/ext4/inode.c:2534 [inline]
 ext4_writepages+0x16ed/0x30a0 fs/ext4/inode.c:2905
 do_writepages+0xe5/0x280 mm/page-writeback.c:2348
 __filemap_fdatawrite_range+0x206/0x2a0 mm/filemap.c:348
 file_write_and_wait_range+0x84/0x100 mm/filemap.c:678
 __generic_file_fsync+0x70/0x190 fs/libfs.c:981
 ext4_sync_file+0x3ac/0x1250 fs/ext4/fsync.c:120
 vfs_fsync_range+0x106/0x260 fs/sync.c:196
 generic_write_sync include/linux/fs.h:2713 [inline]
 ext4_file_write_iter+0x883/0xdb0 fs/ext4/file.c:279
 call_write_iter include/linux/fs.h:1798 [inline]
 do_iter_readv_writev+0x379/0x580 fs/read_write.c:679
 do_iter_write fs/read_write.c:958 [inline]
 do_iter_write+0x152/0x550 fs/read_write.c:939
 vfs_iter_write+0x70/0xa0 fs/read_write.c:971
 iter_file_splice_write+0x560/0xa50 fs/splice.c:749
 do_splice_from fs/splice.c:851 [inline]
 direct_splice_actor+0x118/0x160 fs/splice.c:1018
 splice_direct_to_actor+0x292/0x760 fs/splice.c:973
 do_splice_direct+0x177/0x240 fs/splice.c:1061
 do_sendfile+0x493/0xb20 fs/read_write.c:1445
 SYSC_sendfile64 fs/read_write.c:1506 [inline]
 SyS_sendfile64+0x11f/0x140 fs/read_write.c:1492
 do_syscall_64+0x19b/0x520 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x42/0xb7
RIP: 0033:0x45a639
RSP: 002b:00007f0e8a0dbc78 EFLAGS: 00000246 ORIG_RAX: 0000000000000028
RAX: ffffffffffffffda RBX: 0000000000000004 RCX: 000000000045a639
RDX: 0000000000000000 RSI: 0000000000000009 RDI: 0000000000000009
RBP: 000000000075bfc8 R08: 0000000000000000 R09: 0000000000000000
R10: 00008000fffffffe R11: 0000000000000246 R12: 00007f0e8a0dc6d4
R13: 00000000004c83bf R14: 00000000004de7f0 R15: 00000000ffffffff

The buggy address belongs to the page:
page:ffffea00073f4080 count:2 mapcount:0 mapping:ffff8881da4170d0 index:0x445
flags: 0x400000000000203a(referenced|dirty|lru|active|private)
raw: 400000000000203a ffff8881da4170d0 0000000000000445 00000002ffffffff
raw: ffffea0006a40f60 ffffea00069d7f20 ffff8881d5353bd0 ffff8881da81aa80
page dumped because: kasan: bad access detected
page->mem_cgroup:ffff8881da81aa80

Memory state around the buggy address:
 ffff8881d0018900: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff8881d0018980: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff8881d0018a00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc fc
                                                             ^
 ffff8881d0018a80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff8881d0018b00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================
ip6_tunnel: ip6tnl1 xmit: Local address not yet configured!
EXT4-fs error (device sda1): ext4_xattr_set_entry:1605: inode #16952: comm syz-executor.3: corrupted xattr entries
rtc_cmos 00:00: Alarms can be up to one day in the future
BUG: unable to handle kernel paging request at 000000003c32a222
IP: freelist_dereference mm/slub.c:272 [inline]
IP: get_freepointer mm/slub.c:278 [inline]
IP: get_freepointer_safe mm/slub.c:293 [inline]
IP: slab_alloc_node mm/slub.c:2755 [inline]
IP: slab_alloc mm/slub.c:2800 [inline]
IP: kmem_cache_alloc+0x84/0x360 mm/slub.c:2805
PGD 1c6f7f067 P4D 1c6f7f067 PUD 1d6bb3063 PMD 1d0aa8063 PTE 0
Oops: 0000 [#1] PREEMPT SMP KASAN NOPTI
Modules linked in:
CPU: 1 PID: 1707 Comm: mcstransd Tainted: G    B           4.14.155-syzkaller #0
task: 000000005308a468 task.stack: 000000005abe7c90
RIP: 0010:freelist_dereference mm/slub.c:272 [inline]
RIP: 0010:get_freepointer mm/slub.c:278 [inline]
RIP: 0010:get_freepointer_safe mm/slub.c:293 [inline]
RIP: 0010:slab_alloc_node mm/slub.c:2755 [inline]
RIP: 0010:slab_alloc mm/slub.c:2800 [inline]
RIP: 0010:kmem_cache_alloc+0x84/0x360 mm/slub.c:2805
RSP: 0018:ffff8881d39afc48 EFLAGS: 00010246
RAX: 0000000000000000 RBX: 00000000014080c0 RCX: 000000000002dec0
RDX: 0000000000ab8781 RSI: 0000000000ab8781 RDI: ffff8881d3e45e24
RBP: ffff8881da97e600 R08: 000000000002dec0 R09: fffffbfff4886136
R10: fffffbfff4886135 R11: ffffffffa44309ab R12: 00000000014080c0
R13: ffffffffa2172c56 R14: ffff8881d7382a00 R15: ffff8881da97e600
FS:  00007fde919747a0(0000) GS:ffff8881dbb00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffff8881d7382a00 CR3: 00000001d4660004 CR4: 00000000001606a0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 kmem_cache_zalloc include/linux/slab.h:651 [inline]
 get_empty_filp+0x86/0x3d0 fs/file_table.c:123
 alloc_file+0x24/0x3b0 fs/file_table.c:164
 sock_alloc_file+0x123/0x300 net/socket.c:416
 SYSC_accept4 net/socket.c:1575 [inline]
 SyS_accept4+0x224/0x5c0 net/socket.c:1537
 do_syscall_64+0x19b/0x520 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x42/0xb7
RIP: 0033:0x7fde90e50f40
RSP: 002b:00007fff3dd9a298 EFLAGS: 00000246 ORIG_RAX: 000000000000002b
RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 00007fde90e50f40
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000004
RBP: 0000558e4805c340 R08: 0000000000000000 R09: 00007fde90e97620
R10: 0000000000000007 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000001 R14: 0000000000000000 R15: 0000000000000004
Code: 48 89 c8 65 48 03 05 24 fe ed 5d 48 8b 70 08 48 39 f2 75 e7 4c 8b 30 4d 85 f6 0f 84 43 01 00 00 4d 8b 07 49 63 47 20 41 f6 c0 0f <49> 8b 1c 06 0f 85 44 01 00 00 48 8d 4a 40 4c 89 f0 65 49 0f c7 
RIP: freelist_dereference mm/slub.c:272 [inline] RSP: ffff8881d39afc48
RIP: get_freepointer mm/slub.c:278 [inline] RSP: ffff8881d39afc48
RIP: get_freepointer_safe mm/slub.c:293 [inline] RSP: ffff8881d39afc48
RIP: slab_alloc_node mm/slub.c:2755 [inline] RSP: ffff8881d39afc48
RIP: slab_alloc mm/slub.c:2800 [inline] RSP: ffff8881d39afc48
RIP: kmem_cache_alloc+0x84/0x360 mm/slub.c:2805 RSP: ffff8881d39afc48
CR2: ffff8881d7382a00
---[ end trace 6d1c546b06184db9 ]---
BUG: unable to handle kernel paging request

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2019/11/22 10:22 android-4.14 7bc77fd33905 8098ea0f .config console log report ci-android-414-kasan-gce-root
2019/09/08 04:02 android-4.14 4eccd8013349 a60cb4cd .config console log report ci-android-414-kasan-gce-root
* Struck through repros no longer work on HEAD.