google / kmsan

KernelMemorySanitizer, a detector of uses of uninitialized memory in the Linux kernel
Other
406 stars 63 forks source link

When to trigger the check of KMSAN? #52

Closed OpenStacksh closed 5 years ago

OpenStacksh commented 5 years ago

There is an MSAN example, the code is like this: #include <stdio.h> int main() { int a = 1; int b; int c = a + b; printf("c:%d\n", c); } use clang to compile the code: clang -fsanitize=memory -fPIE -pie -fno-omit-frame-pointer -g test.c -o test but, the result is like this, No MSAN Report c:1200630145 So, why? Why is there no trigger the check?

dvyukov commented 5 years ago

You seem to be interested in the user-space MSAN, not KMSAN (linux kernel tool). MSAN project is https://github.com/google/sanitizers and the mailing list for questions is https://groups.google.com/forum/#!forum/memory-sanitizer

OpenStacksh commented 5 years ago

@dvyukov ,thank you for your answer! I am interested in both MSAN and KMSAN. I am currently learning the MSAN.But I think both of them have similarities. So I would like to ask, what is the trigger mechanism for kmsan? When is the check triggered? Thanks!

dvyukov commented 5 years ago

This is the paper with internal details of memorysanitizer: https://static.googleusercontent.com/media/research.google.com/en//pubs/archive/43308.pdf If you have further questions, please ask on https://groups.google.com/forum/#!forum/memory-sanitizer. It has the right people.

OpenStacksh commented 5 years ago

Thanks. @dvyukov