================================================================== BUG: KASAN: stack-out-of-bounds in idempotent kernel/module/main.c:3078 [inline] BUG: KASAN: stack-out-of-bounds in init_module_from_file+0x62c/0x6a0 kernel/module/main.c:3124 Read of size 8 at addr ffffc900053efe20 by task syz-executor.4/6690 CPU: 1 PID: 6690 Comm: syz-executor.4 Not tainted 6.4.0-syzkaller-11311-g24be4d0b46bb #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/27/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x150 lib/dump_stack.c:106 print_address_description.constprop.0+0x2c/0x3c0 mm/kasan/report.c:364 print_report mm/kasan/report.c:475 [inline] kasan_report+0x11d/0x130 mm/kasan/report.c:588 idempotent kernel/module/main.c:3078 [inline] init_module_from_file+0x62c/0x6a0 kernel/module/main.c:3124 __do_sys_finit_module kernel/module/main.c:3171 [inline] __se_sys_finit_module kernel/module/main.c:3154 [inline] __x64_sys_finit_module+0xfd/0x190 kernel/module/main.c:3154 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f1b7d28c389 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 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 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f1b7e042168 EFLAGS: 00000246 ORIG_RAX: 0000000000000139 RAX: ffffffffffffffda RBX: 00007f1b7d3abf80 RCX: 00007f1b7d28c389 RDX: 0000000000000000 RSI: 0000000020000240 RDI: 0000000000000004 RBP: 00007f1b7d2d7493 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffd38fb8fdf R14: 00007f1b7e042300 R15: 0000000000022000 The buggy address belongs to the virtual mapping at [ffffc900053e8000, ffffc900053f1000) created by: kernel_clone+0xeb/0x890 kernel/fork.c:2911 The buggy address belongs to the physical page: page:ffffea0001e74000 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x79d00 memcg:ffff8880787b9f02 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000000000 0000000000000000 dead000000000122 0000000000000000 raw: 0000000000000000 0000000000000000 00000001ffffffff ffff8880787b9f02 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x102dc2(GFP_HIGHUSER|__GFP_NOWARN|__GFP_ZERO), pid 10, tgid 10 (kworker/u4:0), ts 941771058628, free_ts 941719156324 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x2db/0x350 mm/page_alloc.c:1570 prep_new_page mm/page_alloc.c:1577 [inline] get_page_from_freelist+0xfed/0x2d30 mm/page_alloc.c:3221 __alloc_pages+0x1cb/0x4a0 mm/page_alloc.c:4477 alloc_pages+0x1aa/0x270 mm/mempolicy.c:2279 vm_area_alloc_pages mm/vmalloc.c:3059 [inline] __vmalloc_area_node mm/vmalloc.c:3135 [inline] __vmalloc_node_range+0xb1c/0x14c0 mm/vmalloc.c:3316 alloc_thread_stack_node kernel/fork.c:309 [inline] dup_task_struct kernel/fork.c:1112 [inline] copy_process+0x13bb/0x75c0 kernel/fork.c:2329 kernel_clone+0xeb/0x890 kernel/fork.c:2911 user_mode_thread+0xb1/0xf0 kernel/fork.c:2989 call_usermodehelper_exec_sync kernel/umh.c:133 [inline] call_usermodehelper_exec_work+0x6d/0x180 kernel/umh.c:164 process_one_work+0xa34/0x16f0 kernel/workqueue.c:2597 worker_thread+0x67d/0x10c0 kernel/workqueue.c:2748 kthread+0x344/0x440 kernel/kthread.c:389 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1161 [inline] free_unref_page_prepare+0x62e/0xcb0 mm/page_alloc.c:2348 free_unref_page_list+0xe3/0xa70 mm/page_alloc.c:2489 release_pages+0xcd8/0x1380 mm/swap.c:1042 tlb_batch_pages_flush+0xa8/0x1a0 mm/mmu_gather.c:97 tlb_flush_mmu_free mm/mmu_gather.c:292 [inline] tlb_flush_mmu mm/mmu_gather.c:299 [inline] tlb_finish_mmu+0x14b/0x7e0 mm/mmu_gather.c:391 exit_mmap+0x2cd/0x960 mm/mmap.c:3210 __mmput+0x128/0x4c0 kernel/fork.c:1347 mmput+0x60/0x70 kernel/fork.c:1369 exit_mm kernel/exit.c:567 [inline] do_exit+0x9a7/0x29a0 kernel/exit.c:861 do_group_exit+0xd4/0x2a0 kernel/exit.c:1024 get_signal+0x249b/0x25f0 kernel/signal.c:2877 arch_do_signal_or_restart+0x79/0x5c0 arch/x86/kernel/signal.c:308 exit_to_user_mode_loop kernel/entry/common.c:168 [inline] exit_to_user_mode_prepare+0x11f/0x240 kernel/entry/common.c:204 __syscall_exit_to_user_mode_work kernel/entry/common.c:286 [inline] syscall_exit_to_user_mode+0x1d/0x50 kernel/entry/common.c:297 do_syscall_64+0x46/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x63/0xcd Memory state around the buggy address: ffffc900053efd00: f2 f2 f2 00 00 00 00 00 00 00 00 00 00 00 00 00 ffffc900053efd80: 00 00 00 f3 f3 f3 f3 00 00 00 00 00 00 00 00 00 >ffffc900053efe00: 00 00 f1 f1 f1 f1 f1 f1 04 f2 04 f2 00 00 00 00 ^ ffffc900053efe80: 00 00 00 00 00 00 00 00 00 f3 f3 f3 f3 f3 00 00 ffffc900053eff00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ================================================================== ================================================================== BUG: KASAN: stack-out-of-bounds in idempotent kernel/module/main.c:3077 [inline] BUG: KASAN: stack-out-of-bounds in init_module_from_file+0x669/0x6a0 kernel/module/main.c:3124 Read of size 8 at addr ffffc900053efe28 by task syz-executor.4/6690 CPU: 1 PID: 6690 Comm: syz-executor.4 Tainted: G B 6.4.0-syzkaller-11311-g24be4d0b46bb #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/27/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x150 lib/dump_stack.c:106 print_address_description.constprop.0+0x2c/0x3c0 mm/kasan/report.c:364 print_report mm/kasan/report.c:475 [inline] kasan_report+0x11d/0x130 mm/kasan/report.c:588 idempotent kernel/module/main.c:3077 [inline] init_module_from_file+0x669/0x6a0 kernel/module/main.c:3124 __do_sys_finit_module kernel/module/main.c:3171 [inline] __se_sys_finit_module kernel/module/main.c:3154 [inline] __x64_sys_finit_module+0xfd/0x190 kernel/module/main.c:3154 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f1b7d28c389 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 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 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f1b7e042168 EFLAGS: 00000246 ORIG_RAX: 0000000000000139 RAX: ffffffffffffffda RBX: 00007f1b7d3abf80 RCX: 00007f1b7d28c389 RDX: 0000000000000000 RSI: 0000000020000240 RDI: 0000000000000004 RBP: 00007f1b7d2d7493 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffd38fb8fdf R14: 00007f1b7e042300 R15: 0000000000022000 The buggy address belongs to the virtual mapping at [ffffc900053e8000, ffffc900053f1000) created by: kernel_clone+0xeb/0x890 kernel/fork.c:2911 The buggy address belongs to the physical page: page:ffffea0001e74000 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x79d00 memcg:ffff8880787b9f02 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000000000 0000000000000000 dead000000000122 0000000000000000 raw: 0000000000000000 0000000000000000 00000001ffffffff ffff8880787b9f02 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x102dc2(GFP_HIGHUSER|__GFP_NOWARN|__GFP_ZERO), pid 10, tgid 10 (kworker/u4:0), ts 941771058628, free_ts 941719156324 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x2db/0x350 mm/page_alloc.c:1570 prep_new_page mm/page_alloc.c:1577 [inline] get_page_from_freelist+0xfed/0x2d30 mm/page_alloc.c:3221 __alloc_pages+0x1cb/0x4a0 mm/page_alloc.c:4477 alloc_pages+0x1aa/0x270 mm/mempolicy.c:2279 vm_area_alloc_pages mm/vmalloc.c:3059 [inline] __vmalloc_area_node mm/vmalloc.c:3135 [inline] __vmalloc_node_range+0xb1c/0x14c0 mm/vmalloc.c:3316 alloc_thread_stack_node kernel/fork.c:309 [inline] dup_task_struct kernel/fork.c:1112 [inline] copy_process+0x13bb/0x75c0 kernel/fork.c:2329 kernel_clone+0xeb/0x890 kernel/fork.c:2911 user_mode_thread+0xb1/0xf0 kernel/fork.c:2989 call_usermodehelper_exec_sync kernel/umh.c:133 [inline] call_usermodehelper_exec_work+0x6d/0x180 kernel/umh.c:164 process_one_work+0xa34/0x16f0 kernel/workqueue.c:2597 worker_thread+0x67d/0x10c0 kernel/workqueue.c:2748 kthread+0x344/0x440 kernel/kthread.c:389 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1161 [inline] free_unref_page_prepare+0x62e/0xcb0 mm/page_alloc.c:2348 free_unref_page_list+0xe3/0xa70 mm/page_alloc.c:2489 release_pages+0xcd8/0x1380 mm/swap.c:1042 tlb_batch_pages_flush+0xa8/0x1a0 mm/mmu_gather.c:97 tlb_flush_mmu_free mm/mmu_gather.c:292 [inline] tlb_flush_mmu mm/mmu_gather.c:299 [inline] tlb_finish_mmu+0x14b/0x7e0 mm/mmu_gather.c:391 exit_mmap+0x2cd/0x960 mm/mmap.c:3210 __mmput+0x128/0x4c0 kernel/fork.c:1347 mmput+0x60/0x70 kernel/fork.c:1369 exit_mm kernel/exit.c:567 [inline] do_exit+0x9a7/0x29a0 kernel/exit.c:861 do_group_exit+0xd4/0x2a0 kernel/exit.c:1024 get_signal+0x249b/0x25f0 kernel/signal.c:2877 arch_do_signal_or_restart+0x79/0x5c0 arch/x86/kernel/signal.c:308 exit_to_user_mode_loop kernel/entry/common.c:168 [inline] exit_to_user_mode_prepare+0x11f/0x240 kernel/entry/common.c:204 __syscall_exit_to_user_mode_work kernel/entry/common.c:286 [inline] syscall_exit_to_user_mode+0x1d/0x50 kernel/entry/common.c:297 do_syscall_64+0x46/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x63/0xcd Memory state around the buggy address: ffffc900053efd00: f2 f2 f2 00 00 00 00 00 00 00 00 00 00 00 00 00 ffffc900053efd80: 00 00 00 f3 f3 f3 f3 00 00 00 00 00 00 00 00 00 >ffffc900053efe00: 00 00 f1 f1 f1 f1 f1 f1 04 f2 04 f2 00 00 00 00 ^ ffffc900053efe80: 00 00 00 00 00 00 00 00 00 f3 f3 f3 f3 f3 00 00 ffffc900053eff00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ================================================================== general protection fault, probably for non-canonical address 0xe3fffb240014fbf8: 0000 [#1] PREEMPT SMP KASAN KASAN: maybe wild-memory-access in range [0x1ffff92000a7dfc0-0x1ffff92000a7dfc7] CPU: 1 PID: 6690 Comm: syz-executor.4 Tainted: G B 6.4.0-syzkaller-11311-g24be4d0b46bb #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/27/2023 RIP: 0010:idempotent kernel/module/main.c:3078 [inline] RIP: 0010:init_module_from_file+0x1c1/0x6a0 kernel/module/main.c:3124 Code: 0f 84 c0 01 00 00 e8 ae f1 12 00 4d 89 e7 49 83 ef 08 74 61 e8 a0 f1 12 00 4c 89 fa 48 b8 00 00 00 00 00 fc ff df 48 c1 ea 03 <80> 3c 02 00 0f 85 59 04 00 00 4d 3b 2f 0f 84 ae 00 00 00 e8 77 f1 RSP: 0018:ffffc9000577fd28 EFLAGS: 00010213 RAX: dffffc0000000000 RBX: 00000000000000b4 RCX: ffffc9000d8f1000 RDX: 03ffff240014fbf8 RSI: ffffffff8171ed30 RDI: 0000000000000007 RBP: ffff888047720280 R08: 0000000000000007 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000001 R12: ffffc900053efe28 R13: ffff888047b7b6c0 R14: ffffffff921496c0 R15: 1ffff92000a7dfc4 FS: 00007f1b7e042700(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00000000200035c0 CR3: 000000002c718000 CR4: 0000000000350ee0 Call Trace: __do_sys_finit_module kernel/module/main.c:3171 [inline] __se_sys_finit_module kernel/module/main.c:3154 [inline] __x64_sys_finit_module+0xfd/0x190 kernel/module/main.c:3154 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f1b7d28c389 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 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 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f1b7e042168 EFLAGS: 00000246 ORIG_RAX: 0000000000000139 RAX: ffffffffffffffda RBX: 00007f1b7d3abf80 RCX: 00007f1b7d28c389 RDX: 0000000000000000 RSI: 0000000020000240 RDI: 0000000000000004 RBP: 00007f1b7d2d7493 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffd38fb8fdf R14: 00007f1b7e042300 R15: 0000000000022000 Modules linked in: ---[ end trace 0000000000000000 ]--- RIP: 0010:idempotent kernel/module/main.c:3078 [inline] RIP: 0010:init_module_from_file+0x1c1/0x6a0 kernel/module/main.c:3124 Code: 0f 84 c0 01 00 00 e8 ae f1 12 00 4d 89 e7 49 83 ef 08 74 61 e8 a0 f1 12 00 4c 89 fa 48 b8 00 00 00 00 00 fc ff df 48 c1 ea 03 <80> 3c 02 00 0f 85 59 04 00 00 4d 3b 2f 0f 84 ae 00 00 00 e8 77 f1 RSP: 0018:ffffc9000577fd28 EFLAGS: 00010213 RAX: dffffc0000000000 RBX: 00000000000000b4 RCX: ffffc9000d8f1000 RDX: 03ffff240014fbf8 RSI: ffffffff8171ed30 RDI: 0000000000000007 RBP: ffff888047720280 R08: 0000000000000007 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000001 R12: ffffc900053efe28 R13: ffff888047b7b6c0 R14: ffffffff921496c0 R15: 1ffff92000a7dfc4 FS: 00007f1b7e042700(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00000000200035c0 CR3: 000000002c718000 CR4: 0000000000350ee0 ---------------- Code disassembly (best guess): 0: 0f 84 c0 01 00 00 je 0x1c6 6: e8 ae f1 12 00 callq 0x12f1b9 b: 4d 89 e7 mov %r12,%r15 e: 49 83 ef 08 sub $0x8,%r15 12: 74 61 je 0x75 14: e8 a0 f1 12 00 callq 0x12f1b9 19: 4c 89 fa mov %r15,%rdx 1c: 48 b8 00 00 00 00 00 movabs $0xdffffc0000000000,%rax 23: fc ff df 26: 48 c1 ea 03 shr $0x3,%rdx * 2a: 80 3c 02 00 cmpb $0x0,(%rdx,%rax,1) <-- trapping instruction 2e: 0f 85 59 04 00 00 jne 0x48d 34: 4d 3b 2f cmp (%r15),%r13 37: 0f 84 ae 00 00 00 je 0xeb 3d: e8 .byte 0xe8 3e: 77 f1 ja 0x31