Enhanced Memory Corruption Detection in C/C plus plus Programs

被引:0
作者
Lin, Ching-Yi [1 ]
Yang, Wuu [2 ]
机构
[1] Natl Yang Ming Chiao Tung Univ, Comp Secur, Hsinchu, Taiwan
[2] Natl Yang Ming Chiao Tung Univ, Dept Comp Sci, Hsinchu, Taiwan
来源
PROCEEDINGS OF THE 52ND INTERNATIONAL CONFERENCE ON PARALLEL PROCESSING WORKSHOPS PROCEEDINGS, ICPP-W 2023 | 2023年
关键词
page aliasing; red zones; shadow memory; memory corruption; LLVM; x86-64; Intel SGX;
D O I
10.1145/3605731.3605903
中图分类号
TP301 [理论、方法];
学科分类号
081202 ;
摘要
Out-of-bound memory accesses, which often occur in programs written in unsafe languages such as C or C++, cause severe troubles. Though there are many useful tools aiming at this problem, we report a new tool, called mcds, for detecting spatial and temporal memory corruptions in x86-64 ELF binary. Mcds allocates each memory object to a separate virtual page. The rest is left blank. Due to a facility in the memory management library, we can set up memory protection so that accessing the "blank" part of a virtual page causes a hardware trap. Because it is a hardware trap, there is little run-time overhead. In order to save memory space, we may squeeze several virtual pages into a single physical page. Our first experimental result is that mcds can find all the bugs in the Firefox 78 package, the Chrome package and the PHP7.0 package that are recorded on the CVE Details website. Furthermore, mcds can detect three classes of memory corruptions that are beyond the capability of the current AddressSanitizer (Asan). Then we compare the time for compilation and fuzzing tests. The fuzzing test is done with AFL++ fuzzer on Ubuntu 22.04 LTS with Intel i5-9600K chip. According to our experimental results, mcds shows approximately 6x speedup in fuzzing tests against AddressSanitizer. There is not significant difference between compiling the source with AddressSanitizer or with mcds, though both of them result in 2x slowdown compared with compilation without a sanitizer.
引用
收藏
页码:71 / 78
页数:8
相关论文
共 19 条
[1]  
[Anonymous], 2009, P LINUX S, P19
[2]  
Cowan C, 1998, PROCEEDINGS OF THE SEVENTH USENIX SECURITY SYMPOSIUM, P63
[3]  
CVE Details, 2022, CVE Details-The ultimate security vulnerabilities database
[4]  
CWE, 2022, 2022 CWE Top 25 Most Dangerous Software Weaknesses
[5]   Stack Bounds Protection with Low Fat Pointers [J].
Duck, Gregory J. ;
Yap, Roland H. C. ;
Cavallaro, Lorenzo .
24TH ANNUAL NETWORK AND DISTRIBUTED SYSTEM SECURITY SYMPOSIUM (NDSS 2017), 2017,
[6]  
Hardware assisted AddressSanitizer, 2019, Hardwareassisted AddressSanitizer Design Documentation
[7]  
Hiser JD, 2009, LECT NOTES COMPUT SC, V5429, P164
[8]  
Hunter AH, 2021, PROCEEDINGS OF THE 15TH USENIX SYMPOSIUM ON OPERATING SYSTEMS DESIGN AND IMPLEMENTATION (OSDI '21), P257
[9]  
Kwon A., 2013, P ACM SIGSAC C COMP
[10]  
Linux, 2021, mmap(2)-man page