RBP: 00007fa720c87040 R08: 00007fa720c87040 R09: 0000000020000000 R10: 0000000000000000 R11: 0000000000000206 R12: 0000000020000000 R13: 0000000020000100 R14: 00007fa720c87000 R15: 0000000020047a20 gfs2: fsid=syz:syz.0: can't lock local "sc" file: -5 ================================================================== BUG: KASAN: use-after-free in iput+0x6b/0x70 fs/inode.c:1676 Read of size 8 at addr ffff8880b1290740 by task syz-executor.4/19388 CPU: 0 PID: 19388 Comm: syz-executor.4 Not tainted 5.13.0-rc1-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 iput+0x6b/0x70 fs/inode.c:1676 init_statfs fs/gfs2/ops_fstype.c:701 [inline] init_journal fs/gfs2/ops_fstype.c:805 [inline] init_inodes+0x20e6/0x2610 fs/gfs2/ops_fstype.c:874 gfs2_fill_super+0x1b4a/0x2680 fs/gfs2/ops_fstype.c:1204 get_tree_bdev+0x440/0x760 fs/super.c:1293 gfs2_get_tree+0x4a/0x270 fs/gfs2/ops_fstype.c:1273 vfs_get_tree+0x89/0x2f0 fs/super.c:1498 do_new_mount fs/namespace.c:2905 [inline] path_mount+0x132a/0x1fa0 fs/namespace.c:3235 do_mount fs/namespace.c:3248 [inline] __do_sys_mount fs/namespace.c:3456 [inline] __se_sys_mount fs/namespace.c:3433 [inline] __x64_sys_mount+0x27f/0x300 fs/namespace.c:3433 do_syscall_64+0x3a/0xb0 arch/x86/entry/common.c:47 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x467afa Code: 48 c7 c2 bc ff ff ff f7 d8 64 89 02 b8 ff ff ff ff eb d2 e8 b8 04 00 00 0f 1f 84 00 00 00 00 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fa720c86fa8 EFLAGS: 00000206 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 0000000020000200 RCX: 0000000000467afa RDX: 0000000020000000 RSI: 0000000020000100 RDI: 00007fa720c87000 RBP: 00007fa720c87040 R08: 00007fa720c87040 R09: 0000000020000000 R10: 0000000000000000 R11: 0000000000000206 R12: 0000000020000000 R13: 0000000020000100 R14: 00007fa720c87000 R15: 0000000020047a20 Allocated by task 19388: 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:524 [inline] slab_alloc_node mm/slub.c:2912 [inline] slab_alloc mm/slub.c:2920 [inline] kmem_cache_alloc+0x152/0x3a0 mm/slub.c:2925 gfs2_alloc_inode+0x38/0x1a0 fs/gfs2/super.c:1499 alloc_inode+0x61/0x230 fs/inode.c:233 iget5_locked fs/inode.c:1154 [inline] iget5_locked+0x1e7/0x2e0 fs/inode.c:1147 gfs2_iget fs/gfs2/inode.c:64 [inline] gfs2_inode_lookup+0x104/0xb10 fs/gfs2/inode.c:140 gfs2_dir_search+0x20f/0x2c0 fs/gfs2/dir.c:1665 gfs2_lookupi+0x475/0x640 fs/gfs2/inode.c:332 gfs2_lookup_simple+0x99/0xe0 fs/gfs2/inode.c:273 init_statfs fs/gfs2/ops_fstype.c:658 [inline] init_journal fs/gfs2/ops_fstype.c:805 [inline] init_inodes+0x16a0/0x2610 fs/gfs2/ops_fstype.c:874 gfs2_fill_super+0x1b4a/0x2680 fs/gfs2/ops_fstype.c:1204 get_tree_bdev+0x440/0x760 fs/super.c:1293 gfs2_get_tree+0x4a/0x270 fs/gfs2/ops_fstype.c:1273 vfs_get_tree+0x89/0x2f0 fs/super.c:1498 do_new_mount fs/namespace.c:2905 [inline] path_mount+0x132a/0x1fa0 fs/namespace.c:3235 do_mount fs/namespace.c:3248 [inline] __do_sys_mount fs/namespace.c:3456 [inline] __se_sys_mount fs/namespace.c:3433 [inline] __x64_sys_mount+0x27f/0x300 fs/namespace.c:3433 do_syscall_64+0x3a/0xb0 arch/x86/entry/common.c:47 entry_SYSCALL_64_after_hwframe+0x44/0xae Freed by task 19: 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:1581 [inline] slab_free_freelist_hook+0xdf/0x240 mm/slub.c:1606 slab_free mm/slub.c:3166 [inline] kmem_cache_free+0x8a/0x740 mm/slub.c:3182 i_callback+0x3f/0x70 fs/inode.c:222 rcu_do_batch kernel/rcu/tree.c:2558 [inline] rcu_core+0x7ab/0x13b0 kernel/rcu/tree.c:2793 __do_softirq+0x29b/0x9f6 kernel/softirq.c:559 Last potentially related work creation: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_record_aux_stack+0xe5/0x110 mm/kasan/generic.c:345 __call_rcu kernel/rcu/tree.c:3038 [inline] call_rcu+0xb1/0x750 kernel/rcu/tree.c:3113 destroy_inode+0x129/0x1b0 fs/inode.c:288 iput_final fs/inode.c:1660 [inline] iput.part.0+0x57e/0x810 fs/inode.c:1686 iput+0x58/0x70 fs/inode.c:1676 init_statfs fs/gfs2/ops_fstype.c:689 [inline] init_journal fs/gfs2/ops_fstype.c:805 [inline] init_inodes+0x19aa/0x2610 fs/gfs2/ops_fstype.c:874 gfs2_fill_super+0x1b4a/0x2680 fs/gfs2/ops_fstype.c:1204 get_tree_bdev+0x440/0x760 fs/super.c:1293 gfs2_get_tree+0x4a/0x270 fs/gfs2/ops_fstype.c:1273 vfs_get_tree+0x89/0x2f0 fs/super.c:1498 do_new_mount fs/namespace.c:2905 [inline] path_mount+0x132a/0x1fa0 fs/namespace.c:3235 do_mount fs/namespace.c:3248 [inline] __do_sys_mount fs/namespace.c:3456 [inline] __se_sys_mount fs/namespace.c:3433 [inline] __x64_sys_mount+0x27f/0x300 fs/namespace.c:3433 do_syscall_64+0x3a/0xb0 arch/x86/entry/common.c:47 entry_SYSCALL_64_after_hwframe+0x44/0xae Second to last potentially related work creation: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_record_aux_stack+0xe5/0x110 mm/kasan/generic.c:345 __call_rcu kernel/rcu/tree.c:3038 [inline] call_rcu+0xb1/0x750 kernel/rcu/tree.c:3113 destroy_inode+0x129/0x1b0 fs/inode.c:288 iput_final fs/inode.c:1660 [inline] iput.part.0+0x57e/0x810 fs/inode.c:1686 iput+0x58/0x70 fs/inode.c:1676 init_statfs fs/gfs2/ops_fstype.c:689 [inline] init_journal fs/gfs2/ops_fstype.c:805 [inline] init_inodes+0x19aa/0x2610 fs/gfs2/ops_fstype.c:874 gfs2_fill_super+0x1b4a/0x2680 fs/gfs2/ops_fstype.c:1204 get_tree_bdev+0x440/0x760 fs/super.c:1293 gfs2_get_tree+0x4a/0x270 fs/gfs2/ops_fstype.c:1273 vfs_get_tree+0x89/0x2f0 fs/super.c:1498 do_new_mount fs/namespace.c:2905 [inline] path_mount+0x132a/0x1fa0 fs/namespace.c:3235 do_mount fs/namespace.c:3248 [inline] __do_sys_mount fs/namespace.c:3456 [inline] __se_sys_mount fs/namespace.c:3433 [inline] __x64_sys_mount+0x27f/0x300 fs/namespace.c:3433 do_syscall_64+0x3a/0xb0 arch/x86/entry/common.c:47 entry_SYSCALL_64_after_hwframe+0x44/0xae The buggy address belongs to the object at ffff8880b1290668 which belongs to the cache gfs2_inode of size 1512 The buggy address is located 216 bytes inside of 1512-byte region [ffff8880b1290668, ffff8880b1290c50) The buggy address belongs to the page: page:ffffea0002c4a400 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0xb1290 head:ffffea0002c4a400 order:3 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 ffffea0005363600 0000000300000003 ffff8881409afc80 raw: 0000000000000000 0000000080130013 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Reclaimable, gfp_mask 0xd20d0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_RECLAIMABLE), pid 11027, ts 1532170766399, free_ts 1050634919379 prep_new_page mm/page_alloc.c:2358 [inline] get_page_from_freelist+0x1033/0x2b60 mm/page_alloc.c:3994 __alloc_pages+0x1b2/0x500 mm/page_alloc.c:5200 alloc_pages+0x18c/0x2a0 mm/mempolicy.c:2272 alloc_slab_page mm/slub.c:1644 [inline] allocate_slab+0x2c5/0x4c0 mm/slub.c:1784 new_slab mm/slub.c:1847 [inline] new_slab_objects mm/slub.c:2593 [inline] ___slab_alloc+0x44c/0x7a0 mm/slub.c:2756 __slab_alloc.constprop.0+0xa7/0xf0 mm/slub.c:2796 slab_alloc_node mm/slub.c:2878 [inline] slab_alloc mm/slub.c:2920 [inline] kmem_cache_alloc+0x34b/0x3a0 mm/slub.c:2925 gfs2_alloc_inode+0x38/0x1a0 fs/gfs2/super.c:1499 alloc_inode+0x61/0x230 fs/inode.c:233 iget5_locked fs/inode.c:1154 [inline] iget5_locked+0x1e7/0x2e0 fs/inode.c:1147 gfs2_iget fs/gfs2/inode.c:64 [inline] gfs2_inode_lookup+0x104/0xb10 fs/gfs2/inode.c:140 gfs2_dir_search+0x20f/0x2c0 fs/gfs2/dir.c:1665 gfs2_lookupi+0x475/0x640 fs/gfs2/inode.c:332 gfs2_lookup_simple+0x99/0xe0 fs/gfs2/inode.c:273 init_inodes+0x1c79/0x2610 fs/gfs2/ops_fstype.c:880 gfs2_fill_super+0x1b4a/0x2680 fs/gfs2/ops_fstype.c:1204 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1298 [inline] __free_pages_ok+0x476/0xce0 mm/page_alloc.c:1572 unfreeze_partials+0x16c/0x1b0 mm/slub.c:2374 put_cpu_partial+0x13d/0x230 mm/slub.c:2410 qlink_free mm/kasan/quarantine.c:146 [inline] qlist_free_all+0x5a/0xc0 mm/kasan/quarantine.c:165 kasan_quarantine_reduce+0x180/0x200 mm/kasan/quarantine.c:272 __kasan_slab_alloc+0x8e/0xa0 mm/kasan/common.c:438 kasan_slab_alloc include/linux/kasan.h:236 [inline] slab_post_alloc_hook mm/slab.h:524 [inline] slab_alloc_node mm/slub.c:2912 [inline] slab_alloc mm/slub.c:2920 [inline] __kmalloc+0x1f7/0x330 mm/slub.c:4063 kmalloc include/linux/slab.h:561 [inline] tomoyo_realpath_from_path+0xc3/0x620 security/tomoyo/realpath.c:254 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_path_perm+0x21b/0x400 security/tomoyo/file.c:822 security_inode_getattr+0xcf/0x140 security/security.c:1332 vfs_getattr fs/stat.c:139 [inline] vfs_statx+0x164/0x390 fs/stat.c:207 vfs_fstatat fs/stat.c:225 [inline] vfs_lstat include/linux/fs.h:3384 [inline] __do_sys_newlstat+0x91/0x110 fs/stat.c:380 do_syscall_64+0x3a/0xb0 arch/x86/entry/common.c:47 entry_SYSCALL_64_after_hwframe+0x44/0xae Memory state around the buggy address: ffff8880b1290600: fc fc fc fc fc fc fc fc fc fc fc fc fc fa fb fb ffff8880b1290680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880b1290700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880b1290780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880b1290800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================