Question for Rust people: when you use a C library, and you write a safe interface around it, is it common to build that C library with AddressSanitizer? (if not, why not?)
Conversation
Replying to
ASan isn't designed for providing safety / hardening and doesn't do a good job of mitigating vulnerabilities. It also adds extra attack surface and may make you worse off than not using it. It's not a memory safety implementation for C. It's a way to detect common cases of bugs.
It uses instrumentation combined with features like red zones and a quarantine to detect common cases of bugs but not every case of them. It won't stop exploitation of arbitrary read/write vulnerabilities, etc. A safer approach to the quarantine can be done via malloc without it.
1
If the attacker knows ASan is being used, they can just bypass it for those vulnerabilities. Even if they don't, it's just an annoyance and doesn't prevent the exploitation. It would largely only defend against sequential overflows in practice. Doesn't do what most people think.
1
Show replies

