====================================== | [ 16.627340][ T265] ================================================================== | [ 16.627703][ T265] 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) | [ 16.627975][ T265] Read of size 1 at addr ffff888001926720 by task modprobe/265 | [ 16.628234][ T265] [ 16.628333][ T265] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011 [ 16.628335][ T265] Call Trace: [ 16.628337][ T265] [ 16.628339][ T265] dump_stack_lvl (lib/dump_stack.c:123) [ 16.628347][ T265] print_address_description.constprop.0 (mm/kasan/report.c:409) [ 16.628352][ T265] ? 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) [ 16.628356][ T265] print_report (mm/kasan/report.c:522) [ 16.628359][ T265] ? 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) [ 16.628362][ T265] ? kasan_addr_to_slab (./include/linux/mm.h:1178 mm/kasan/../slab.h:211 mm/kasan/common.c:38) [ 16.628367][ T265] ? 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) [ 16.628370][ T265] kasan_report (mm/kasan/report.c:636) [ 16.628374][ T265] ? 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) [ 16.628379][ T265] ? 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) [ 16.628382][ T265] __kasan_check_byte (mm/kasan/common.c:561) [ 16.628386][ T265] krealloc_noprof (mm/slub.c:4858 mm/slub.c:4958) [ 16.628390][ T265] ? execmem_alloc (mm/execmem.c:299 mm/execmem.c:383) [ 16.628395][ T265] 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) [ 16.628398][ T265] ? __x86_indirect_paranoid_thunk_rcx (./arch/x86/include/asm/GEN-for-each-reg.h:7) [ 16.628404][ T265] ? __pi___x86_indirect_thunk_rax (./arch/x86/include/asm/GEN-for-each-reg.h:7) [ 16.628408][ T265] apply_retpolines (arch/x86/kernel/alternative.c:994 (discriminator 3)) [ 16.628413][ T265] ? __pfx_apply_retpolines (arch/x86/kernel/alternative.c:946) [ 16.628417][ T265] ? __pfx___mutex_lock (kernel/locking/mutex.c:746) [ 16.628427][ T265] module_finalize (arch/x86/kernel/module.c:292) [ 16.628433][ T265] ? add_kallsyms (kernel/module/kallsyms.c:212) [ 16.628439][ T265] ? __pfx_module_finalize (arch/x86/kernel/module.c:241) [ 16.628443][ T265] ? __pfx_cmp_ex_sort (lib/extable.c:52) [ 16.628446][ T265] ? __pfx_swap_ex (lib/extable.c:28) [ 16.628451][ T265] load_module (kernel/module/main.c:2927 kernel/module/main.c:3422) [ 16.628458][ T265] ? __pfx_load_module (kernel/module/main.c:3327) [ 16.628462][ T265] ? kernel_read_file (fs/kernel_read_file.c:80 (discriminator 2)) [ 16.628468][ T265] ? 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) [ 16.628472][ T265] ? __pfx_kernel_read_file (fs/kernel_read_file.c:38) [ 16.628476][ T265] ? add_chain_cache (kernel/locking/lockdep.c:3770) [ 16.628481][ T265] ? init_module_from_file (kernel/module/main.c:3673) [ 16.628485][ T265] init_module_from_file (kernel/module/main.c:3673) [ 16.628488][ T265] ? __pfx_init_module_from_file (kernel/module/main.c:3649) [ 16.628496][ T265] ? idempotent_init_module (kernel/module/main.c:3685) [ 16.628499][ T265] ? __lock_release (kernel/locking/lockdep.c:5539) [ 16.628504][ T265] ? 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) [ 16.628508][ T265] idempotent_init_module (kernel/module/main.c:3685) [ 16.628512][ T265] ? __pfx_idempotent_init_module (kernel/module/main.c:3677) [ 16.628520][ T265] ? cap_capable (security/commoncap.c:132) [ 16.628526][ T265] __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) [ 16.628529][ T265] ? 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) [ 16.628534][ T265] do_syscall_64 (arch/x86/entry/syscall_64.c:63 arch/x86/entry/syscall_64.c:94) [ 16.628537][ T265] entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:130) [ 16.628541][ T265] RIP: 0033:0x7f054008de5d [ 16.628545][ T265] 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 [ 16.628547][ T265] RSP: 002b:00007ffee0588b98 EFLAGS: 00000246 ORIG_RAX: 0000000000000139 [ 16.628552][ T265] RAX: ffffffffffffffda RBX: 0000558c0a081960 RCX: 00007f054008de5d [ 16.628554][ T265] RDX: 0000000000000000 RSI: 0000558bd0dc3a2a RDI: 0000000000000005 [ 16.628556][ T265] RBP: 0000000000040000 R08: 0000000000000000 R09: 00007ffee0588cd0 [ 16.628558][ T265] R10: 0000000000000005 R11: 0000000000000246 R12: 0000558bd0dc3a2a Finger prints: print_report:kasan_report:__kasan_check_byte:krealloc_noprof:emit_its_trampoline