====================================== | [ 225.274862][ T561] ================================================================== | [ 225.275998][ T561] 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) | [ 225.276973][ T561] Read of size 1 at addr ffff888001936720 by task modprobe/561 | [ 225.277892][ T561] [ 225.278198][ T561] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011 [ 225.278206][ T561] Call Trace: [ 225.278215][ T561] [ 225.278218][ T561] dump_stack_lvl (lib/dump_stack.c:123) [ 225.278251][ T561] print_address_description.constprop.0 (mm/kasan/report.c:409) [ 225.278274][ T561] ? 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) [ 225.278284][ T561] print_report (mm/kasan/report.c:522) [ 225.278290][ T561] ? 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) [ 225.278295][ T561] ? kasan_addr_to_slab (./include/linux/mm.h:1178 mm/kasan/../slab.h:211 mm/kasan/common.c:38) [ 225.278301][ T561] ? 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) [ 225.278306][ T561] kasan_report (mm/kasan/report.c:636) [ 225.278313][ T561] ? 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) [ 225.278325][ T561] ? 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) [ 225.278331][ T561] __kasan_check_byte (mm/kasan/common.c:561) [ 225.278337][ T561] krealloc_noprof (mm/slub.c:4858 mm/slub.c:4958) [ 225.278344][ T561] ? execmem_alloc (mm/execmem.c:299 mm/execmem.c:383) [ 225.278359][ T561] 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) [ 225.278366][ T561] ? __x86_indirect_paranoid_thunk_rcx (./arch/x86/include/asm/GEN-for-each-reg.h:7) [ 225.278380][ T561] ? __pi___x86_indirect_thunk_rax (./arch/x86/include/asm/GEN-for-each-reg.h:7) [ 225.278387][ T561] apply_retpolines (arch/x86/kernel/alternative.c:994 (discriminator 3)) [ 225.278396][ T561] ? __pfx_apply_retpolines (arch/x86/kernel/alternative.c:946) [ 225.278402][ T561] ? __pfx___mutex_lock (kernel/locking/mutex.c:746) [ 225.278493][ T561] module_finalize (arch/x86/kernel/module.c:292) [ 225.278510][ T561] ? add_kallsyms (kernel/module/kallsyms.c:212) [ 225.278526][ T561] ? __pfx_module_finalize (arch/x86/kernel/module.c:241) [ 225.278533][ T561] ? __pfx_cmp_ex_sort (lib/extable.c:52) [ 225.278539][ T561] ? __pfx_swap_ex (lib/extable.c:28) [ 225.278547][ T561] load_module (kernel/module/main.c:2927 kernel/module/main.c:3422) [ 225.278560][ T561] ? __pfx_load_module (kernel/module/main.c:3327) [ 225.278566][ T561] ? kernel_read_file (fs/kernel_read_file.c:80 (discriminator 2)) [ 225.278588][ T561] ? 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) [ 225.278596][ T561] ? __pfx_kernel_read_file (fs/kernel_read_file.c:38) [ 225.278606][ T561] ? init_module_from_file (kernel/module/main.c:3673) [ 225.278611][ T561] init_module_from_file (kernel/module/main.c:3673) [ 225.278617][ T561] ? __pfx_init_module_from_file (kernel/module/main.c:3649) [ 225.278634][ T561] ? idempotent_init_module (kernel/module/main.c:3685) [ 225.278638][ T561] ? __lock_release (kernel/locking/lockdep.c:5539) [ 225.278658][ T561] ? 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) [ 225.278665][ T561] idempotent_init_module (kernel/module/main.c:3685) [ 225.278672][ T561] ? __pfx_idempotent_init_module (kernel/module/main.c:3677) [ 225.278688][ T561] ? cap_capable (security/commoncap.c:132) [ 225.278704][ T561] __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) [ 225.278709][ T561] ? 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) [ 225.278721][ T561] do_syscall_64 (arch/x86/entry/syscall_64.c:63 arch/x86/entry/syscall_64.c:94) [ 225.278728][ T561] entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:130) [ 225.278740][ T561] RIP: 0033:0x7fe638c99e5d [ 225.278747][ T561] 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 [ 225.278751][ T561] RSP: 002b:00007ffdb5109cf8 EFLAGS: 00000246 ORIG_RAX: 0000000000000139 [ 225.278762][ T561] RAX: ffffffffffffffda RBX: 0000561b28f4fb90 RCX: 00007fe638c99e5d [ 225.278766][ T561] RDX: 0000000000000000 RSI: 0000561b287efa2a RDI: 0000000000000000 [ 225.278769][ T561] RBP: 0000000000040000 R08: 0000000000000000 R09: 00007ffdb5109e30 [ 225.278772][ T561] R10: 0000000000000000 R11: 0000000000000246 R12: 0000561b287efa2a Finger prints: print_report:kasan_report:__kasan_check_byte:krealloc_noprof:emit_its_trampoline