====================================== | [ 13.557325][ T242] ================================================================== | [ 13.557693][ T242] BUG: KASAN: slab-use-after-free in emit_its_trampoline (arch/x86/kernel/alternative.c:129 arch/x86/kernel/alternative.c:236 arch/x86/kernel/alternative.c:264 arch/x86/kernel/alternative.c:808) | [ 13.558010][ T242] Read of size 1 at addr ffff88800192c720 by task modprobe/242 | [ 13.558323][ T242] [ 13.558449][ T242] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011 [ 13.558452][ T242] Call Trace: [ 13.558454][ T242] [ 13.558456][ T242] dump_stack_lvl (lib/dump_stack.c:123) [ 13.558464][ T242] print_address_description.constprop.0 (mm/kasan/report.c:409) [ 13.558471][ T242] ? emit_its_trampoline (arch/x86/kernel/alternative.c:129 arch/x86/kernel/alternative.c:236 arch/x86/kernel/alternative.c:264 arch/x86/kernel/alternative.c:808) [ 13.558474][ T242] print_report (mm/kasan/report.c:522) [ 13.558478][ T242] ? emit_its_trampoline (arch/x86/kernel/alternative.c:129 arch/x86/kernel/alternative.c:236 arch/x86/kernel/alternative.c:264 arch/x86/kernel/alternative.c:808) [ 13.558480][ T242] ? kasan_addr_to_slab (./include/linux/mm.h:1178 mm/kasan/../slab.h:211 mm/kasan/common.c:38) [ 13.558483][ T242] ? emit_its_trampoline (arch/x86/kernel/alternative.c:129 arch/x86/kernel/alternative.c:236 arch/x86/kernel/alternative.c:264 arch/x86/kernel/alternative.c:808) [ 13.558485][ T242] kasan_report (mm/kasan/report.c:636) [ 13.558489][ T242] ? emit_its_trampoline (arch/x86/kernel/alternative.c:129 arch/x86/kernel/alternative.c:236 arch/x86/kernel/alternative.c:264 arch/x86/kernel/alternative.c:808) [ 13.558494][ T242] ? emit_its_trampoline (arch/x86/kernel/alternative.c:129 arch/x86/kernel/alternative.c:236 arch/x86/kernel/alternative.c:264 arch/x86/kernel/alternative.c:808) [ 13.558496][ T242] __kasan_check_byte (mm/kasan/common.c:561) [ 13.558499][ T242] krealloc_noprof (mm/slub.c:4858 mm/slub.c:4958) [ 13.558503][ T242] ? execmem_alloc (mm/execmem.c:299 mm/execmem.c:383) [ 13.558508][ T242] emit_its_trampoline (arch/x86/kernel/alternative.c:129 arch/x86/kernel/alternative.c:236 arch/x86/kernel/alternative.c:264 arch/x86/kernel/alternative.c:808) [ 13.558511][ T242] ? __x86_indirect_paranoid_thunk_rbx (./arch/x86/include/asm/GEN-for-each-reg.h:9) [ 13.558518][ T242] ? __pi___x86_indirect_thunk_rdx (./arch/x86/include/asm/GEN-for-each-reg.h:9) [ 13.558521][ T242] apply_retpolines (arch/x86/kernel/alternative.c:994 (discriminator 3)) [ 13.558525][ T242] ? __pfx_apply_retpolines (arch/x86/kernel/alternative.c:946) [ 13.558528][ T242] ? __pfx___mutex_lock (kernel/locking/mutex.c:746) [ 13.558539][ T242] module_finalize (arch/x86/kernel/module.c:292) [ 13.558546][ T242] ? add_kallsyms (kernel/module/kallsyms.c:212) [ 13.558550][ T242] ? __pfx_module_finalize (arch/x86/kernel/module.c:241) [ 13.558554][ T242] ? __pfx_cmp_ex_sort (lib/extable.c:52) [ 13.558558][ T242] ? __pfx_swap_ex (lib/extable.c:28) [ 13.558562][ T242] load_module (kernel/module/main.c:2927 kernel/module/main.c:3422) [ 13.558570][ T242] ? __pfx_load_module (kernel/module/main.c:3327) [ 13.558574][ T242] ? kernel_read_file (fs/kernel_read_file.c:80 (discriminator 2)) [ 13.558579][ T242] ? kernel_read_file (./arch/x86/include/asm/atomic.h:53 ./include/linux/atomic/atomic-arch-fallback.h:992 ./include/linux/atomic/atomic-instrumented.h:436 ./include/linux/fs.h:3192 fs/kernel_read_file.c:122) [ 13.558583][ T242] ? __pfx_kernel_read_file (fs/kernel_read_file.c:38) [ 13.558586][ T242] ? add_chain_cache (kernel/locking/lockdep.c:3770) [ 13.558592][ T242] ? init_module_from_file (kernel/module/main.c:3673) [ 13.558596][ T242] init_module_from_file (kernel/module/main.c:3673) [ 13.558599][ T242] ? __pfx_init_module_from_file (kernel/module/main.c:3649) [ 13.558608][ T242] ? idempotent_init_module (kernel/module/main.c:3685) [ 13.558612][ T242] ? __lock_release (kernel/locking/lockdep.c:5539) [ 13.558617][ T242] ? do_raw_spin_unlock (./arch/x86/include/asm/atomic.h:23 ./include/linux/atomic/atomic-arch-fallback.h:457 ./include/linux/atomic/atomic-instrumented.h:33 ./include/asm-generic/qspinlock.h:57 kernel/locking/spinlock_debug.c:101 kernel/locking/spinlock_debug.c:141) [ 13.558621][ T242] idempotent_init_module (kernel/module/main.c:3685) [ 13.558625][ T242] ? __pfx_idempotent_init_module (kernel/module/main.c:3677) [ 13.558633][ T242] ? cap_capable (security/commoncap.c:132) [ 13.558640][ T242] __x64_sys_finit_module (./include/linux/file.h:62 ./include/linux/file.h:83 kernel/module/main.c:3708 kernel/module/main.c:3695 kernel/module/main.c:3695) [ 13.558643][ T242] ? do_syscall_64 (./arch/x86/include/asm/irqflags.h:42 ./arch/x86/include/asm/irqflags.h:119 ./include/linux/entry-common.h:199 arch/x86/entry/syscall_64.c:90) [ 13.558647][ T242] do_syscall_64 (arch/x86/entry/syscall_64.c:63 arch/x86/entry/syscall_64.c:94) [ 13.558650][ T242] entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:130) [ 13.558654][ T242] RIP: 0033:0x7f2560189e5d [ 13.558659][ T242] Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa 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 8b 0d 73 9f 1b 00 f7 d8 64 89 01 48 All code ======== 0: ff c3 inc %ebx 2: 66 2e 0f 1f 84 00 00 cs nopw 0x0(%rax,%rax,1) 9: 00 00 00 c: 90 nop d: f3 0f 1e fa endbr64 11: 48 89 f8 mov %rdi,%rax 14: 48 89 f7 mov %rsi,%rdi 17: 48 89 d6 mov %rdx,%rsi 1a: 48 89 ca mov %rcx,%rdx 1d: 4d 89 c2 mov %r8,%r10 20: 4d 89 c8 mov %r9,%r8 23: 4c 8b 4c 24 08 mov 0x8(%rsp),%r9 28: 0f 05 syscall 2a:* 48 3d 01 f0 ff ff cmp $0xfffffffffffff001,%rax <-- trapping instruction 30: 73 01 jae 0x33 32: c3 ret 33: 48 8b 0d 73 9f 1b 00 mov 0x1b9f73(%rip),%rcx # 0x1b9fad 3a: f7 d8 neg %eax 3c: 64 89 01 mov %eax,%fs:(%rcx) 3f: 48 rex.W Code starting with the faulting instruction =========================================== 0: 48 3d 01 f0 ff ff cmp $0xfffffffffffff001,%rax 6: 73 01 jae 0x9 8: c3 ret 9: 48 8b 0d 73 9f 1b 00 mov 0x1b9f73(%rip),%rcx # 0x1b9f83 10: f7 d8 neg %eax 12: 64 89 01 mov %eax,%fs:(%rcx) 15: 48 rex.W [ 13.558662][ T242] RSP: 002b:00007ffecbc30c18 EFLAGS: 00000246 ORIG_RAX: 0000000000000139 [ 13.558666][ T242] RAX: ffffffffffffffda RBX: 000055f83f585960 RCX: 00007f2560189e5d [ 13.558668][ T242] RDX: 0000000000000000 RSI: 000055f80b577a2a RDI: 0000000000000005 [ 13.558670][ T242] RBP: 0000000000040000 R08: 0000000000000000 R09: 00007ffecbc30d50 [ 13.558671][ T242] R10: 0000000000000005 R11: 0000000000000246 R12: 000055f80b577a2a Finger prints: print_report:kasan_report:__kasan_check_byte:krealloc_noprof:emit_its_trampoline