Skip to content

fix(msan): harden loader path handling to avoid uninitialized reads#755

Draft
MrSpideyNihal wants to merge 6 commits intometacall:developfrom
MrSpideyNihal:fix/ext-loader-uninitialized
Draft

fix(msan): harden loader path handling to avoid uninitialized reads#755
MrSpideyNihal wants to merge 6 commits intometacall:developfrom
MrSpideyNihal:fix/ext-loader-uninitialized

Conversation

@MrSpideyNihal
Copy link
Copy Markdown
Contributor

This PR fixes repeated MemorySanitizer uninitialized-read reports in the loader execution-path flow by hardening path construction and storage across configuration, loader core, and ext loader.

What changed

1.ext_loader: bounded path conversion using LOADER_PATH_SIZE

  • Replaced direct path conversion with bounded string construction before filesystem path conversion.
  • Added cstring include required for strnlen.

2.loader core: normalize deferred execution paths before storage

  • Zero-initialize temporary loader_path buffers.
  • Avoid raw push of external path pointers into fixed-size vector slots.
  • Copy paths into normalized, null-terminated loader_path buffers before vector insertion.

3.configuration: bound and terminate child path copy

  • Use bounded length for copied path data.
  • Explicitly write null terminator after memcpy.

Why
MSan showed repeated use-of-uninitialized-value in ext_loader execution path handling. Root cause is partially initialized path-buffer propagation through loader path flow. This PR prevents reading beyond initialized bytes and aligns bounds with loader path size contracts.

@viferga viferga marked this pull request as draft April 2, 2026 07:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant