================================================================== BUG: KASAN: slab-out-of-bounds in exfat_clear_bitmap+0x147/0x490 fs/exfat/balloc.c:174 Read of size 8 at addr ffff88810ecf97d8 by task syz-executor.2/14924 CPU: 1 PID: 14924 Comm: syz-executor.2 Not tainted 5.10.109-syzkaller-00693-g414e6c8e941c #0 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_lvl+0x1e2/0x24b lib/dump_stack.c:118 print_address_description+0x81/0x3c0 mm/kasan/report.c:233 __kasan_report mm/kasan/report.c:419 [inline] kasan_report+0x1a4/0x1f0 mm/kasan/report.c:436 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report_generic.c:309 exfat_clear_bitmap+0x147/0x490 fs/exfat/balloc.c:174 exfat_free_cluster+0x25a/0x4a0 fs/exfat/fatent.c:181 __exfat_truncate+0x99e/0xe00 fs/exfat/file.c:217 exfat_truncate+0x11b/0x4f0 fs/exfat/file.c:243 exfat_setattr+0xa03/0xd40 fs/exfat/file.c:339 notify_change+0xb76/0xe10 fs/attr.c:336 do_truncate+0x1ea/0x2d0 fs/open.c:65 handle_truncate fs/namei.c:2989 [inline] do_open fs/namei.c:3331 [inline] path_openat+0x294e/0x2fd0 fs/namei.c:3444 do_filp_open+0x200/0x440 fs/namei.c:3471 do_sys_openat2+0x13b/0x470 fs/open.c:1211 do_sys_open fs/open.c:1227 [inline] __do_sys_creat fs/open.c:1301 [inline] __se_sys_creat fs/open.c:1295 [inline] __x64_sys_creat+0x11f/0x160 fs/open.c:1295 do_syscall_64+0x34/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x7f01a5da60e9 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f01a4f1c168 EFLAGS: 00000246 ORIG_RAX: 0000000000000055 RAX: ffffffffffffffda RBX: 00007f01a5eb8f60 RCX: 00007f01a5da60e9 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000020000080 RBP: 00007f01a5e0008d R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fff3559047f R14: 00007f01a4f1c300 R15: 0000000000022000 Allocated by task 14924: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:428 [inline] ____kasan_kmalloc+0xdc/0x110 mm/kasan/common.c:507 __kasan_kmalloc+0x9/0x10 mm/kasan/common.c:516 kasan_kmalloc include/linux/kasan.h:269 [inline] __kmalloc+0x1f7/0x360 mm/slub.c:4042 kmalloc_array include/linux/slab.h:592 [inline] exfat_allocate_bitmap fs/exfat/balloc.c:72 [inline] exfat_load_bitmap+0x511/0xae0 fs/exfat/balloc.c:120 __exfat_fill_super fs/exfat/super.c:595 [inline] exfat_fill_super+0x1101/0x2ab0 fs/exfat/super.c:645 get_tree_bdev+0x417/0x640 fs/super.c:1344 exfat_get_tree+0x1c/0x20 fs/exfat/super.c:717 vfs_get_tree+0x88/0x290 fs/super.c:1549 do_new_mount+0x289/0xad0 fs/namespace.c:2899 path_mount+0x58d/0xce0 fs/namespace.c:3229 do_mount fs/namespace.c:3242 [inline] __do_sys_mount fs/namespace.c:3450 [inline] __se_sys_mount+0x2d2/0x3c0 fs/namespace.c:3427 __x64_sys_mount+0xbf/0xd0 fs/namespace.c:3427 do_syscall_64+0x34/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 The buggy address belongs to the object at ffff88810ecf97d0 which belongs to the cache kmalloc-8 of size 8 The buggy address is located 0 bytes to the right of 8-byte region [ffff88810ecf97d0, ffff88810ecf97d8) The buggy address belongs to the page: page:ffffea00043b3e40 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10ecf9 flags: 0x8000000000000200(slab) raw: 8000000000000200 ffffea00042dd680 0000001300000013 ffff888100043c80 raw: 0000000000000000 0000000080660066 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x112cc0(GFP_USER|__GFP_NOWARN|__GFP_NORETRY), pid 8425, ts 213828335622, free_ts 183331488568 set_page_owner include/linux/page_owner.h:35 [inline] post_alloc_hook mm/page_alloc.c:2385 [inline] prep_new_page mm/page_alloc.c:2391 [inline] get_page_from_freelist+0x745/0x760 mm/page_alloc.c:4063 __alloc_pages_nodemask+0x3b6/0x890 mm/page_alloc.c:5113 alloc_slab_page mm/slub.c:1815 [inline] allocate_slab+0x78/0x540 mm/slub.c:1817 new_slab mm/slub.c:1878 [inline] new_slab_objects mm/slub.c:2637 [inline] ___slab_alloc+0x131/0x2e0 mm/slub.c:2800 __slab_alloc+0x63/0xa0 mm/slub.c:2840 slab_alloc_node mm/slub.c:2922 [inline] slab_alloc mm/slub.c:2964 [inline] __kmalloc+0x24f/0x360 mm/slub.c:4038 __kmalloc_node include/linux/slab.h:418 [inline] kmalloc_node include/linux/slab.h:575 [inline] kvmalloc_node+0x82/0x130 mm/util.c:580 kvmalloc include/linux/mm.h:822 [inline] kvmalloc_array include/linux/mm.h:840 [inline] kvcalloc include/linux/mm.h:845 [inline] kvm_page_track_create_memslot+0x35/0xc0 arch/x86/kvm/mmu/page_track.c:38 kvm_alloc_memslot_metadata arch/x86/kvm/x86.c:10646 [inline] kvm_arch_prepare_memory_region+0x738/0x940 arch/x86/kvm/x86.c:10686 kvm_set_memslot+0x1f4/0x1480 arch/x86/kvm/../../../virt/kvm/kvm_main.c:1230 __kvm_set_memory_region+0xb7c/0x1040 arch/x86/kvm/../../../virt/kvm/kvm_main.c:1389 kvm_set_memory_region+0x2b/0x40 arch/x86/kvm/../../../virt/kvm/kvm_main.c:1410 kvm_vm_ioctl_set_memory_region arch/x86/kvm/../../../virt/kvm/kvm_main.c:1422 [inline] kvm_vm_ioctl+0x9c1/0x11f0 arch/x86/kvm/../../../virt/kvm/kvm_main.c:3753 vfs_ioctl fs/ioctl.c:48 [inline] __do_sys_ioctl fs/ioctl.c:753 [inline] __se_sys_ioctl+0x115/0x190 fs/ioctl.c:739 __x64_sys_ioctl+0x7b/0x90 fs/ioctl.c:739 do_syscall_64+0x34/0x70 arch/x86/entry/common.c:46 page last free stack trace: reset_page_owner include/linux/page_owner.h:28 [inline] free_pages_prepare mm/page_alloc.c:1331 [inline] free_pcp_prepare+0x18c/0x1c0 mm/page_alloc.c:1405 free_unref_page_prepare mm/page_alloc.c:3291 [inline] free_unref_page mm/page_alloc.c:3341 [inline] free_the_page mm/page_alloc.c:5172 [inline] __free_pages+0x2e0/0x4a0 mm/page_alloc.c:5180 __free_slab+0xd3/0x190 mm/slub.c:1903 free_slab mm/slub.c:1918 [inline] discard_slab mm/slub.c:1924 [inline] unfreeze_partials+0x17d/0x1b0 mm/slub.c:2418 put_cpu_partial+0xc8/0x190 mm/slub.c:2454 __slab_free+0x2d8/0x3a0 mm/slub.c:3104 do_slab_free mm/slub.c:3200 [inline] ___cache_free+0x11f/0x140 mm/slub.c:3219 qlink_free+0x38/0x40 mm/kasan/quarantine.c:146 qlist_free_all+0x4c/0xc0 mm/kasan/quarantine.c:165 kasan_quarantine_reduce+0x15a/0x170 mm/kasan/quarantine.c:272 __kasan_slab_alloc+0x2f/0xe0 mm/kasan/common.c:438 kasan_slab_alloc include/linux/kasan.h:259 [inline] slab_post_alloc_hook mm/slab.h:583 [inline] slab_alloc_node mm/slub.c:2956 [inline] slab_alloc mm/slub.c:2964 [inline] kmem_cache_alloc+0x16c/0x300 mm/slub.c:2969 kmem_cache_zalloc include/linux/slab.h:654 [inline] jbd2_alloc_handle include/linux/jbd2.h:1554 [inline] new_handle fs/jbd2/transaction.c:464 [inline] jbd2__journal_start+0x14f/0x6f0 fs/jbd2/transaction.c:491 __ext4_journal_start_sb+0x237/0x480 fs/ext4/ext4_jbd2.c:105 __ext4_journal_start fs/ext4/ext4_jbd2.h:328 [inline] ext4_evict_inode+0x8bb/0x16d0 fs/ext4/inode.c:253 evict+0x2a3/0x6c0 fs/inode.c:578 Memory state around the buggy address: ffff88810ecf9680: fc fc fa fc fc fc fc fa fc fc fc fc fa fc fc fc ffff88810ecf9700: fc fa fc fc fc fc fa fc fc fc fc fa fc fc fc fc >ffff88810ecf9780: fa fc fc fc fc fa fc fc fc fc 00 fc fc fc fc fa ^ ffff88810ecf9800: fc fc fc fc fa fc fc fc fc fa fc fc fc fc fa fc ffff88810ecf9880: fc fc fc 00 fc fc fc fc fa fc fc fc fc fa fc fc ================================================================== general protection fault, probably for non-canonical address 0xf63ffc446000074e: 0000 [#1] PREEMPT SMP KASAN KASAN: maybe wild-memory-access in range [0xb200022300003a70-0xb200022300003a77] CPU: 0 PID: 14924 Comm: syz-executor.2 Tainted: G B 5.10.109-syzkaller-00693-g414e6c8e941c #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 RIP: 0010:exfat_clear_bitmap+0x163/0x490 fs/exfat/balloc.c:174 Code: 80 3c 08 00 74 08 48 89 df e8 39 26 af ff 44 23 75 b0 4c 8b 23 49 83 c4 28 4c 89 e0 48 c1 e8 03 48 b9 00 00 00 00 00 fc ff df <80> 3c 08 00 74 08 4c 89 e7 e8 0f 26 af ff 41 8d 46 3f 45 85 f6 41 RSP: 0018:ffffc90000db7420 EFLAGS: 00010a07 RAX: 164000446000074e RBX: ffff88810ecf97d8 RCX: dffffc0000000000 RDX: ffffc900026c6000 RSI: 0000000000000286 RDI: 0000000000000001 RBP: ffffc90000db7490 R08: ffffffff813efad3 R09: fffffbfff0d85cf9 R10: fffffbfff0d85cf9 R11: 1ffffffff0d85cf8 R12: b200022300003a74 R13: 1ffff1102914100c R14: 0000000000000000 R15: 0000000000000008 FS: 00007f01a4f1c700(0000) GS:ffff8881f7000000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007fe4c667ed38 CR3: 0000000117c78000 CR4: 00000000003506b0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: exfat_free_cluster+0x25a/0x4a0 fs/exfat/fatent.c:181 __exfat_truncate+0x99e/0xe00 fs/exfat/file.c:217 exfat_truncate+0x11b/0x4f0 fs/exfat/file.c:243 exfat_setattr+0xa03/0xd40 fs/exfat/file.c:339 notify_change+0xb76/0xe10 fs/attr.c:336 do_truncate+0x1ea/0x2d0 fs/open.c:65 handle_truncate fs/namei.c:2989 [inline] do_open fs/namei.c:3331 [inline] path_openat+0x294e/0x2fd0 fs/namei.c:3444 do_filp_open+0x200/0x440 fs/namei.c:3471 do_sys_openat2+0x13b/0x470 fs/open.c:1211 do_sys_open fs/open.c:1227 [inline] __do_sys_creat fs/open.c:1301 [inline] __se_sys_creat fs/open.c:1295 [inline] __x64_sys_creat+0x11f/0x160 fs/open.c:1295 do_syscall_64+0x34/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x7f01a5da60e9 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f01a4f1c168 EFLAGS: 00000246 ORIG_RAX: 0000000000000055 RAX: ffffffffffffffda RBX: 00007f01a5eb8f60 RCX: 00007f01a5da60e9 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000020000080 RBP: 00007f01a5e0008d R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fff3559047f R14: 00007f01a4f1c300 R15: 0000000000022000 Modules linked in: ---[ end trace 816f1fb2ccc63332 ]--- RIP: 0010:exfat_clear_bitmap+0x163/0x490 fs/exfat/balloc.c:174 Code: 80 3c 08 00 74 08 48 89 df e8 39 26 af ff 44 23 75 b0 4c 8b 23 49 83 c4 28 4c 89 e0 48 c1 e8 03 48 b9 00 00 00 00 00 fc ff df <80> 3c 08 00 74 08 4c 89 e7 e8 0f 26 af ff 41 8d 46 3f 45 85 f6 41 RSP: 0018:ffffc90000db7420 EFLAGS: 00010a07 RAX: 164000446000074e RBX: ffff88810ecf97d8 RCX: dffffc0000000000 RDX: ffffc900026c6000 RSI: 0000000000000286 RDI: 0000000000000001 RBP: ffffc90000db7490 R08: ffffffff813efad3 R09: fffffbfff0d85cf9 R10: fffffbfff0d85cf9 R11: 1ffffffff0d85cf8 R12: b200022300003a74 R13: 1ffff1102914100c R14: 0000000000000000 R15: 0000000000000008 FS: 00007f01a4f1c700(0000) GS:ffff8881f7000000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007fe4c75ec058 CR3: 0000000117c78000 CR4: 00000000003506b0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 ---------------- Code disassembly (best guess): 0: 80 3c 08 00 cmpb $0x0,(%rax,%rcx,1) 4: 74 08 je 0xe 6: 48 89 df mov %rbx,%rdi 9: e8 39 26 af ff callq 0xffaf2647 e: 44 23 75 b0 and -0x50(%rbp),%r14d 12: 4c 8b 23 mov (%rbx),%r12 15: 49 83 c4 28 add $0x28,%r12 19: 4c 89 e0 mov %r12,%rax 1c: 48 c1 e8 03 shr $0x3,%rax 20: 48 b9 00 00 00 00 00 movabs $0xdffffc0000000000,%rcx 27: fc ff df * 2a: 80 3c 08 00 cmpb $0x0,(%rax,%rcx,1) <-- trapping instruction 2e: 74 08 je 0x38 30: 4c 89 e7 mov %r12,%rdi 33: e8 0f 26 af ff callq 0xffaf2647 38: 41 8d 46 3f lea 0x3f(%r14),%eax 3c: 45 85 f6 test %r14d,%r14d 3f: 41 rex.B