====================================== | [ 21.728384][ T340] ================================================================== | [ 21.728748][ T340] 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) | [ 21.729026][ T340] Read of size 1 at addr ffff888001926720 by task modprobe/340 | [ 21.729285][ T340] [ 21.729383][ T340] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011 [ 21.729385][ T340] Call Trace: [ 21.729387][ T340] [ 21.729389][ T340] dump_stack_lvl (lib/dump_stack.c:123) [ 21.729397][ T340] print_address_description.constprop.0 (mm/kasan/report.c:409) [ 21.729402][ T340] ? 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) [ 21.729406][ T340] print_report (mm/kasan/report.c:522) [ 21.729409][ T340] ? 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) [ 21.729412][ T340] ? kasan_addr_to_slab (./include/linux/mm.h:1178 mm/kasan/../slab.h:211 mm/kasan/common.c:38) [ 21.729416][ T340] ? 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) [ 21.729419][ T340] kasan_report (mm/kasan/report.c:636) [ 21.729423][ T340] ? 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) [ 21.729428][ T340] ? 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) [ 21.729431][ T340] __kasan_check_byte (mm/kasan/common.c:561) [ 21.729434][ T340] krealloc_noprof (mm/slub.c:4858 mm/slub.c:4958) [ 21.729439][ T340] ? execmem_alloc (mm/execmem.c:299 mm/execmem.c:383) [ 21.729444][ T340] 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) [ 21.729447][ T340] ? __x86_indirect_paranoid_thunk_rcx (./arch/x86/include/asm/GEN-for-each-reg.h:7) [ 21.729454][ T340] ? __pi___x86_indirect_thunk_rax (./arch/x86/include/asm/GEN-for-each-reg.h:7) [ 21.729457][ T340] apply_retpolines (arch/x86/kernel/alternative.c:994 (discriminator 3)) [ 21.729462][ T340] ? __pfx_apply_retpolines (arch/x86/kernel/alternative.c:946) [ 21.729466][ T340] ? __pfx___mutex_lock (kernel/locking/mutex.c:746) [ 21.729476][ T340] module_finalize (arch/x86/kernel/module.c:292) [ 21.729483][ T340] ? add_kallsyms (kernel/module/kallsyms.c:212) [ 21.729489][ T340] ? __pfx_module_finalize (arch/x86/kernel/module.c:241) [ 21.729493][ T340] ? __pfx_cmp_ex_sort (lib/extable.c:52) [ 21.729496][ T340] ? __pfx_swap_ex (lib/extable.c:28) [ 21.729501][ T340] load_module (kernel/module/main.c:2927 kernel/module/main.c:3422) [ 21.729508][ T340] ? __pfx_load_module (kernel/module/main.c:3327) [ 21.729511][ T340] ? kernel_read_file (fs/kernel_read_file.c:80 (discriminator 2)) [ 21.729518][ T340] ? 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) [ 21.729523][ T340] ? __pfx_kernel_read_file (fs/kernel_read_file.c:38) [ 21.729527][ T340] ? add_chain_cache (kernel/locking/lockdep.c:3770) [ 21.729532][ T340] ? init_module_from_file (kernel/module/main.c:3673) [ 21.729535][ T340] init_module_from_file (kernel/module/main.c:3673) [ 21.729538][ T340] ? __pfx_init_module_from_file (kernel/module/main.c:3649) [ 21.729547][ T340] ? idempotent_init_module (kernel/module/main.c:3685) [ 21.729550][ T340] ? __lock_release (kernel/locking/lockdep.c:5539) [ 21.729554][ T340] ? 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) [ 21.729559][ T340] idempotent_init_module (kernel/module/main.c:3685) [ 21.729563][ T340] ? __pfx_idempotent_init_module (kernel/module/main.c:3677) [ 21.729570][ T340] ? cap_capable (security/commoncap.c:132) [ 21.729577][ T340] __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) [ 21.729581][ T340] ? 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) [ 21.729585][ T340] do_syscall_64 (arch/x86/entry/syscall_64.c:63 arch/x86/entry/syscall_64.c:94) [ 21.729588][ T340] entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:130) [ 21.729592][ T340] RIP: 0033:0x7f11066d2e5d [ 21.729596][ T340] 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 [ 21.729598][ T340] RSP: 002b:00007ffcbe41bcf8 EFLAGS: 00000246 ORIG_RAX: 0000000000000139 [ 21.729602][ T340] RAX: ffffffffffffffda RBX: 0000560b00b91960 RCX: 00007f11066d2e5d [ 21.729605][ T340] RDX: 0000000000000000 RSI: 0000560ae99b1a2a RDI: 0000000000000005 [ 21.729606][ T340] RBP: 0000000000040000 R08: 0000000000000000 R09: 00007ffcbe41be30 [ 21.729608][ T340] R10: 0000000000000005 R11: 0000000000000246 R12: 0000560ae99b1a2a Finger prints: print_report:kasan_report:__kasan_check_byte:krealloc_noprof:emit_its_trampoline