================================================================== BUG: KASAN: slab-out-of-bounds in init_module_from_file+0x630/0x6b0 Read of size 8 at addr ffff888041407e20 by task syz-executor.6/11173 CPU: 1 PID: 11173 Comm: syz-executor.6 Not tainted 6.4.0-next-20230630 #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.12.0-1 04/01/2014 Call Trace: dump_stack_lvl+0x91/0xf0 print_report+0xcc/0x620 kasan_report+0xbe/0xf0 init_module_from_file+0x630/0x6b0 __x64_sys_finit_module+0xee/0x160 do_syscall_64+0x3f/0x90 entry_SYSCALL_64_after_hwframe+0x6e/0xd8 RIP: 0033:0x7fd28dc38b19 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fd28b1ae188 EFLAGS: 00000246 ORIG_RAX: 0000000000000139 RAX: ffffffffffffffda RBX: 00007fd28dd4bf60 RCX: 00007fd28dc38b19 RDX: 0000000000000002 RSI: 0000000020000040 RDI: 0000000000000003 RBP: 00007fd28dc92f6d R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffe332b31bf R14: 00007fd28b1ae300 R15: 0000000000022000 Allocated by task 11154: kasan_save_stack+0x22/0x50 kasan_set_track+0x25/0x30 __kasan_slab_alloc+0x59/0x70 kmem_cache_alloc_node+0x198/0x3b0 copy_process+0x3c2/0x7320 kernel_clone+0xeb/0x7d0 __do_sys_clone+0xba/0x100 do_syscall_64+0x3f/0x90 entry_SYSCALL_64_after_hwframe+0x6e/0xd8 Freed by task 272: kasan_save_stack+0x22/0x50 kasan_set_track+0x25/0x30 kasan_save_free_info+0x2b/0x50 __kasan_slab_free+0x10a/0x190 kmem_cache_free+0x10d/0x4d0 delayed_put_task_struct+0x1c9/0x240 rcu_core+0x8c8/0x28b0 __do_softirq+0x1b7/0x7d4 Last potentially related work creation: kasan_save_stack+0x22/0x50 __kasan_record_aux_stack+0x8e/0xa0 __call_rcu_common.constprop.0+0x6a/0xbd0 put_task_struct_rcu_user+0x87/0xd0 __schedule+0x9b1/0x2b00 schedule+0xdb/0x1a0 exit_to_user_mode_prepare+0x95/0x180 syscall_exit_to_user_mode+0x1d/0x50 do_syscall_64+0x4c/0x90 entry_SYSCALL_64_after_hwframe+0x6e/0xd8 The buggy address belongs to the object at ffff8880414051c0 which belongs to the cache task_struct of size 6720 The buggy address is located 4640 bytes to the right of allocated 6720-byte region [ffff8880414051c0, ffff888041406c00) The buggy address belongs to the physical page: page:00000000f088d64c refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x41400 head:00000000f088d64c order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0 memcg:ffff888015ba05c1 flags: 0x100000000010200(slab|head|node=0|zone=1) page_type: 0xffffffff() raw: 0100000000010200 ffff8880087a2640 dead000000000122 0000000000000000 raw: 0000000000000000 0000000000040004 00000001ffffffff ffff888015ba05c1 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888041407d00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888041407d80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888041407e00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff888041407e80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888041407f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ================================================================== general protection fault, probably for non-canonical address 0xeac826e83f43c1fd: 0000 [#1] PREEMPT SMP KASAN NOPTI KASAN: maybe wild-memory-access in range [0x56415741fa1e0fe8-0x56415741fa1e0fef] CPU: 1 PID: 11173 Comm: syz-executor.6 Tainted: G B 6.4.0-next-20230630 #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.12.0-1 04/01/2014 RIP: 0010:init_module_from_file+0x1c1/0x6b0 Code: 0f 84 c4 01 00 00 e8 5e 36 12 00 4d 89 e7 49 83 ef 08 74 61 e8 50 36 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 5d 04 00 00 4d 3b 2f 0f 84 ae 00 00 00 e8 27 36 RSP: 0018:ffff88804493fd28 EFLAGS: 00010212 RAX: dffffc0000000000 RBX: 000000000000003b RCX: ffffc900017d7000 RDX: 0ac82ae83f43c1fd RSI: ffffffff813a30f0 RDI: ffffffff810811d0 RBP: ffff88800f228f00 R08: 0000000000000007 R09: 0000000000000000 R10: 0000000000000000 R11: 000000000001b510 R12: ffff888041407e28 R13: ffff888008937740 R14: ffffffff87b7be78 R15: 56415741fa1e0feb FS: 00007fd28b1ae700(0000) GS:ffff88806cf00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000001b2c228000 CR3: 000000004316e000 CR4: 0000000000350ee0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000600 Call Trace: __x64_sys_finit_module+0xee/0x160 do_syscall_64+0x3f/0x90 entry_SYSCALL_64_after_hwframe+0x6e/0xd8 RIP: 0033:0x7fd28dc38b19 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fd28b1ae188 EFLAGS: 00000246 ORIG_RAX: 0000000000000139 RAX: ffffffffffffffda RBX: 00007fd28dd4bf60 RCX: 00007fd28dc38b19 RDX: 0000000000000002 RSI: 0000000020000040 RDI: 0000000000000003 RBP: 00007fd28dc92f6d R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffe332b31bf R14: 00007fd28b1ae300 R15: 0000000000022000 Modules linked in: ---[ end trace 0000000000000000 ]--- RIP: 0010:init_module_from_file+0x1c1/0x6b0 Code: 0f 84 c4 01 00 00 e8 5e 36 12 00 4d 89 e7 49 83 ef 08 74 61 e8 50 36 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 5d 04 00 00 4d 3b 2f 0f 84 ae 00 00 00 e8 27 36 RSP: 0018:ffff88804493fd28 EFLAGS: 00010212 RAX: dffffc0000000000 RBX: 000000000000003b RCX: ffffc900017d7000 RDX: 0ac82ae83f43c1fd RSI: ffffffff813a30f0 RDI: ffffffff810811d0 RBP: ffff88800f228f00 R08: 0000000000000007 R09: 0000000000000000 R10: 0000000000000000 R11: 000000000001b510 R12: ffff888041407e28 R13: ffff888008937740 R14: ffffffff87b7be78 R15: 56415741fa1e0feb FS: 00007fd28b1ae700(0000) GS:ffff88806cf00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000001b2c228000 CR3: 000000004316e000 CR4: 0000000000350ee0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000600 note: syz-executor.6[11173] exited with preempt_count 1 ---------------- Code disassembly (best guess): 0: 0f 84 c4 01 00 00 je 0x1ca 6: e8 5e 36 12 00 callq 0x123669 b: 4d 89 e7 mov %r12,%r15 e: 49 83 ef 08 sub $0x8,%r15 12: 74 61 je 0x75 14: e8 50 36 12 00 callq 0x123669 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 5d 04 00 00 jne 0x491 34: 4d 3b 2f cmp (%r15),%r13 37: 0f 84 ae 00 00 00 je 0xeb 3d: e8 .byte 0xe8 3e: 27 (bad) 3f: 36 ss