Module has invalid ELF structures ================================================================== BUG: KASAN: vmalloc-out-of-bounds in elf_validity_check kernel/module.c:3073 [inline] BUG: KASAN: vmalloc-out-of-bounds in load_module+0x2a80/0x5aa0 kernel/module.c:4008 Read of size 1 at addr ffffc90000118fff by task syz.0.1069/5353 CPU: 0 PID: 5353 Comm: syz.0.1069 Tainted: G W 5.10.225-syzkaller-00513-g8d23314f588a #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024 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_load1_noabort+0x14/0x20 mm/kasan/report_generic.c:306 elf_validity_check kernel/module.c:3073 [inline] load_module+0x2a80/0x5aa0 kernel/module.c:4008 __do_sys_init_module kernel/module.c:4226 [inline] __se_sys_init_module+0x238/0x2d0 kernel/module.c:4209 __x64_sys_init_module+0x76/0x80 kernel/module.c:4209 do_syscall_64+0x34/0x70 entry_SYSCALL_64_after_hwframe+0x61/0xcb RIP: 0033:0x7f04d2a06f39 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 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f04d1680038 EFLAGS: 00000246 ORIG_RAX: 00000000000000af RAX: ffffffffffffffda RBX: 00007f04d2bbef80 RCX: 00007f04d2a06f39 RDX: 0000000000000000 RSI: 0000000000000578 RDI: 0000000020000040 RBP: 00007f04d2a79216 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f04d2bbef80 R15: 00007ffde5f63468 Memory state around the buggy address: ffffc90000118e80: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 ffffc90000118f00: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 >ffffc90000118f80: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 ^ ffffc90000119000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffffc90000119080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ================================================================== BUG: unable to handle page fault for address: ffffc90000118fff #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 100000067 P4D 100000067 PUD 10013a067 PMD 10013b067 PTE 0 Oops: 0000 [#1] PREEMPT SMP KASAN CPU: 1 PID: 5353 Comm: syz.0.1069 Tainted: G B W 5.10.225-syzkaller-00513-g8d23314f588a #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024 RIP: 0010:elf_validity_check kernel/module.c:3073 [inline] RIP: 0010:load_module+0x3f4/0x5aa0 kernel/module.c:4008 Code: 48 ba 00 00 00 00 00 fc ff df 49 8b 06 48 89 44 24 48 4a 8d 5c 38 ff 48 89 d8 48 c1 e8 03 0f b6 04 10 84 c0 0f 85 77 26 00 00 <80> 3b 00 4c 8b 7c 24 70 0f 85 84 14 00 00 48 8d 5e 04 48 89 d8 48 RSP: 0018:ffffc90000ecfb60 EFLAGS: 00010286 RAX: ffff888110351301 RBX: ffffc90000118fff RCX: 0000000000040000 RDX: dffffc0000000000 RSI: ffffc900001193c2 RDI: 0000000000007d65 RBP: ffffc90000ecfd50 R08: ffffffff813e2a7b R09: 0000000000000003 R10: fffffbfff0e10c48 R11: dffffc0000000001 R12: ffffc90000ecfdc0 R13: ffffc90000ecfde8 R14: ffffc90000119462 R15: ffffc90000119000 FS: 00007f04d16806c0(0000) GS:ffff8881f7100000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: ffffc90000118fff CR3: 000000011a442000 CR4: 00000000003506a0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: __do_sys_init_module kernel/module.c:4226 [inline] __se_sys_init_module+0x238/0x2d0 kernel/module.c:4209 __x64_sys_init_module+0x76/0x80 kernel/module.c:4209 do_syscall_64+0x34/0x70 entry_SYSCALL_64_after_hwframe+0x61/0xcb RIP: 0033:0x7f04d2a06f39 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 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f04d1680038 EFLAGS: 00000246 ORIG_RAX: 00000000000000af RAX: ffffffffffffffda RBX: 00007f04d2bbef80 RCX: 00007f04d2a06f39 RDX: 0000000000000000 RSI: 0000000000000578 RDI: 0000000020000040 RBP: 00007f04d2a79216 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f04d2bbef80 R15: 00007ffde5f63468 Modules linked in: CR2: ffffc90000118fff ---[ end trace 2f8e919fff7dc168 ]--- RIP: 0010:elf_validity_check kernel/module.c:3073 [inline] RIP: 0010:load_module+0x3f4/0x5aa0 kernel/module.c:4008 Code: 48 ba 00 00 00 00 00 fc ff df 49 8b 06 48 89 44 24 48 4a 8d 5c 38 ff 48 89 d8 48 c1 e8 03 0f b6 04 10 84 c0 0f 85 77 26 00 00 <80> 3b 00 4c 8b 7c 24 70 0f 85 84 14 00 00 48 8d 5e 04 48 89 d8 48 RSP: 0018:ffffc90000ecfb60 EFLAGS: 00010286 RAX: ffff888110351301 RBX: ffffc90000118fff RCX: 0000000000040000 RDX: dffffc0000000000 RSI: ffffc900001193c2 RDI: 0000000000007d65 RBP: ffffc90000ecfd50 R08: ffffffff813e2a7b R09: 0000000000000003 R10: fffffbfff0e10c48 R11: dffffc0000000001 R12: ffffc90000ecfdc0 R13: ffffc90000ecfde8 R14: ffffc90000119462 R15: ffffc90000119000 FS: 00007f04d16806c0(0000) GS:ffff8881f7100000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: ffffc90000118fff CR3: 000000011a442000 CR4: 00000000003506a0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 ---------------- Code disassembly (best guess): 0: 48 ba 00 00 00 00 00 movabs $0xdffffc0000000000,%rdx 7: fc ff df a: 49 8b 06 mov (%r14),%rax d: 48 89 44 24 48 mov %rax,0x48(%rsp) 12: 4a 8d 5c 38 ff lea -0x1(%rax,%r15,1),%rbx 17: 48 89 d8 mov %rbx,%rax 1a: 48 c1 e8 03 shr $0x3,%rax 1e: 0f b6 04 10 movzbl (%rax,%rdx,1),%eax 22: 84 c0 test %al,%al 24: 0f 85 77 26 00 00 jne 0x26a1 * 2a: 80 3b 00 cmpb $0x0,(%rbx) <-- trapping instruction 2d: 4c 8b 7c 24 70 mov 0x70(%rsp),%r15 32: 0f 85 84 14 00 00 jne 0x14bc 38: 48 8d 5e 04 lea 0x4(%rsi),%rbx 3c: 48 89 d8 mov %rbx,%rax 3f: 48 rex.W