google / kernel-sanitizers

Linux Kernel Sanitizers, fast bug-detectors for the Linux kernel
https://google.github.io/kernel-sanitizers/
436 stars 87 forks source link

does hwasan need to enable ksan for x86_64 linux gnu? #221

Closed trcrsired closed 4 weeks ago

trcrsired commented 4 weeks ago

I want to try hwasan on x86, is that possible?

xairy commented 4 weeks ago

I assume you're talking about HWASan for the Linux kernel, aka SW_TAGS KASAN. No, it's not supported on x86. It's possible to add support for it based on Intel LAM, but this was never done. Thanks!

trcrsired commented 4 weeks ago

I assume you're talking about HWASan for the Linux kernel, aka SW_TAGS KASAN. No, it's not supported on x86. It's possible to add support for it based on Intel LAM, but this was never done. Thanks!

not kernel itself. i mean the user space hwasan. i need to test my C++ application with hwasan, not the kernel thing. How to build linux kernel with hwasan support for userspace application I mean. Not kernel itself since the kernel needs to untag the pointer from the userspace application.

trcrsired commented 4 weeks ago

hello?

trcrsired commented 4 weeks ago

@xairy Because i am writing a paper that needs to benchmark against hwasan.

https://clang.llvm.org/docs/HardwareAssistedAddressSanitizerDesign.html

xairy commented 4 weeks ago

No idea about userspace, but the page you linked also mentions needing Intel LAM. So would assume you can just enable it via -fsanitize=hwaddress on systems that support LAM. I see you already the same question here, hopefully, someone will respond there.