Skip to content
STIMSMITH

Bounds checking

Concept

Bounds checking is a verification technique—performed at run time, by compilers, or in hardware—that ensures every memory access falls within the valid range of an allocated object. It is a primary mechanism for enforcing memory spatial safety in programming languages and instruction-set extensions, though it can impose significant performance overhead that has motivated a variety of elimination, optimization, and verification techniques.

First seen 6/8/2026
Last seen 6/8/2026
Evidence 2 chunks
Wiki v1

WIKI

Overview

Bounds checking is the act of verifying, at the point of a memory access, that the address being read or written lies within the valid range (the "bounds") of the referenced object. It is a foundational mechanism for enforcing memory spatial safety, ensuring that programs do not access memory outside the objects they legitimately reference.

Unsafe memory accesses in popular systems languages such as C and C++ have been a leading cause of software vulnerability, which has motivated extensive work on bounds-checking techniques at the software, compiler, and hardware levels [arXiv:1907.04241].

READ FULL ARTICLE →

NEIGHBORHOOD

No graph connections found for this entity yet. It may appear in future ingestion runs.

explore full graph →

RELATIONSHIPS

2 connections
UCAM-CL-TR-984 ← uses 100% 1e
Bounds checking is a key mechanism implemented as part of CHERI capability enforcement.
CHERI ← uses 100% 1e
CHERI enforces spatial safety through capability bounds checking.

CITATIONS

6 sources
6 citations — click to expand
[1] SoftBound enforces memory spatial safety by checking if every access to array elements is within the corresponding array bounds, often resulting in high execution-time overhead due to bounds-checking instructions. CHOP: Bypassing Runtime Bounds Checking Through Convex Hull OPtimization
[2] The CHOP framework, based on Convex Hull OPtimization, bypasses redundant memory bounds checks via profile-guided, model-based inference and can avoid on average 80.12% of dynamic bounds-check instructions, improving performance up to 95.80% over SoftBound. CHOP: Bypassing Runtime Bounds Checking Through Convex Hull OPtimization
[3] The Augmented Weak-Distance (AWD) approach achieves 100% accuracy on 40 bounds-checking benchmarks from SV-COMP 2024, matching the bounded model checker CBMC while running on average 170× faster, whereas the static analyzer Astrée solves only 17.5% of those benchmarks. Augmented Weak Distance for Fast and Accurate Bounds Checking
[4] The CHERI ISA is focused on adding safety to C and C++, which are vulnerable by default to spatial-safety attacks, and an alternative to CHERI would be to use safe languages that add compiler-inserted bounds checks and use pointers more restrictively; even so, billions of lines of existing C and C++ code motivate adding spatial safety to those languages. UCAM-CL-TR-984 (CHERI technical report)
[5] Most high-level languages ensure spatial safety by performing dynamic bounds checks (e.g., Java, C#, Python), supported by maintaining length information and running bounds checks on every array access, often made possible by a virtual machine that tracks object metadata. UCAM-CL-TR-984 (CHERI technical report)
[6] The CHERI technical report dedicates Section 3.4.2 to "Bounds check" implementation and Section 5.4.1 to a "Fast bounds check" fast path for application-class processors, indicating that bounds checking is treated as a first-class hardware mechanism. UCAM-CL-TR-984 (CHERI technical report)