F2FS-fs (loop5): Cannot turn on quotas: -2 on 0 F2FS-fs (loop5): Mounted with checkpoint version = 48b305e4 ================================================================== BUG: KASAN: use-after-free in wb_get include/linux/backing-dev-defs.h:242 [inline] BUG: KASAN: use-after-free in locked_inode_to_wb_and_lock_list+0x68/0x2f0 fs/fs-writeback.c:303 Read of size 8 at addr ffff88811d438060 by task syz-executor.5/32106 CPU: 1 PID: 32106 Comm: syz-executor.5 Not tainted 5.10.194-syzkaller-00508-ga27512601c2d #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/26/2023 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack_lvl+0x1e2/0x24b lib/dump_stack.c:118 print_address_description+0x81/0x3b0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:435 [inline] kasan_report+0x179/0x1c0 mm/kasan/report.c:452 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report_generic.c:309 wb_get include/linux/backing-dev-defs.h:242 [inline] locked_inode_to_wb_and_lock_list+0x68/0x2f0 fs/fs-writeback.c:303 __mark_inode_dirty+0x400/0x9d0 fs/fs-writeback.c:2311 mark_inode_dirty_sync include/linux/fs.h:2266 [inline] f2fs_mark_inode_dirty_sync+0x99/0xa0 fs/f2fs/inode.c:33 f2fs_setflags_common+0x5e9/0x880 fs/f2fs/file.c:1900 f2fs_ioc_setflags fs/f2fs/file.c:2038 [inline] __f2fs_ioctl+0x6c0b/0xd830 fs/f2fs/file.c:4266 f2fs_ioctl+0x143/0x1d0 fs/f2fs/file.c:4365 vfs_ioctl fs/ioctl.c:48 [inline] __do_sys_ioctl fs/ioctl.c:753 [inline] __se_sys_ioctl+0x114/0x190 fs/ioctl.c:739 __x64_sys_ioctl+0x7b/0x90 fs/ioctl.c:739 do_syscall_64+0x34/0x70 entry_SYSCALL_64_after_hwframe+0x61/0xc6 RIP: 0033:0x7fac131c1ae9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 90 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 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fac11f440c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007fac132e0f80 RCX: 00007fac131c1ae9 RDX: 0000000020000280 RSI: 0000000040086602 RDI: 0000000000000005 RBP: 00007fac1320d47a R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007fac132e0f80 R15: 00007ffd3311e278 Allocated by task 31541: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:45 [inline] set_alloc_info mm/kasan/common.c:430 [inline] ____kasan_kmalloc+0xdb/0x110 mm/kasan/common.c:509 __kasan_kmalloc+0x9/0x10 mm/kasan/common.c:518 kasan_kmalloc include/linux/kasan.h:254 [inline] __kmalloc+0x1aa/0x330 mm/slub.c:4033 kmalloc include/linux/slab.h:557 [inline] f2fs_kmalloc fs/f2fs/f2fs.h:3348 [inline] f2fs_fill_super+0x3733/0x7e30 fs/f2fs/super.c:4144 mount_bdev+0x262/0x370 fs/super.c:1429 f2fs_mount+0x34/0x40 fs/f2fs/super.c:4550 legacy_get_tree+0xf1/0x190 fs/fs_context.c:593 vfs_get_tree+0x88/0x290 fs/super.c:1559 do_new_mount+0x28b/0xad0 fs/namespace.c:2899 path_mount+0x56f/0xcb0 fs/namespace.c:3229 do_mount fs/namespace.c:3242 [inline] __do_sys_mount fs/namespace.c:3450 [inline] __se_sys_mount+0x2c4/0x3b0 fs/namespace.c:3427 __x64_sys_mount+0xbf/0xd0 fs/namespace.c:3427 do_syscall_64+0x34/0x70 entry_SYSCALL_64_after_hwframe+0x61/0xc6 Freed by task 440: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:45 kasan_set_free_info+0x23/0x40 mm/kasan/generic.c:370 ____kasan_slab_free+0x121/0x160 mm/kasan/common.c:362 __kasan_slab_free+0x11/0x20 mm/kasan/common.c:370 kasan_slab_free include/linux/kasan.h:220 [inline] slab_free_hook mm/slub.c:1595 [inline] slab_free_freelist_hook+0xc0/0x190 mm/slub.c:1621 slab_free mm/slub.c:3203 [inline] kfree+0xc3/0x270 mm/slub.c:4191 kvfree+0x35/0x40 mm/util.c:647 f2fs_put_super+0xa3b/0xc10 fs/f2fs/super.c:1650 generic_shutdown_super+0x14f/0x2d0 fs/super.c:465 kill_block_super+0x7e/0xe0 fs/super.c:1456 kill_f2fs_super+0x2f9/0x3c0 fs/f2fs/super.c:4582 deactivate_locked_super+0xad/0x110 fs/super.c:335 deactivate_super+0xbe/0xf0 fs/super.c:366 cleanup_mnt+0x45c/0x510 fs/namespace.c:1118 __cleanup_mnt+0x19/0x20 fs/namespace.c:1125 task_work_run+0x129/0x190 kernel/task_work.c:164 tracehook_notify_resume include/linux/tracehook.h:188 [inline] exit_to_user_mode_loop+0xbf/0xd0 kernel/entry/common.c:172 exit_to_user_mode_prepare kernel/entry/common.c:199 [inline] syscall_exit_to_user_mode+0xc5/0x1d0 kernel/entry/common.c:274 do_syscall_64+0x40/0x70 arch/x86/entry/common.c:56 entry_SYSCALL_64_after_hwframe+0x61/0xc6 Last potentially related work creation: kasan_save_stack+0x3b/0x60 mm/kasan/common.c:38 __kasan_record_aux_stack+0xd3/0x100 mm/kasan/generic.c:348 kasan_record_aux_stack_noalloc+0xb/0x10 mm/kasan/generic.c:358 insert_work+0x56/0x310 kernel/workqueue.c:1352 __queue_work+0x970/0xd10 kernel/workqueue.c:1518 __queue_delayed_work+0x182/0x1f0 kernel/workqueue.c:1672 mod_delayed_work_on+0xff/0x190 kernel/workqueue.c:1746 mod_delayed_work include/linux/workqueue.h:544 [inline] wb_shutdown+0x176/0x1c0 mm/backing-dev.c:351 bdi_unregister+0x189/0x5b0 mm/backing-dev.c:880 del_gendisk+0x503/0xa90 block/genhd.c:929 loop_remove+0x46/0xb0 drivers/block/loop.c:2210 loop_control_ioctl+0x564/0x620 drivers/block/loop.c:2309 vfs_ioctl fs/ioctl.c:48 [inline] __do_sys_ioctl fs/ioctl.c:753 [inline] __se_sys_ioctl+0x114/0x190 fs/ioctl.c:739 __x64_sys_ioctl+0x7b/0x90 fs/ioctl.c:739 do_syscall_64+0x34/0x70 entry_SYSCALL_64_after_hwframe+0x61/0xc6 Second to last potentially related work creation: kasan_save_stack+0x3b/0x60 mm/kasan/common.c:38 __kasan_record_aux_stack+0xd3/0x100 mm/kasan/generic.c:348 kasan_record_aux_stack_noalloc+0xb/0x10 mm/kasan/generic.c:358 insert_work+0x56/0x310 kernel/workqueue.c:1352 __queue_work+0x970/0xd10 kernel/workqueue.c:1518 __queue_delayed_work+0x182/0x1f0 kernel/workqueue.c:1672 mod_delayed_work_on+0xff/0x190 kernel/workqueue.c:1746 mod_delayed_work include/linux/workqueue.h:544 [inline] wb_queue_work+0x2da/0x400 fs/fs-writeback.c:189 bdi_split_work_to_wbs+0x50e/0xab0 fs/fs-writeback.c:883 sync_inodes_sb+0x2a2/0x8a0 fs/fs-writeback.c:2547 sync_filesystem+0x188/0x250 fs/sync.c:63 f2fs_quota_off_umount+0x20e/0x220 fs/f2fs/super.c:2869 f2fs_put_super+0xb9/0xc10 fs/f2fs/super.c:1560 generic_shutdown_super+0x14f/0x2d0 fs/super.c:465 kill_block_super+0x7e/0xe0 fs/super.c:1456 kill_f2fs_super+0x2f9/0x3c0 fs/f2fs/super.c:4582 deactivate_locked_super+0xad/0x110 fs/super.c:335 deactivate_super+0xbe/0xf0 fs/super.c:366 cleanup_mnt+0x45c/0x510 fs/namespace.c:1118 __cleanup_mnt+0x19/0x20 fs/namespace.c:1125 task_work_run+0x129/0x190 kernel/task_work.c:164 tracehook_notify_resume include/linux/tracehook.h:188 [inline] exit_to_user_mode_loop+0xbf/0xd0 kernel/entry/common.c:172 exit_to_user_mode_prepare kernel/entry/common.c:199 [inline] syscall_exit_to_user_mode+0xc5/0x1d0 kernel/entry/common.c:274 do_syscall_64+0x40/0x70 arch/x86/entry/common.c:56 entry_SYSCALL_64_after_hwframe+0x61/0xc6 The buggy address belongs to the object at ffff88811d438000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 96 bytes inside of 2048-byte region [ffff88811d438000, ffff88811d438800) The buggy address belongs to the page: page:ffffea0004750e00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x11d438 head:ffffea0004750e00 order:3 compound_mapcount:0 compound_pincount:0 flags: 0x4000000000010200(slab|head) raw: 4000000000010200 ffffea000564fe00 0000000200000002 ffff888100042d80 raw: 0000000000000000 0000000000080008 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 437, ts 153936098095, free_ts 153922734476 set_page_owner include/linux/page_owner.h:35 [inline] post_alloc_hook mm/page_alloc.c:2456 [inline] prep_new_page+0x166/0x180 mm/page_alloc.c:2462 get_page_from_freelist+0x2d8c/0x2f30 mm/page_alloc.c:4254 __alloc_pages_nodemask+0x435/0xaf0 mm/page_alloc.c:5346 allocate_slab mm/slub.c:1808 [inline] new_slab+0x80/0x400 mm/slub.c:1869 new_slab_objects mm/slub.c:2627 [inline] ___slab_alloc+0x302/0x4b0 mm/slub.c:2791 __slab_alloc+0x63/0xa0 mm/slub.c:2831 slab_alloc_node mm/slub.c:2913 [inline] slab_alloc mm/slub.c:2955 [inline] __kmalloc+0x204/0x330 mm/slub.c:4029 kmalloc include/linux/slab.h:557 [inline] kzalloc include/linux/slab.h:664 [inline] __register_sysctl_table+0xea/0x1240 fs/proc/proc_sysctl.c:1321 register_net_sysctl+0x2c/0x40 net/sysctl_net.c:121 __devinet_sysctl_register+0x1d3/0x2a0 net/ipv4/devinet.c:2572 devinet_sysctl_register+0x16a/0x1e0 net/ipv4/devinet.c:2612 inetdev_init+0x25f/0x460 net/ipv4/devinet.c:276 inetdev_event+0x205/0x1040 net/ipv4/devinet.c:1531 notifier_call_chain kernel/notifier.c:83 [inline] raw_notifier_call_chain+0x8c/0xf0 kernel/notifier.c:410 call_netdevice_notifiers_info net/core/dev.c:2054 [inline] call_netdevice_notifiers_extack net/core/dev.c:2066 [inline] call_netdevice_notifiers+0x145/0x1b0 net/core/dev.c:2080 register_netdevice+0x1066/0x13f0 net/core/dev.c:10059 page last free stack trace: reset_page_owner include/linux/page_owner.h:28 [inline] free_pages_prepare mm/page_alloc.c:1349 [inline] __free_pages_ok+0x82c/0x850 mm/page_alloc.c:1629 free_the_page+0x76/0x370 mm/page_alloc.c:5407 __free_pages+0x67/0xc0 mm/page_alloc.c:5416 __free_slab+0xcf/0x190 mm/slub.c:1894 free_slab mm/slub.c:1909 [inline] discard_slab+0x29/0x40 mm/slub.c:1915 __slab_free+0x30d/0x3a0 mm/slub.c:3131 do_slab_free mm/slub.c:3191 [inline] ___cache_free+0x111/0x130 mm/slub.c:3210 qlink_free+0x50/0x90 mm/kasan/quarantine.c:157 qlist_free_all+0x47/0xb0 mm/kasan/quarantine.c:176 kasan_quarantine_reduce+0x15a/0x170 mm/kasan/quarantine.c:283 __kasan_slab_alloc+0x2f/0xe0 mm/kasan/common.c:440 kasan_slab_alloc include/linux/kasan.h:244 [inline] slab_post_alloc_hook+0x61/0x2f0 mm/slab.h:583 slab_alloc_node mm/slub.c:2947 [inline] slab_alloc mm/slub.c:2955 [inline] kmem_cache_alloc_trace+0x163/0x2e0 mm/slub.c:2972 kmalloc include/linux/slab.h:552 [inline] syslog_print+0x121/0x860 kernel/printk/printk.c:1487 do_syslog+0x90e/0x970 kernel/printk/printk.c:1644 __do_sys_syslog kernel/printk/printk.c:1736 [inline] __se_sys_syslog kernel/printk/printk.c:1734 [inline] __x64_sys_syslog+0x7c/0x90 kernel/printk/printk.c:1734 Memory state around the buggy address: ffff88811d437f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88811d437f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88811d438000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88811d438080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88811d438100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== general protection fault, probably for non-canonical address 0xffff110314538288: 0000 [#1] PREEMPT SMP KASAN KASAN: maybe wild-memory-access in range [0xfff8a818a29c1440-0xfff8a818a29c1447] CPU: 1 PID: 32106 Comm: syz-executor.5 Tainted: G B 5.10.194-syzkaller-00508-ga27512601c2d #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/26/2023 RIP: 0010:percpu_ref_get_many include/linux/percpu-refcount.h:205 [inline] RIP: 0010:percpu_ref_get include/linux/percpu-refcount.h:222 [inline] RIP: 0010:wb_get include/linux/backing-dev-defs.h:243 [inline] RIP: 0010:locked_inode_to_wb_and_lock_list+0xc4/0x2f0 fs/fs-writeback.c:303 Code: 89 df e8 5f ad eb ff 48 8b 1b 48 89 de 48 83 e6 03 31 ff e8 0e 5d ae ff 48 89 d8 48 83 e0 03 0f 85 8e 00 00 00 e8 bc 58 ae ff <65> 48 ff 03 e8 c3 67 9b ff eb 05 e8 ac 58 ae ff 48 8b 7d d0 e8 53 RSP: 0018:ffffc9000a697790 EFLAGS: 00010246 RAX: ffffffff81bc4774 RBX: ffff88811d438288 RCX: 0000000000040000 RDX: ffffc900015ed000 RSI: 000000000003ffff RDI: 0000000000040000 RBP: ffffc9000a6977c8 R08: ffffffff81bc4762 R09: 0000000000000003 R10: fffffbfff0e10048 R11: dffffc0000000001 R12: ffff88811d438060 R13: dffffc0000000000 R14: 1ffff11023a8700c R15: ffff88815f5447e0 FS: 00007fac11f446c0(0000) GS:ffff8881f7100000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 000000002057eff8 CR3: 000000010c921000 CR4: 00000000003506a0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: __mark_inode_dirty+0x400/0x9d0 fs/fs-writeback.c:2311 mark_inode_dirty_sync include/linux/fs.h:2266 [inline] f2fs_mark_inode_dirty_sync+0x99/0xa0 fs/f2fs/inode.c:33 f2fs_setflags_common+0x5e9/0x880 fs/f2fs/file.c:1900 f2fs_ioc_setflags fs/f2fs/file.c:2038 [inline] __f2fs_ioctl+0x6c0b/0xd830 fs/f2fs/file.c:4266 f2fs_ioctl+0x143/0x1d0 fs/f2fs/file.c:4365 vfs_ioctl fs/ioctl.c:48 [inline] __do_sys_ioctl fs/ioctl.c:753 [inline] __se_sys_ioctl+0x114/0x190 fs/ioctl.c:739 __x64_sys_ioctl+0x7b/0x90 fs/ioctl.c:739 do_syscall_64+0x34/0x70 entry_SYSCALL_64_after_hwframe+0x61/0xc6 RIP: 0033:0x7fac131c1ae9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 90 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 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fac11f440c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007fac132e0f80 RCX: 00007fac131c1ae9 RDX: 0000000020000280 RSI: 0000000040086602 RDI: 0000000000000005 RBP: 00007fac1320d47a R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007fac132e0f80 R15: 00007ffd3311e278 Modules linked in: ---[ end trace fc56e3603b09864f ]--- RIP: 0010:percpu_ref_get_many include/linux/percpu-refcount.h:205 [inline] RIP: 0010:percpu_ref_get include/linux/percpu-refcount.h:222 [inline] RIP: 0010:wb_get include/linux/backing-dev-defs.h:243 [inline] RIP: 0010:locked_inode_to_wb_and_lock_list+0xc4/0x2f0 fs/fs-writeback.c:303 Code: 89 df e8 5f ad eb ff 48 8b 1b 48 89 de 48 83 e6 03 31 ff e8 0e 5d ae ff 48 89 d8 48 83 e0 03 0f 85 8e 00 00 00 e8 bc 58 ae ff <65> 48 ff 03 e8 c3 67 9b ff eb 05 e8 ac 58 ae ff 48 8b 7d d0 e8 53 RSP: 0018:ffffc9000a697790 EFLAGS: 00010246 RAX: ffffffff81bc4774 RBX: ffff88811d438288 RCX: 0000000000040000 RDX: ffffc900015ed000 RSI: 000000000003ffff RDI: 0000000000040000 RBP: ffffc9000a6977c8 R08: ffffffff81bc4762 R09: 0000000000000003 R10: fffffbfff0e10048 R11: dffffc0000000001 R12: ffff88811d438060 R13: dffffc0000000000 R14: 1ffff11023a8700c R15: ffff88815f5447e0 FS: 00007fac11f446c0(0000) GS:ffff8881f7100000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 000000002057eff8 CR3: 000000010c921000 CR4: 00000000003506a0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 ---------------- Code disassembly (best guess): 0: 89 df mov %ebx,%edi 2: e8 5f ad eb ff call 0xffebad66 7: 48 8b 1b mov (%rbx),%rbx a: 48 89 de mov %rbx,%rsi d: 48 83 e6 03 and $0x3,%rsi 11: 31 ff xor %edi,%edi 13: e8 0e 5d ae ff call 0xffae5d26 18: 48 89 d8 mov %rbx,%rax 1b: 48 83 e0 03 and $0x3,%rax 1f: 0f 85 8e 00 00 00 jne 0xb3 25: e8 bc 58 ae ff call 0xffae58e6 * 2a: 65 48 ff 03 incq %gs:(%rbx) <-- trapping instruction 2e: e8 c3 67 9b ff call 0xff9b67f6 33: eb 05 jmp 0x3a 35: e8 ac 58 ae ff call 0xffae58e6 3a: 48 8b 7d d0 mov -0x30(%rbp),%rdi 3e: e8 .byte 0xe8 3f: 53 push %rbx