Skip to content

PTSan: A Practical Memory Safety Sanitizer for C/C++ with Pointer-Object Authority

Jul 2026 · arXiv.org · Vol abs/2607.19246 · 0 citations · 37 references
Computer Science

TL;DR

P PTSan is presented, an LLVM sanitizer that makes pointer-based checking practical by storing an object identifier in each pointer's high bits and its bounds in a fixed-size runtime table, and preserving the inter-object, non-object, and temporal detection coverage measured by an independent memory safety test suite.

Abstract

Memory safety errors remain the dominant source of severe vulnerabilities in C and C++. Pointer-based sanitizers provide stronger guarantees than location-based tools such as LLVM's ASan, but their overhead and compatibility limitations have constrained production use. We present PTSan, an LLVM sanitizer that makes pointer-based checking practical by storing an object identifier in each pointer's high bits and its bounds in a fixed-size runtime table. This representation trades a finite live-object budget for low overhead, optimizer visibility, and commodity-hardware support. Because identity travels with the pointer value, ordinary LLVM dataflow propagates it without explicit per-pointer metadata instructions. Separating metadata lookup from check enforcement exposes both as LLVM IR, enabling check hoisting, elision, and merging, plus whole-function min-cut placement of compatibility tag strips. Intel Linear Address Masking eliminates the remaining strips in hardware when available. On stock hardware PTSan runs at parity with the fastest published location-based sanitizer: 57.2% geomean overhead on SPEC CPU 2017 on x86-64 (46.4% with Intel LAM), 54.7% on ARM64, and 31.5% (x86-64) on the application-shaped LLVM MultiSource suite. This is roughly a third of the published overhead percentage of prior systems with similar pointer-object authority guarantees, while preserving the inter-object, non-object, and temporal detection coverage measured by an independent memory safety test suite. Its physical-memory overhead is effectively native, a critical property for production deployment as memory costs become a first-order constraint. We also demonstrate practical overhead on real-world server and security workloads. These results show that PTSan brings practical pointer-based memory safety into a recompile-only sanitizer deployment model.

View source

Similar papers

Open access Aug 2026

MixSan: Enhancing Address-Based Memory Sanitizers with Fused Metadata and Hybrid Detection

MixSan, a prototype built on RangeSanitizer (RSan), stores the same identity tag in pointer high bits through Intel Linear Address Masking (LAM) U57 and validates both the tag and the spatial bound with a unified 3-ALU-op check.

Xiao-Yun Lu, Qiang Wei, Yun-Feng Wang et al. · 0 citations
Preprint Sep 2026

MallocSan: A Memory Safety Tool for Native Closed-Source Applications

Memory-corruption errors remain a leading cause of high-impact vulnerabilities in C and C++ software. Deterministic detection, however, remains difficult to deploy: compiler-based sanitizers require source code and control of the build pipeline, hardware-assisted schemes depend on specific platforms, and dynamic binary...

Adel Belkhiri, Michel Dagenais, Maxime Lamothe · 0 citations
Open access 2026

Supporting Memory Safety with a Security-Enhanced Memory Controller

SerMC is proposed, a memory-controller-based tripwire mechanism that validates accesses when metadata arrives from Dynamic Random Access Memory and extends enforcement to DRAM-bound accesses issued by both processors and DMA-capable devices, and provides practical average-case overhead but still exposes a clear worst-c...

Gen Xu, Li Lv, Jiayan Dong · 0 citations
Aug 2026

PMDangNull: Preventing use-After-Free for Persistent Memory Applications

Use-After-Free (UAF) remains one of the most critical security threats affecting C/C++ programs. Moreover, the cross-restart persistence semantics of persistent memory (PM) programming models significantly broaden the UAF attack surface. Existing DRAM-based protection schemes lack crash consistency guarantees, whereas...

Yuquan Chi, Yinjin Fu, Yong-Gang Hu et al. · 0 citations
Preprint Aug 2026

FRESCO: Complete and Scalable Temporal Safety for CHERI Application Processors

CHERI provides hardware-enforced spatial memory safety. While prior work extends it with heap temporal safety, stack use-after-return remains unaddressed. Existing defenses fall short: compiler analysis reliably catches only references that escape as function return values, while dynamic sanitizers impose overheads tha...

Merve Gülmez, Nils Jordan, Jia-Lu Zhang et al. · 0 citations
Open access Aug 2026

How CHERIoT Provides Strong and Usable Isolation Without an MMU

Co-design of hardware and software offers stronger security and ease of use The CHERIoT platform is a RISC-V-based ISA, an RTOS, and a programmer model that were co-designed for security. The ISA provides hardware mechanisms for enforcing spatial and (heap) temporal memory safety, type safety for opaque types, and ligh...

D. Chisnall · 0 citations

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.