-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
KMSAN doesn't work with CONFIG_DEBUG_LOCK_ALLOC=y #94
Comments
Potentially we can just declare most debug configs as incompatible with KMSAN and prohibit enabling with KMSAN. I afraid there is lots tail (KMEMLEAK, LOCKDEP, well KASAN as well). Since it's not possible to enable all debug configs at once (at least KASAN/KCSAN will require separate builds), we can say that these other bugs configs should be enabled in other debug builds (e.g. with KASAN). |
The following (incomplete) patch:
fixes the reentrancy problem for lockdep calls in However the kernel is still very slow, as we're doing multiple lockdep checks for every memory access. I think we'd better disable |
At least on x86 KMSAN is seriously slown down by lockdep, as every pfn_valid() call (which is done on every instrumented memory access in the kernel) performs several lockdep checks, all of which, in turn, perform additional memory accesses and call KMSAN instrumentation. Right now lockdep overflows the stack under KMSAN, but even if we use reentrancy counters to avoid the recursion on the KMSAN side, the slowdown from lockdep remains big enough for the kernel to become unusable. Reported-by: Kirill A. Shutemov <[email protected]> Closes: google/kmsan#94 Link: https://groups.google.com/g/kasan-dev/c/ZBiGzZL36-I/m/WtNuKqP9EQAJ Signed-off-by: Alexander Potapenko <[email protected]>
As pointed out at https://lore.kernel.org/lkml/CANpmjNOc4Z6Qy_L3pjuW84BOxoiqXgLC1tWbJuZwRUZqs2ioMA@mail.gmail.com/T/, KMSAN hangs at boot time if
CONFIG_DEBUG_LOCK_ALLOC
is enabled:The text was updated successfully, but these errors were encountered: