Enhanced Memory Corruption Detection in C/C++ Programs

Ching Yi Lin, Wuu Yang

Research output: Chapter in Book/Report/Conference proceedingConference contributionpeer-review

Abstract

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.

Original languageEnglish
Title of host publication52nd International Conference on Parallel Processing, ICPP 2023 - Workshops Proceedings
PublisherAssociation for Computing Machinery
Pages71-78
Number of pages8
ISBN (Electronic)9798400708435
DOIs
StatePublished - 7 Aug 2023
Event52nd International Conference on Parallel Processing, ICPP 2023 - Workshops Proceedings - Salt Lake City, United States
Duration: 7 Aug 202310 Aug 2023

Publication series

NameACM International Conference Proceeding Series

Conference

Conference52nd International Conference on Parallel Processing, ICPP 2023 - Workshops Proceedings
Country/TerritoryUnited States
CitySalt Lake City
Period7/08/2310/08/23

Keywords

  • Intel SGX
  • LLVM
  • memory corruption
  • page aliasing
  • red zones
  • shadow memory
  • x86-64

Fingerprint

Dive into the research topics of 'Enhanced Memory Corruption Detection in C/C++ Programs'. Together they form a unique fingerprint.

Cite this