AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Low 43 Bitcoin

support: clamp RLIMIT_MEMLOCK to size_t

Public commit record

What the developer wrote

Authored by Sjors Provoost

68/100 · Adequate
support: clamp RLIMIT_MEMLOCK to size_t

On 32-bit systems we build with _FILE_OFFSET_BITS=64 (see CMakeLists.txt),
which makes rlim_t 64-bit when building against glibc (see bits/resource.h).
Since size_t could be 32-bit, clamp RLIMIT_MEMLOCK to
std::numeric_limits<size_t>::max() in PosixLockedPageAllocator::GetLimit().

Co-authored-by: Luke Dashjr <luke-jr+git@utopios.org>
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This change fixes a type-size mismatch on 32-bit systems. On those systems, the operating system can report a memory-lock limit as a 64-bit number, but the program stores it in a 32-bit variable. Without the fix, a very large limit could wrap around to a tiny value, potentially causing the wallet to lock far less memory than intended and possibly mishandle sensitive key data. The patch clamps the value to the largest safe 32-bit size before using it.

Recommended action

Backport to supported 32-bit release branches and verify no other rlim_t-to-size_t conversions exist in the locked-pool or memory-locking code paths.

Security signals we found

01

Integer truncation / type narrowing on 32-bit builds

02

Potential undersized locked memory allocation

03

Sensitive-data handling path (locked pool for cryptographic keys)

04

No explicit security framing in commit message

Risk score

Why this scored 43/100

Our methodology →
Potential impact 12/30
Exploitability 8/25
Stealth signal 7/15
Affected reach 6/15
Confidence 7/10
Evidence quality 3/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.