Tech-ASan : Two-stage check for Address Sanitizer Conference: 16th Symposium on Internetware; June 20–22, 2025; Trondheim, Norway 16th Symposium on Internetware (Internetware 2025), June 20–22, 2025, Trondheim, Norway DOI: xx.xxx/xx.xxx ISBN: xxx-xxx/25/06 CCS: Security and privacy Software and appl
Yixuan Cao, Yuhong Feng, Huafeng Li, Chongyi Huang, Fangcao Jian, Haoran Li, Xu Wang · 2025
Read Tech-ASan : Two-stage check for Address Sanitizer Conference: 16th Symposium on Internetware; June 20–22, 2025; Trondheim, Norway 16th Symposium on Internetware (Internetware 2025), June 20–22, 2025, Trondheim, Norway DOI: xx.xxx/xx.xxx ISBN: xxx-xxx/25/06 CCS: Security and privacy Software and appl by Yixuan Cao, Yuhong Feng, Huafeng Li, Chongyi Huang, Fangcao Jian, Haoran Li, Xu Wang (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2506-05022.txt.
Introduction
Yixuan Cao and co-authors presented Tech-ASan in 2025, a faster way to run a memory safety checker for C and C++ programs. The checker, called Address Sanitizer, catches errors such as use of freed memory, but it slows programs a lot. Much of that cost comes from checks that read shadow memory again and again.
Tech-ASan uses a two-stage check. A quick magic value test handles most cases and avoids the costly reads. A second part removes checks that repeat, with a new method for loops. On a standard benchmark, it cut extra run time well below both the base checker and a faster rival, and it missed fewer test faults.
Catalog record
| CREATOR | Yixuan Cao, Yuhong Feng, Huafeng Li, Chongyi Huang, Fangcao Jian, Haoran Li, Xu Wang |
|---|---|
| YEAR | 2025 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 57 KB |
| VERSION | 1.0 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2506-05022
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
Tech-ASan : Two-stage check for Address Sanitizer Conference: 16th Symposium on Internetware; June 20–22, 2025; Trondheim, Norway 16th Symposium on Internetware (Internetware 2025), June 20–22, 2025, Trondheim, Norway DOI: xx.xxx/xx.xxx ISBN: xxx-xxx/25/06 CCS: Security and privacy Software and application security CCS: Software and its engineering Software defect analysis Yixuan Cao, Yuhong Feng, Huafeng Li, Chongyi Huang, Fangcao Jian, Haoran Li, Xu Wang Abstract . Address Sanitizer (ASan) is a sharp weapon for detecting memory safety violations, including temporal and spatial errors hidden in C/C++ programs during execution. However, ASan incurs significant runtime overhead, which limits its efficiency in testing large software. The overhead mainly comes from sanitizer checks due to the frequent and expensive shadow memory access. Over the past decade, many methods have been developed to speed up ASan by eliminating and accelerating sanitizer checks, however, they either fail to adequately eliminate redundant checks or compromise detection capabilities. To address this issue, this paper presents Tech -ASan , a t wo-stag e ch eck based technique to accelerate ASan with safety assurance. First, we propose a novel two-stage check algorithm for ASan, which leverages magic value comparison to reduce most of the costly shadow memory accesses. Second, we design an efficient optimizer to eliminate redundant checks, which integrates a novel algorithm for removing checks in loops. Third, we implement Tech-ASan as a memory safety tool based on the LLVM compiler infrastructure. Our evaluation using the SPEC CPU2006 benchmark shows that Tech-ASan outperforms the state-of-the-art methods with 33.70% and 17.89% less runtime overhead than ASan and ASan - - , respectively. Moreover, Tech-ASan detects 56 fewer false negative cases than ASan and ASan - - when testing on the Juliet Test Suite under the same redzone setting. 1. Introduction Programs written in memory-unsafe languages such as C and C++ often contain memory safety violations, which can be categorized into temporal errors and spatial errors . A temporal error occurs when code attempts to access a memory object after it has been freed, whereas a spatial error happens when the code reads or writes beyond the bounds of a valid memory object. Memory safety violations are the root cause of many of today’s most severe vulnerabilities ( Vintila et al. 2025 ) , which may lead to severe issues such as system crash, data breach, and hijacked execution when exploited ( Szekeres et al. 2013 ) . As reported in the 2023 CWE Top 10 KEV Weaknesses, use-after-free, heap-based buffer overflow, and out-of-bounds write rank 1st, 2nd, and 3rd among all weaknesses, respectively. 1 1 1 https://cwe.mitre.org/top25/archive/2023/2023_kev_list.html In recent years, sanitizing for memory safety has become a widely adopted method for identifying vulnerabilities in software testing, especially within the realm of fuzzing ( Raj et al. 2024 ; Gorter et al. 2023 ) . Motivated by numerous security incidents caused by memory safety violations in system software, various sanitizers have been created to detect memory safety violations at runtime to help developers fix them, where Address Sanitizer (ASan) is the most popular tool due to its outstanding capability (detection of a wide spectrum of spatial errors and temporal errors), scalability (ability to support industry-grade programs like operating system kernels and web browsers), and usability (nearly zero configuration and seamless integration into mainstream compilers such as clang and gcc) ( Serebryany et al. 2012 ; Zhang et al. 2022 ) . Technically, ASan allocates additional shadow memory, poisons/unpoisons the shadow memory at runtime to record the addressable state of the memory, and checks the shadow memory before memory access to determine whether it is a memory safety violation. However, ASan brings approximately 1 \times runtime overhead to the tested program, which limits the efficiency of ASan in testing large software. Over the past decade, reducing the runtime overhead of ASan has attracted the interest of many researchers. Existing studies have shown that more than 80% of the ASan’s runtime overhead is introduced by sanitizer checks ( Zhang et al. 2022 ) . To address this issue, the existing optimization solutions mainly focus on two aspects: check elimination ( Serebryany et al. 2024 ; Zhang et al. 2021 ; Wagner et al. 2015 ; Xu et al. 2017 ; Lettner et al. 2018 ; Zhang et al. 2022 ; Liu et al. 2016 ) and check acceleration ( Gorter et al. 2023 ; Ling et al. 2024 ) . Check elimination. As the official ASan documentation 2 2 2 https://github.com/google/sanitizers/wiki/AddressSanitizerCompileTimeOptimizations states, finding all bugs does not require to instrument all memory accesses, sanitizer checks for memory with safety assurance can be eliminated. Existing check-eliminating methods can be categorized into performance-driven and security-driven methods. Performance-driven methods ( Liu et al. 2016 ; Serebryany et al. 2024 ; Wagner et al. 2015 ; Lettner et al. 2018 ) eliminate sanitizer checks to meet performance constraints but do not guarantee safety. DoubleTake ( Liu et al. 2016 ) uses canaries to overwrite unaddressable memory and divides the program runtime into several epochs, checking whether the canary has been tampered with at the end of each epoch. However, this design can only detect write vulnerabilities, but not read vulnerabilities. In addition, DoubleTake only partially overwrites the freed heap memory with canaries, so it will miss use-after-free in unprotected areas. GWP-ASan ( Serebryany et al. 2024 ) randomly protects heap objects with guard pages and ignores most of the others. ASAP ( Wagner et al. 2015 ) removes sanitizer checks on “hot” code that is more frequently executed. PartiSan ( Lettner et al. 2018 ) follows a performance-driven metric to remove sanitizer checks. Security-driven methods ( Zhang et al. 2021 ; Zhang et al. 2022 ) are designed to eliminate redundant sanitizer checks to reduce runtime overhead with safety assurance. SANRAZOR ( Zhang et al. 2021 ) combines static patterns and dynamic patterns to identify and remove redundant sanitizer checks, but it still cannot ensure the removed checks are indeed redundant due to its unsound patterns. Also, SANRAZOR needs user input for profiling. Therefore, SANRAZOR degrades ASan’s capability and usability. Finally, ASan - - ( Zhang et al. 2022 ) uses static analysis to eliminate redundant checks while ensuring safety at compile time, which is still the state-of-the-art (SOTA) method to accelerate ASan. However, ASan - - still has room for further optimization: First, it fails to speed up the sanitizer check. Second, it fails to fully remove checks within loops. Although checks in loops account for about 45% of the overhead introduced by all ASan checks ( Zhang et al. 2022 ) , eliminating redundant checks in loops remains unsolved. In summary, existing check elimination methods either eliminate checks without safety assurance or fail to adequately eliminate checks on security access. Check acceleration. In recent years, some works have attempted to accelerate checks to reduce the overall runtime overhead of the sanitizer, but they compromise the capabilities of ASan. FloatZone ( Gorter et al. 2023 ) replaces comparison-based checks with floating-point underflow exception-based checks to enable higher instruction-level parallelism, and cancels shadow memory to reduce cache miss rate. But FloatZone introduces false positives because metadata is no longer isolated in shadow memory. GiantSan ( Ling et al. 2024 ) introduces history caching and region checking to achieve