Hello,
syzbot found the following issue on:
HEAD commit: 1216f02e Add linux-next specific files for 20210415
git tree: linux-next
console output:
https://syzkaller.appspot.com/x/log.txt?x=179c70e5d00000
kernel config:
https://syzkaller.appspot.com/x/.config?x=3491b04113499f81
dashboard link:
https://syzkaller.appspot.com/bug?extid=c74e68a5ef3e89612757
CC: [
ak...@linux-foundation.org linux-...@vger.kernel.org linu...@kvack.org]
Unfortunately, I don't have any reproducer for this issue yet.
IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by:
syzbot+c74e68...@syzkaller.appspotmail.com
==================================================================
BUG: KASAN: use-after-free in rmap_walk_ksm+0x7cc/0x890 mm/ksm.c:2642
Read of size 8 at addr ffff88809a3020d0 by task kcompactd0/1657
CPU: 0 PID: 1657 Comm: kcompactd0 Not tainted 5.12.0-rc7-next-20210415-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
__dump_stack lib/dump_stack.c:79 [inline]
dump_stack+0x141/0x1d7 lib/dump_stack.c:120
print_address_description.constprop.0.cold+0x5b/0x2f8 mm/kasan/report.c:233
__kasan_report mm/kasan/report.c:419 [inline]
kasan_report.cold+0x7c/0xd8 mm/kasan/report.c:436
rmap_walk_ksm+0x7cc/0x890 mm/ksm.c:2642
rmap_walk+0x141/0x190 mm/rmap.c:1950
remove_migration_ptes mm/migrate.c:273 [inline]
__unmap_and_move mm/migrate.c:1109 [inline]
unmap_and_move mm/migrate.c:1173 [inline]
migrate_pages+0xf37/0x37d0 mm/migrate.c:1447
compact_zone+0x1abd/0x3830 mm/compaction.c:2366
proactive_compact_node+0x103/0x1c0 mm/compaction.c:2620
kcompactd+0x9a0/0xd10 mm/compaction.c:2890
kthread+0x3b1/0x4a0 kernel/kthread.c:292
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:294
Allocated by task 1659:
kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38
kasan_set_track mm/kasan/common.c:46 [inline]
set_alloc_info mm/kasan/common.c:428 [inline]
__kasan_slab_alloc+0x84/0xa0 mm/kasan/common.c:461
kasan_slab_alloc include/linux/kasan.h:236 [inline]
slab_post_alloc_hook mm/slab.h:527 [inline]
slab_alloc_node mm/slub.c:2924 [inline]
slab_alloc mm/slub.c:2932 [inline]
kmem_cache_alloc+0x219/0x3a0 mm/slub.c:2937
kmem_cache_zalloc include/linux/slab.h:678 [inline]
alloc_rmap_item mm/ksm.c:379 [inline]
get_next_rmap_item mm/ksm.c:2209 [inline]
scan_get_next_rmap_item mm/ksm.c:2310 [inline]
ksm_do_scan mm/ksm.c:2390 [inline]
ksm_scan_thread+0x163b/0x4a40 mm/ksm.c:2414
kthread+0x3b1/0x4a0 kernel/kthread.c:292
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:294
Freed by task 1659:
kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38
kasan_set_track+0x1c/0x30 mm/kasan/common.c:46
kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:357
____kasan_slab_free mm/kasan/common.c:360 [inline]
____kasan_slab_free mm/kasan/common.c:325 [inline]
__kasan_slab_free+0xfb/0x130 mm/kasan/common.c:368
kasan_slab_free include/linux/kasan.h:212 [inline]
slab_free_hook mm/slub.c:1593 [inline]
slab_free_freelist_hook+0xdf/0x240 mm/slub.c:1618
slab_free mm/slub.c:3178 [inline]
kmem_cache_free+0x97/0x750 mm/slub.c:3194
free_rmap_item mm/ksm.c:390 [inline]
get_next_rmap_item mm/ksm.c:2206 [inline]
scan_get_next_rmap_item mm/ksm.c:2310 [inline]
ksm_do_scan mm/ksm.c:2390 [inline]
ksm_scan_thread+0x11a7/0x4a40 mm/ksm.c:2414
kthread+0x3b1/0x4a0 kernel/kthread.c:292
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:294
The buggy address belongs to the object at ffff88809a3020c0
which belongs to the cache ksm_rmap_item of size 64
The buggy address is located 16 bytes inside of
64-byte region [ffff88809a3020c0, ffff88809a302100)
The buggy address belongs to the page:
page:ffffea000268c080 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x9a302
flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000000200 dead000000000100 dead000000000122 ffff888140251140
raw: 0000000000000000 00000000002a002a 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
Memory state around the buggy address:
ffff88809a301f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff88809a302000: fa fb fb fb fb fb fb fb fc fc fc fc fa fb fb fb
>ffff88809a302080: fb fb fb fb fc fc fc fc fa fb fb fb fb fb fb fb
^
ffff88809a302100: fc fc fc fc 00 00 00 00 00 00 00 00 fc fc fc fc
ffff88809a302180: 00 00 00 00 00 00 00 00 fc fc fc fc 00 00 00 00
==================================================================
---
This report is generated by a bot. It may contain errors.
See
https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at
syzk...@googlegroups.com.
syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.