Hardware memory safety extensions tested for database security and speed

Should Your Database Systems Use Hardware-Assisted Memory Safety Extensions in Production?

Databases

Summary

Databases often use programming languages that can cause tricky memory problems, risking data errors or breaches. The authors studied two new hardware tools that help catch these memory mistakes automatically: Arm's Memory Tagging Extension (MTE) and CHERI. They tested these tools in real database systems to see how well they protect memory without slowing things down too much. They found that MTE adds only a small speed penalty and works well on many systems, while CHERI offers stronger safety but slows databases more and needs extra work to use. This helps database builders decide if these hardware tools are worth using to make databases more reliable and secure.

What this means in practice

  • For database system architects: Choose appropriate hardware memory safety features to balance data safety and runtime speed in production database deployments.
  • For embedded systems developers: Adapt safety-focused hardware extensions like MTE or CHERI to embedded database software needing more secure memory usage with manageable performance costs.

Authors

Ilya Meignan--Masson, Martin Fink, Masanori Misono, Dimitrios Stavrakakis, Pramod Bhatotia

Abstract

Database systems are predominantly developed in unsafe languages (e.g., C/C++) to meet performance requirements through low-level memory management, yet this reliance renders them prone to systemic memory-safety issues that compromise reliability, consistency, security, and durability. Through an extensive bug analysis of prominent database systems, we show that these memory-safety issues persist in production environments despite advancements in database testing tools. While emerging hardware-assisted extensions, such as Arm's Memory Tagging Extension (MTE) and CHERI, offer a promising mitigation path for memory safety, their practical applicability and performance overhead within the specialized constraints of database systems remain largely unexplored. In this paper, we evaluate hardware extensions through the lens of what we define as the database trilemma: the fundamental trade-off between safety, performance, and portability, to determine their viability for production-grade database systems. We provide the first side-by-side comparison of MTE and CHERI across a database workload suite. Our bottom-up study spans microarchitecture, the compiler/runtime/OS stack, core data structures (ART, B+Tree, hash table, skip list, linked list, and queue), and full database systems (Redis, LevelDB, SQLite, MySQL, DuckDB, and LadyBugDB) to characterize their performance, safety guarantees, and ease of adoption. We find that while hardware extensions can offer near-deterministic protection, they introduce non-uniform performance taxes: MTE provides high portability with modest overheads (~10%), while CHERI delivers superior safety guarantees with higher performance penalties (20-60%) and significant porting effort. Our study equips database systems architects with an actionable guide toward building the next generation of reliable, secure databases using hardware-assisted safety mechanisms.