================================================================== BUG: KASAN: slab-use-after-free in ext4_discard_work+0xa1/0x7f0 fs/ext4/mballoc.c:3645 Read of size 8 at addr ffff88805cf583f0 by task kworker/u8:16/6900 CPU: 1 UID: 0 PID: 6900 Comm: kworker/u8: CPU: 1 UID: 0 PID: 6900 Comm: kworker/u8:16 Not tainted syzkaller #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/06/2026 Workqueue: events_unbound ext4_discard_work Call Trace: dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120 print_address_description+0x55/0x1e0 mm/kasan/report.c:378 print_report+0x58/0x70 mm/kasan/report.c:482 kasan_report+0x117/0x150 mm/kasan/report.c:595 ext4_discard_work+0xa1/0x7f0 fs/ext4/mballoc.c:3645 process_one_work kernel/workqueue.c:3511 [inline] process_scheduled_works+0xc3d/0x1630 kernel/workqueue.c:3594 worker_thread+0xa47/0xfb0 kernel/workqueue.c:3675 kthread+0x38b/0x480 kernel/kthread.c:436 ret_from_fork+0x514/0xb70 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Allocated by task 12869: kasan_save_stack mm/kasan/common.c:57 [inline] kasan_save_track+0x3f/0x90 mm/kasan/common.c:79 poison_kmalloc_redzone mm/kasan/common.c:412 [inline] __kasan_kmalloc+0x93/0xb0 mm/kasan/common.c:429 kasan_kmalloc include/linux/kasan.h:267 [inline] __kmalloc_cache_noprof+0x31c/0x600 mm/slub.c:5687 _kmalloc_noprof include/linux/slab.h:991 [inline] _kzalloc_noprof include/linux/slab.h:1312 [inline] ext4_alloc_sbi fs/ext4/super.c:4425 [inline] ext4_fill_super+0x118/0x6630 fs/ext4/super.c:5887 get_tree_bdev_flags+0x436/0x500 fs/super.c:2108 vfs_get_tree+0x92/0x2a0 fs/super.c:2168 fc_mount fs/namespace.c:1300 [inline] do_new_mount_fc fs/namespace.c:4036 [inline] do_new_mount+0x325/0xb00 fs/namespace.c:4112 do_mount fs/namespace.c:4476 [inline] __do_sys_mount fs/namespace.c:4689 [inline] __se_sys_mount+0x31d/0x420 fs/namespace.c:4666 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x171/0x540 arch/x86/entry/syscall_64.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 12869: kasan_save_stack mm/kasan/common.c:57 [inline] kasan_save_track+0x3f/0x90 mm/kasan/common.c:79 kasan_save_free_info+0x40/0x50 mm/kasan/generic.c:599 poison_slab_object mm/kasan/common.c:267 [inline] __kasan_slab_free+0x70/0x90 mm/kasan/common.c:299 kasan_slab_free include/linux/kasan.h:239 [inline] slab_free_hook mm/slub.c:2780 [inline] slab_free mm/slub.c:6624 [inline] kfree+0x1c7/0x650 mm/slub.c:6917 ext4_free_sbi fs/ext4/super.c:4418 [inline] ext4_fill_super+0x2962/0x6630 fs/ext4/super.c:5925 get_tree_bdev_flags+0x436/0x500 fs/super.c:2108 vfs_get_tree+0x92/0x2a0 fs/super.c:2168 fc_mount fs/namespace.c:1300 [inline] do_new_mount_fc fs/namespace.c:4036 [inline] do_new_mount+0x325/0xb00 fs/namespace.c:4112 do_mount fs/namespace.c:4476 [inline] __do_sys_mount fs/namespace.c:4689 [inline] __se_sys_mount+0x31d/0x420 fs/namespace.c:4666 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x171/0x540 arch/x86/entry/syscall_64.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f Last potentially related work creation: kasan_save_stack+0x3e/0x60 mm/kasan/common.c:57 __kasan_record_aux_stack+0xc5/0xe0 mm/kasan/generic.c:561 insert_work+0x3d/0x330 kernel/workqueue.c:2359 __queue_work+0xc6b/0x12d0 kernel/workqueue.c:2558 queue_work_on+0x106/0x1d0 kernel/workqueue.c:2611 queue_work include/linux/workqueue.h:698 [inline] ext4_process_freed_data+0xa15/0xab0 fs/ext4/mballoc.c:4037 ext4_journal_commit_callback+0x99/0x620 fs/ext4/super.c:526 jbd2_journal_commit_transaction+0x4902/0x5c60 fs/jbd2/commit.c:1147 kjournald2+0x3bc/0x740 fs/jbd2/journal.c:200 kthread+0x38b/0x480 kernel/kthread.c:436 ret_from_fork+0x514/0xb70 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Second to last potentially related work creation: kasan_save_stack+0x3e/0x60 mm/kasan/common.c:57 __kasan_record_aux_stack+0xc5/0xe0 mm/kasan/generic.c:561 insert_work+0x3d/0x330 kernel/workqueue.c:2359 __queue_work+0xc6b/0x12d0 kernel/workqueue.c:2558 queue_work_on+0x106/0x1d0 kernel/workqueue.c:2611 queue_work include/linux/workqueue.h:698 [inline] schedule_work include/linux/workqueue.h:759 [inline] ext4_handle_error+0x668/0x990 fs/ext4/super.c:734 __ext4_error+0x24d/0x360 fs/ext4/super.c:849 ext4_init_orphan_info+0xb75/0xda0 fs/ext4/orphan.c:625 __ext4_fill_super fs/ext4/super.c:5751 [inline] ext4_fill_super+0x5b11/0x6630 fs/ext4/super.c:5900 get_tree_bdev_flags+0x436/0x500 fs/super.c:2108 vfs_get_tree+0x92/0x2a0 fs/super.c:2168 fc_mount fs/namespace.c:1300 [inline] do_new_mount_fc fs/namespace.c:4036 [inline] do_new_mount+0x325/0xb00 fs/namespace.c:4112 do_mount fs/namespace.c:4476 [inline] __do_sys_mount fs/namespace.c:4689 [inline] __se_sys_mount+0x31d/0x420 fs/namespace.c:4666 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x171/0x540 arch/x86/entry/syscall_64.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff88805cf58000 which belongs to the cache kmalloc-8k of size 8192 The buggy address is located 1008 bytes inside of freed 8192-byte region [ffff88805cf58000, ffff88805cf5a000) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x5cf58 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000040 ffff88801c842280 dead000000000122 0000000000000000 raw: 0000000000000000 0000000000020002 00000000f5000000 0000000000000000 head: 00fff00000000040 ffff88801c842280 dead000000000122 0000000000000000 head: 0000000000000000 0000000000020002 00000000f5000000 0000000000000000 head: 00fff00000000003 fffffffffffffe01 00000000ffffffff 00000000ffffffff head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000008 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0x1d28c0(GFP_NOWAIT|__GFP_IO|__GFP_FS|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 12812, tgid 12811 (syz.8.1795), ts 951767266674 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0x1f9/0x250 mm/page_alloc.c:1873 prep_new_page+0x22/0xb0 mm/page_alloc.c:1881 get_page_from_freelist+0x2487/0x24f0 mm/page_alloc.c:3971 __alloc_frozen_pages_noprof+0x211/0x450 mm/page_alloc.c:5513 alloc_slab_page mm/slub.c:3392 [inline] allocate_slab+0x7d/0x5e0 mm/slub.c:3507 new_slab mm/slub.c:3558 [inline] refill_objects+0x2d5/0x350 mm/slub.c:7533 refill_sheaf mm/slub.c:2925 [inline] __pcs_replace_empty_main+0x2c8/0x6c0 mm/slub.c:4818 alloc_from_pcs mm/slub.c:4894 [inline] slab_alloc_node mm/slub.c:5028 [inline] __do_kmalloc_node mm/slub.c:5537 [inline] __kmalloc_node_track_caller_noprof+0x543/0x720 mm/slub.c:5669 kmalloc_reserve net/core/skbuff.c:640 [inline] __alloc_skb+0x2c1/0x7a0 net/core/skbuff.c:718 alloc_skb include/linux/skbuff.h:1395 [inline] netlink_dump+0x1a2/0xf20 net/netlink/af_netlink.c:2315 netlink_recvmsg+0x692/0xa70 net/netlink/af_netlink.c:2003 sock_recvmsg_nosec+0x130/0x170 net/socket.c:1154 ____sys_recvmsg+0x3f7/0x490 net/socket.c:2931 ___sys_recvmsg+0x25a/0x600 net/socket.c:2978 do_recvmmsg+0x31a/0x800 net/socket.c:3073 __sys_recvmmsg net/socket.c:3149 [inline] __do_sys_recvmmsg net/socket.c:3170 [inline] __se_sys_recvmmsg net/socket.c:3163 [inline] __x64_sys_recvmmsg+0x1b7/0x250 net/socket.c:3163 page last free pid 12813 tgid 12813 ts 951756714418 stack trace: reset_page_owner include/linux/page_owner.h:26 [inline] __free_pages_prepare mm/page_alloc.c:1415 [inline] __free_frozen_pages+0xd1a/0xe10 mm/page_alloc.c:2971 __slab_free+0x269/0x2c0 mm/slub.c:5933 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x99/0x100 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x148/0x160 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x22/0x80 mm/kasan/common.c:364 kasan_slab_alloc include/linux/kasan.h:257 [inline] slab_post_alloc_hook mm/slub.c:4726 [inline] slab_alloc_node mm/slub.c:5040 [inline] __do_kmalloc_node mm/slub.c:5537 [inline] __kmalloc_noprof+0x302/0x710 mm/slub.c:5563 _kmalloc_noprof include/linux/slab.h:995 [inline] _kzalloc_noprof include/linux/slab.h:1312 [inline] tomoyo_encode2 security/tomoyo/realpath.c:45 [inline] tomoyo_encode+0x2ad/0x570 security/tomoyo/realpath.c:80 tomoyo_path_perm+0x318/0x560 security/tomoyo/file.c:836 tomoyo_path_symlink+0xab/0xf0 security/tomoyo/tomoyo.c:212 security_path_symlink+0x16f/0x360 security/security.c:1517 filename_symlinkat+0x119/0x430 fs/namei.c:5918 __do_sys_symlinkat fs/namei.c:5940 [inline] __se_sys_symlinkat+0x4e/0x2b0 fs/namei.c:5935 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x171/0x540 arch/x86/entry/syscall_64.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff88805cf58280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88805cf58300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88805cf58380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88805cf58400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88805cf58480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================