SafePtrX: Research on Mitigation of Heap-Based Memory Safety Violations for Intel x86-64
摘要
In contemporary programming languages that lack automatic memory management, such as C/C++, ensuring memory safety remains an unresolved practical challenge. Applications developed in these languages often exhibit various safety vulnerabilities. While numerous solutions have been proposed by both academia and industry, some of which have gained widespread adoption, they commonly present limitations such as the requirement for specialized hardware support, significant runtime or memory overhead, or a limited scope of problem coverage. In this paper, we present an efficient, software-based memory safety violation mitigation scheme based on intermediate pointers and metadata embedding for the Intel x86-64 platform. The fundamental idea is to insert intermediate pointers to every pointer that points to heap memory and embed tags in the unused bits of the intermediate pointers. By inserting checks on these intermediate pointers, potential memory safety violations can be mitigated. Based on this scheme, we implement SafePtrX, a mitigation solution for heap memory safety with enhanced security properties and improved performance compared to existing methods. We also demonstrate the feasibility of SafePtrX by using publicly disclosed vulnerabilities.