syzbot


KASAN: slab-out-of-bounds Read in page_get_anon_vma

Status: auto-closed as invalid on 2019/10/25 17:29
Subsystems: mm
[Documentation on labels]
Reported-by: syzbot+ed3e5c9a6a1e30a1bd2a@syzkaller.appspotmail.com
First crash: 1840d, last: 1769d
Discussions (3)
Title Replies (including bot) Last reply
Reminder: 99 open syzbot bugs in net subsystem 14 (14) 2019/07/31 15:13
Reminder: 94 open syzbot bugs in net subsystem 1 (1) 2019/06/25 05:48
KASAN: slab-out-of-bounds Read in page_get_anon_vma 0 (1) 2019/05/07 09:47

Sample crash report:
==================================================================
BUG: KASAN: slab-out-of-bounds in atomic_read include/asm-generic/atomic-instrumented.h:26 [inline]
BUG: KASAN: slab-out-of-bounds in atomic_fetch_add_unless include/linux/atomic-fallback.h:1086 [inline]
BUG: KASAN: slab-out-of-bounds in atomic_add_unless include/linux/atomic-fallback.h:1111 [inline]
BUG: KASAN: slab-out-of-bounds in atomic_inc_not_zero include/linux/atomic-fallback.h:1127 [inline]
BUG: KASAN: slab-out-of-bounds in page_get_anon_vma+0x24b/0x4b0 mm/rmap.c:477
Read of size 4 at addr ffff88809a16bc90 by task kswapd0/1770

CPU: 0 PID: 1770 Comm: kswapd0 Not tainted 5.2.0-rc6+ #34
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+0x7c/0x20d mm/kasan/report.c:188
 __kasan_report.cold+0x1b/0x40 mm/kasan/report.c:317
 kasan_report+0x12/0x20 mm/kasan/common.c:614
 check_memory_region_inline mm/kasan/generic.c:185 [inline]
 check_memory_region+0x123/0x190 mm/kasan/generic.c:191
 kasan_check_read+0x11/0x20 mm/kasan/common.c:94
 atomic_read include/asm-generic/atomic-instrumented.h:26 [inline]
 atomic_fetch_add_unless include/linux/atomic-fallback.h:1086 [inline]
 atomic_add_unless include/linux/atomic-fallback.h:1111 [inline]
 atomic_inc_not_zero include/linux/atomic-fallback.h:1127 [inline]
 page_get_anon_vma+0x24b/0x4b0 mm/rmap.c:477
 split_huge_page_to_list+0x577/0x2f70 mm/huge_memory.c:2682
 split_huge_page include/linux/huge_mm.h:146 [inline]
 deferred_split_scan+0x64b/0xa60 mm/huge_memory.c:2860
 do_shrink_slab+0x3f6/0xa70 mm/vmscan.c:551
 shrink_slab mm/vmscan.c:700 [inline]
 shrink_slab+0x4be/0x5e0 mm/vmscan.c:680
 shrink_node+0x612/0x1680 mm/vmscan.c:2666
 kswapd_shrink_node mm/vmscan.c:3412 [inline]
 balance_pgdat+0x56c/0xe80 mm/vmscan.c:3570
 kswapd+0x5f4/0xfc0 mm/vmscan.c:3825
 kthread+0x354/0x420 kernel/kthread.c:255
 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:352

Allocated by task 9927:
 save_stack+0x23/0x90 mm/kasan/common.c:71
 set_track mm/kasan/common.c:79 [inline]
 __kasan_kmalloc mm/kasan/common.c:489 [inline]
 __kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:462
 kasan_kmalloc+0x9/0x10 mm/kasan/common.c:503
 __do_kmalloc mm/slab.c:3660 [inline]
 __kmalloc+0x15c/0x740 mm/slab.c:3669
 kmalloc include/linux/slab.h:552 [inline]
 tomoyo_realpath_from_path+0xcd/0x7a0 security/tomoyo/realpath.c:277
 tomoyo_get_realpath security/tomoyo/file.c:151 [inline]
 tomoyo_path_perm+0x230/0x430 security/tomoyo/file.c:822
 tomoyo_inode_getattr+0x1d/0x30 security/tomoyo/tomoyo.c:129
 security_inode_getattr+0xf2/0x150 security/security.c:1179
 vfs_getattr+0x25/0x70 fs/stat.c:115
 vfs_statx+0x157/0x200 fs/stat.c:191
 vfs_lstat include/linux/fs.h:3198 [inline]
 __do_sys_newlstat+0xa4/0x130 fs/stat.c:354
 __se_sys_newlstat fs/stat.c:348 [inline]
 __x64_sys_newlstat+0x54/0x80 fs/stat.c:348
 do_syscall_64+0xfd/0x680 arch/x86/entry/common.c:301
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

Freed by task 9927:
 save_stack+0x23/0x90 mm/kasan/common.c:71
 set_track mm/kasan/common.c:79 [inline]
 __kasan_slab_free+0x102/0x150 mm/kasan/common.c:451
 kasan_slab_free+0xe/0x10 mm/kasan/common.c:459
 __cache_free mm/slab.c:3432 [inline]
 kfree+0xcf/0x220 mm/slab.c:3755
 tomoyo_realpath_from_path+0x1de/0x7a0 security/tomoyo/realpath.c:319
 tomoyo_get_realpath security/tomoyo/file.c:151 [inline]
 tomoyo_path_perm+0x230/0x430 security/tomoyo/file.c:822
 tomoyo_inode_getattr+0x1d/0x30 security/tomoyo/tomoyo.c:129
 security_inode_getattr+0xf2/0x150 security/security.c:1179
 vfs_getattr+0x25/0x70 fs/stat.c:115
 vfs_statx+0x157/0x200 fs/stat.c:191
 vfs_lstat include/linux/fs.h:3198 [inline]
 __do_sys_newlstat+0xa4/0x130 fs/stat.c:354
 __se_sys_newlstat fs/stat.c:348 [inline]
 __x64_sys_newlstat+0x54/0x80 fs/stat.c:348
 do_syscall_64+0xfd/0x680 arch/x86/entry/common.c:301
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

The buggy address belongs to the object at ffff88809a16a680
 which belongs to the cache kmalloc-4k of size 4096
The buggy address is located 1552 bytes to the right of
 4096-byte region [ffff88809a16a680, ffff88809a16b680)
The buggy address belongs to the page:
page:ffffea0002685a80 refcount:1 mapcount:0 mapping:ffff8880aa400dc0 index:0x0 compound_mapcount: 0
flags: 0x1fffc0000010200(slab|head)
raw: 01fffc0000010200 ffffea00012a5408 ffffea0002a43508 ffff8880aa400dc0
raw: 0000000000000000 ffff88809a16a680 0000000100000001 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff88809a16bb80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff88809a16bc00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff88809a16bc80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
                         ^
 ffff88809a16bd00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff88809a16bd80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================

Crashes (5):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2019/06/27 17:28 upstream 249155c20f9b 7509bf36 .config console log report ci-upstream-kasan-gce-selinux-root
2019/05/09 14:10 upstream a2d635decbfa 6fc130d3 .config console log report ci-upstream-kasan-gce
2019/04/20 08:35 upstream 3ecafda911f4 b0e8efcb .config console log report ci-upstream-kasan-gce
2019/04/20 05:19 upstream 3ecafda911f4 b0e8efcb .config console log report ci-upstream-kasan-gce
2019/04/17 18:13 upstream 444fe9913539 b0e8efcb .config console log report ci-upstream-kasan-gce
* Struck through repros no longer work on HEAD.