================================================================== BUG: KASAN: use-after-free in hlist_add_head include/linux/list.h:814 [inline] BUG: KASAN: use-after-free in enqueue_timer+0xb7/0x300 kernel/time/timer.c:541 Write of size 8 at addr ffff8881d59871c8 by task ksoftirqd/1/17 CPU: 1 PID: 17 Comm: ksoftirqd/1 Not tainted 5.4.290-syzkaller-00002-g41adfeb3d639 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1d8/0x241 lib/dump_stack.c:118 print_address_description+0x8c/0x600 mm/kasan/report.c:384 __kasan_report+0xf3/0x120 mm/kasan/report.c:516 kasan_report+0x30/0x60 mm/kasan/common.c:653 hlist_add_head include/linux/list.h:814 [inline] enqueue_timer+0xb7/0x300 kernel/time/timer.c:541 __internal_add_timer kernel/time/timer.c:554 [inline] internal_add_timer+0x240/0x430 kernel/time/timer.c:604 __mod_timer+0x6f1/0x13e0 kernel/time/timer.c:1065 call_timer_fn+0x36/0x390 kernel/time/timer.c:1448 expire_timers kernel/time/timer.c:1493 [inline] __run_timers+0x879/0xbe0 kernel/time/timer.c:1817 run_timer_softirq+0x63/0xf0 kernel/time/timer.c:1830 __do_softirq+0x23b/0x6b7 kernel/softirq.c:292 run_ksoftirqd+0x1f/0x30 kernel/softirq.c:603 smpboot_thread_fn+0x545/0x930 kernel/smpboot.c:165 kthread+0x2da/0x360 kernel/kthread.c:288 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:354 Allocated by task 2885: save_stack mm/kasan/common.c:70 [inline] set_track mm/kasan/common.c:78 [inline] __kasan_kmalloc+0x171/0x210 mm/kasan/common.c:529 slab_post_alloc_hook mm/slab.h:584 [inline] slab_alloc_node mm/slub.c:2829 [inline] slab_alloc mm/slub.c:2837 [inline] kmem_cache_alloc+0xd9/0x250 mm/slub.c:2842 mempool_alloc+0x11f/0x530 mm/mempool.c:393 bio_alloc_bioset+0x1e0/0x650 block/bio.c:483 bio_alloc include/linux/bio.h:401 [inline] get_swap_bio+0x8b/0x380 mm/page_io.c:35 __swap_writepage+0x13c/0xd30 mm/page_io.c:283 shmem_writepage+0xbed/0xd10 mm/shmem.c:1388 pageout mm/vmscan.c:887 [inline] shrink_page_list+0x2f96/0x42c0 mm/vmscan.c:1411 shrink_inactive_list+0x533/0xfe0 mm/vmscan.c:2008 shrink_list mm/vmscan.c:2300 [inline] shrink_node_memcg+0xb71/0x2430 mm/vmscan.c:2630 shrink_node+0x389/0x1510 mm/vmscan.c:2843 shrink_zones mm/vmscan.c:3063 [inline] do_try_to_free_pages+0x635/0x1310 mm/vmscan.c:3121 try_to_free_mem_cgroup_pages+0x3f6/0x9b0 mm/vmscan.c:3422 try_charge+0x50e/0x13e0 mm/memcontrol.c:2622 mem_cgroup_try_charge+0x2bd/0x400 mm/memcontrol.c:6595 mem_cgroup_try_charge_delay+0xe/0x50 mm/memcontrol.c:6610 shmem_getpage_gfp+0x1150/0x2440 mm/shmem.c:1886 shmem_getpage mm/shmem.c:154 [inline] shmem_write_begin+0xc9/0x1a0 mm/shmem.c:2447 generic_perform_write+0x2c7/0x560 mm/filemap.c:3450 __generic_file_write_iter+0x224/0x530 mm/filemap.c:3579 generic_file_write_iter+0x455/0x5f0 mm/filemap.c:3611 call_write_iter include/linux/fs.h:1991 [inline] new_sync_write fs/read_write.c:483 [inline] __vfs_write+0x5d3/0x750 fs/read_write.c:496 __kernel_write+0x10f/0x350 fs/read_write.c:515 dump_emit+0x213/0x350 fs/coredump.c:838 elf_core_dump+0x3e1b/0x4740 fs/binfmt_elf.c:2352 do_coredump+0x20fb/0x2f00 fs/coredump.c:801 get_signal+0xd83/0x1440 kernel/signal.c:2732 do_signal+0xb0/0x11f0 arch/x86/kernel/signal.c:809 exit_to_usermode_loop+0xc0/0x1a0 arch/x86/entry/common.c:159 prepare_exit_to_usermode+0x199/0x200 arch/x86/entry/common.c:194 swapgs_restore_regs_and_return_to_usermode+0x0/0x54 Freed by task 2885: save_stack mm/kasan/common.c:70 [inline] set_track mm/kasan/common.c:78 [inline] kasan_set_free_info mm/kasan/common.c:345 [inline] __kasan_slab_free+0x1b5/0x270 mm/kasan/common.c:487 slab_free_hook mm/slub.c:1455 [inline] slab_free_freelist_hook mm/slub.c:1494 [inline] slab_free mm/slub.c:3080 [inline] kmem_cache_free+0x10b/0x2c0 mm/slub.c:3096 req_bio_endio block/blk-core.c:246 [inline] blk_update_request+0x37f/0xe40 block/blk-core.c:1481 scsi_end_request+0x83/0x520 drivers/scsi/scsi_lib.c:588 scsi_io_completion+0x1cb/0x480 drivers/scsi/scsi_lib.c:969 blk_done_softirq+0x2f3/0x390 block/blk-softirq.c:37 __do_softirq+0x23b/0x6b7 kernel/softirq.c:292 The buggy address belongs to the object at ffff8881d5987140 which belongs to the cache bio-0 of size 216 The buggy address is located 136 bytes inside of 216-byte region [ffff8881d5987140, ffff8881d5987218) The buggy address belongs to the page: page:ffffea00075661c0 refcount:1 mapcount:0 mapping:ffff8881f32c3900 index:0x0 flags: 0x8000000000000200(slab) raw: 8000000000000200 dead000000000100 dead000000000122 ffff8881f32c3900 raw: 0000000000000000 00000000000c000c 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 0x192800(GFP_NOWAIT|__GFP_NOWARN|__GFP_NORETRY|__GFP_NOMEMALLOC|__GFP_HARDWALL) set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook mm/page_alloc.c:2165 [inline] prep_new_page+0x18f/0x370 mm/page_alloc.c:2171 get_page_from_freelist+0x2d13/0x2d90 mm/page_alloc.c:3794 __alloc_pages_nodemask+0x393/0x840 mm/page_alloc.c:4893 alloc_slab_page+0x39/0x3c0 mm/slub.c:343 allocate_slab mm/slub.c:1683 [inline] new_slab+0x97/0x440 mm/slub.c:1749 new_slab_objects mm/slub.c:2505 [inline] ___slab_alloc+0x2fe/0x490 mm/slub.c:2667 __slab_alloc+0x62/0xa0 mm/slub.c:2707 slab_alloc_node mm/slub.c:2792 [inline] slab_alloc mm/slub.c:2837 [inline] kmem_cache_alloc+0x109/0x250 mm/slub.c:2842 mempool_alloc+0x11f/0x530 mm/mempool.c:393 bio_alloc_bioset+0x1e0/0x650 block/bio.c:483 bio_alloc include/linux/bio.h:401 [inline] get_swap_bio+0x8b/0x380 mm/page_io.c:35 __swap_writepage+0x13c/0xd30 mm/page_io.c:283 shmem_writepage+0xbed/0xd10 mm/shmem.c:1388 pageout mm/vmscan.c:887 [inline] shrink_page_list+0x2f96/0x42c0 mm/vmscan.c:1411 shrink_inactive_list+0x533/0xfe0 mm/vmscan.c:2008 shrink_list mm/vmscan.c:2300 [inline] shrink_node_memcg+0xb71/0x2430 mm/vmscan.c:2630 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1176 [inline] __free_pages_ok+0x847/0x950 mm/page_alloc.c:1438 free_the_page mm/page_alloc.c:4955 [inline] __free_pages+0x91/0x140 mm/page_alloc.c:4961 device_release+0x6b/0x190 drivers/base/core.c:1776 kobject_cleanup lib/kobject.c:716 [inline] kobject_release lib/kobject.c:747 [inline] kref_put include/linux/kref.h:65 [inline] kobject_put+0x1e6/0x2f0 lib/kobject.c:764 tun_set_iff+0x870/0xdc0 drivers/net/tun.c:2924 __tun_chr_ioctl+0x8a9/0x1d00 drivers/net/tun.c:3187 do_vfs_ioctl+0x742/0x1720 fs/ioctl.c:47 ksys_ioctl fs/ioctl.c:742 [inline] __do_sys_ioctl fs/ioctl.c:749 [inline] __se_sys_ioctl fs/ioctl.c:747 [inline] __x64_sys_ioctl+0xd4/0x110 fs/ioctl.c:747 do_syscall_64+0xca/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 Memory state around the buggy address: ffff8881d5987080: fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc fc ffff8881d5987100: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb >ffff8881d5987180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8881d5987200: fb fb fb fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8881d5987280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== kernel tried to execute NX-protected page - exploit attempt? (uid: 0) BUG: unable to handle page fault for address: ffffea00070b3dc0 #PF: supervisor instruction fetch in kernel mode #PF: error_code(0x0011) - permissions violation PGD 237ff3067 P4D 237ff3067 PUD 237ff2067 PMD 800000023e0001e3 Oops: 0011 [#1] PREEMPT SMP KASAN CPU: 1 PID: 17 Comm: ksoftirqd/1 Tainted: G B 5.4.290-syzkaller-00002-g41adfeb3d639 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025 RIP: 0010:0xffffea00070b3dc0 Code: ad de 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ff ff ff ff 00 00 00 00 00 00 00 00 00 00 00 00 <00> 00 00 00 00 00 00 80 08 3e 0b 07 00 ea ff ff 88 3d 0b 07 00 ea RSP: 0018:ffff8881f5e27b58 EFLAGS: 00010206 RAX: ffffffff8154e8ca RBX: 0000000000000100 RCX: ffff8881f5e15e80 RDX: 0000000000000100 RSI: ffffea00070b3dc0 RDI: ffff8881d59871c0 RBP: ffff8881f5e27d08 R08: ffffffff8154e50e R09: 0000000000000003 R10: ffffffffffffffff R11: dffffc0000000001 R12: 00000000ffffb2b0 R13: dffffc0000000000 R14: ffffea00070b3dc0 R15: ffff8881d59871c0 FS: 0000000000000000(0000) GS:ffff8881f6f00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: ffffea00070b3dc0 CR3: 00000001e40f3000 CR4: 00000000003406a0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000600 Call Trace: run_timer_softirq+0x63/0xf0 kernel/time/timer.c:1830 __do_softirq+0x23b/0x6b7 kernel/softirq.c:292 run_ksoftirqd+0x1f/0x30 kernel/softirq.c:603 smpboot_thread_fn+0x545/0x930 kernel/smpboot.c:165 kthread+0x2da/0x360 kernel/kthread.c:288 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:354 Modules linked in: CR2: ffffea00070b3dc0 ---[ end trace a7da308514840ca7 ]--- RIP: 0010:0xffffea00070b3dc0 Code: ad de 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ff ff ff ff 00 00 00 00 00 00 00 00 00 00 00 00 <00> 00 00 00 00 00 00 80 08 3e 0b 07 00 ea ff ff 88 3d 0b 07 00 ea RSP: 0018:ffff8881f5e27b58 EFLAGS: 00010206 RAX: ffffffff8154e8ca RBX: 0000000000000100 RCX: ffff8881f5e15e80 RDX: 0000000000000100 RSI: ffffea00070b3dc0 RDI: ffff8881d59871c0 RBP: ffff8881f5e27d08 R08: ffffffff8154e50e R09: 0000000000000003 R10: ffffffffffffffff R11: dffffc0000000001 R12: 00000000ffffb2b0 R13: dffffc0000000000 R14: ffffea00070b3dc0 R15: ffff8881d59871c0 FS: 0000000000000000(0000) GS:ffff8881f6f00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: ffffea00070b3dc0 CR3: 00000001e40f3000 CR4: 00000000003406a0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000600