Comments (6)
I've built the kernel using your config and LLVM r370631 (aka 5c6b82a7567cd16072a0424fb564c9d3ede11716 - see https://llvm.org/docs/GettingStarted.html for LLVM Git monorepo instructions; I don't think it makes sense to support the SVN workflow)
It boots and hangs after printing "Starting KernelMemorySanitizer". Taking a look.
from kmsan.
This could've been caused by CONFIG_LOCKDEP.
I'm seeing KMSAN re-entering the runtime at boot:
#0 0xffffffff819b9a9b in kmsan_get_shadow_origin_ptr (address=0xffffffff839371e0 <debug_locks>,
size=4, store=false) at mm/kmsan/kmsan.c:664
#1 0xffffffff819b9ed0 in __msan_metadata_ptr_for_load_4 (addr=0xffffffff839371e0 <debug_locks>)
at mm/kmsan/kmsan_instr.c:54
#2 0xffffffff813c04b0 in lockdep_hardirqs_off (ip=18446744071589045830)
at kernel/locking/lockdep.c:3371
#3 0xffffffff8164e328 in trace_hardirqs_off () at kernel/trace/trace_preemptirq.c:45
#4 0xffffffff819ba646 in __msan_poison_alloca (address=0xffffffff8380fd68, size=<optimized out>,
descr=0xffffffff8386a4f0 "----flags.i.i.i@debug_check_no_locks_freed")
at mm/kmsan/kmsan_instr.c:266
#5 0xffffffff813cd368 in native_save_fl () at kernel/locking/lockdep.c:5206
#6 arch_local_save_flags ()
at /usr/local/google/src/clang-kernel-build/kmsan-devel/./arch/x86/include/asm/irqflags.h:79
#7 arch_local_irq_save ()
at /usr/local/google/src/clang-kernel-build/kmsan-devel/./arch/x86/include/asm/irqflags.h:120
#8 debug_check_no_locks_freed (mem_from=0xffffffff8387ea28 <global_trace+152>, mem_len=56)
at kernel/locking/lockdep.c:5209
#9 0xffffffff813fabc3 in __raw_spin_lock_init (lock=0xffffffff8387ea28 <global_trace+152>,
name=0xffffffff837489ce "&global_trace.start_lock",
key=0xffffffff84686400 <tracer_alloc_buffers..key>) at kernel/locking/spinlock_debug.c:23
#10 0xffffffff83abe56f in tracer_alloc_buffers () at kernel/trace/trace.c:9073
#11 0xffffffff83abe3c9 in early_trace_init () at kernel/trace/trace.c:9176
#12 0xffffffff83a2c510 in start_kernel () at init/main.c:635
#13 0xffffffff83a2b4f2 in x86_64_start_reservations (real_mode_data=<optimized out>)
at arch/x86/kernel/head64.c:472
#14 0xffffffff83a2b428 in x86_64_start_kernel (
real_mode_data=0x140f0 <cpu_tss_rw+8432> <error: Cannot access memory at address 0x140f0>)
at arch/x86/kernel/head64.c:453
#15 0xffffffff810000d4 in secondary_startup_64 () at arch/x86/kernel/head_64.S:241
#16 0x0000000000000000 in ?? ()
from kmsan.
Yeah, we're hitting a recursion here:
#0 task_kmsan_context_state () at mm/kmsan/kmsan.c:91
#1 0xffffffff819baa39 in __msan_get_context_state () at mm/kmsan/kmsan_instr.c:305
#2 0xffffffff8164e0b6 in trace_hardirqs_off () at kernel/trace/trace_preemptirq.c:38
#3 0xffffffff819ba646 in __msan_poison_alloca (address=0xffffffff8380f948, size=<optimized out>,
descr=0xffffffff8386a130 "----flags.i.i@lockdep_hardirqs_off") at mm/kmsan/kmsan_instr.c:266
#4 0xffffffff813c0535 in native_save_fl () at kernel/locking/lockdep.c:3378
#5 arch_local_save_flags () at /usr/local/google/src/clang-kernel-build/kmsan-devel/./arch/x86/include/asm/irqflags.h:79
#6 lockdep_hardirqs_off (ip=18446744071589045830) at kernel/locking/lockdep.c:3378
#7 0xffffffff8164e328 in trace_hardirqs_off () at kernel/trace/trace_preemptirq.c:45
#8 0xffffffff819ba646 in __msan_poison_alloca (address=0xffffffff8380fa88, size=<optimized out>,
descr=0xffffffff8386a130 "----flags.i.i@lockdep_hardirqs_off") at mm/kmsan/kmsan_instr.c:266
#9 0xffffffff813c0535 in native_save_fl () at kernel/locking/lockdep.c:3378
#10 arch_local_save_flags () at /usr/local/google/src/clang-kernel-build/kmsan-devel/./arch/x86/include/asm/irqflags.h:79
#11 lockdep_hardirqs_off (ip=18446744071589045830) at kernel/locking/lockdep.c:3378
#12 0xffffffff8164e328 in trace_hardirqs_off () at kernel/trace/trace_preemptirq.c:45
#13 0xffffffff819ba646 in __msan_poison_alloca (address=0xffffffff8380fbc8, size=<optimized out>,
descr=0xffffffff8386a130 "----flags.i.i@lockdep_hardirqs_off") at mm/kmsan/kmsan_instr.c:266
#14 0xffffffff813c0535 in native_save_fl () at kernel/locking/lockdep.c:3378
#15 arch_local_save_flags () at /usr/local/google/src/clang-kernel-build/kmsan-devel/./arch/x86/include/asm/irqflags.h:79
#16 lockdep_hardirqs_off (ip=18446744071589045830) at kernel/locking/lockdep.c:3378
#17 0xffffffff8164e328 in trace_hardirqs_off () at kernel/trace/trace_preemptirq.c:45
#18 0xffffffff819ba646 in __msan_poison_alloca (address=0xffffffff8380fd68, size=<optimized out>,
descr=0xffffffff8386a4f0 "----flags.i.i.i@debug_check_no_locks_freed") at mm/kmsan/kmsan_instr.c:266
#19 0xffffffff813cd368 in native_save_fl () at kernel/locking/lockdep.c:5206
#20 arch_local_save_flags () at /usr/local/google/src/clang-kernel-build/kmsan-devel/./arch/x86/include/asm/irqflags.h:79
#21 arch_local_irq_save () at /usr/local/google/src/clang-kernel-build/kmsan-devel/./arch/x86/include/asm/irqflags.h:120
#22 debug_check_no_locks_freed (mem_from=0xffffffff8387ea28 <global_trace+152>, mem_len=56) at kernel/locking/lockdep.c:5209
#23 0xffffffff813fabc3 in __raw_spin_lock_init (lock=0xffffffff8387ea28 <global_trace+152>,
name=0xffffffff837489ce "&global_trace.start_lock", key=0xffffffff84686400 <tracer_alloc_buffers..key>)
at kernel/locking/spinlock_debug.c:23
#24 0xffffffff83abe56f in tracer_alloc_buffers () at kernel/trace/trace.c:9073
#25 0xffffffff83abe3c9 in early_trace_init () at kernel/trace/trace.c:9176
#26 0xffffffff83a2c510 in start_kernel () at init/main.c:635
#27 0xffffffff83a2b4f2 in x86_64_start_reservations (real_mode_data=<optimized out>) at arch/x86/kernel/head64.c:472
#28 0xffffffff83a2b428 in x86_64_start_kernel (
real_mode_data=0x140f0 <cpu_tss_rw+8432> <error: Cannot access memory at address 0x140f0>)
at arch/x86/kernel/head64.c:453
from kmsan.
Guess the easiest thing to do is to disable lockdep under KMSAN for now: 3c46b34
from kmsan.
Not sure why this got closed.
from kmsan.
Turns out this can be fixed by simply not instrumenting kernel/locking/lockdep.c
.
from kmsan.
Related Issues (20)
- duplicate stack origin PC HOT 2
- The return value of 'sscanf()' should be checked HOT 1
- Don't zero out origin of uninitialized bytes in kmsan_internal_set_shadow_origin() HOT 1
- KMSAN must use contiguous shadow for physical pages HOT 1
- Should we override gfp_flags when allocating metadata pages? HOT 1
- recipe for target 'vmlinux' failed? HOT 2
- trim aux frames from stacks HOT 1
- duplicate frame for local var origin HOT 1
- BUG: KMSAN: uninit-value in kmsan_handle_dma HOT 8
- Potential deadlock in stack_depot_save() HOT 1
- Some crypto configs that use asm are not disabled HOT 1
- BUG: NULL pointer dereference in wp_page_copy (kmsan specific) HOT 3
- Compile kmsan with clang-9 with -O2 ERROR HOT 2
- compile KMSAN error HOT 5
- https://www.google.com/webhp?client=ms-android-americamovil-us-revc&source=android-home&gws_rd=ssl
- Security Policy violation Binary Artifacts HOT 15
- can't compile if select KMSAN in ubuntu 2204 HOT 3
- arch/x86/kernel/module.c:230:49: error: call to undeclared library function 'memcpy' HOT 13
- KMSAN doesn't support paravirtualization
- Why do we need to sync metadata in x86_32 page faults? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kmsan.