On 2025-03-01 at 01:22:46 +0100, Andrey Konovalov wrote: >On Thu, Feb 27, 2025 at 1:33 PM Maciej Wieczor-Retman ><maciej.wieczor-retman@xxxxxxxxx> wrote: >> >> Btw just out of curiosity on the topic. If we used a runtime specified kasan >> offset, could the gdb script issue (not knowing the offset at compile-time) be >> fixed by just exporting the value through sysfs? >> >> I know that in inline mode the compiler would still need to know the offset >> value but I was curious if this approach was okay at least in outline mode? > >I think this would work, assuming that GDB can pick it up from sysfs. One other question that came to me about how KASAN works, is there some mechanism to prevent data races between two threads? In the compiler perhaps? For example memory is de-allocated and shadow memory is poisoned but some other thread was just about to do a shadow memory check and was interrupted? I've read the kasan/vmalloc.c comments and from them I'd extrapolate that the caller needs to make sure there are not data races / memory barriers are in place. -- Kind regards Maciej Wieczór-Retman