upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/runtime/src/thread_stacks.cpp
diff options
context:
space:
mode:
authorKal0s-design <356578040+Kal0s-design@users.noreply.github.com>2026-11-23 09:57:43 +0100
committerKal0s-design <356578040+Kal0s-design@users.noreply.github.com>2026-11-24 07:29:32 +0100
commitdb8a0cc793b722be588ddbeade2d2c2b7d4b7373 (patch)
treec39d633874e6eca67550f861656d932bda4ea556 /runtime/src/thread_stacks.cpp
parent8f481cf16f261c7f37458aeb45e8f4e19994146d (diff)
pe_loader: refuse an import address table or TLS index in the headers
After map_image, the loader writes into the mapped image twice: the bound address of every import and the image's TLS index. Every step after it (parse_exports, bind_imports, protect_sections, register_unwind, initialise, ~Loader) reads the headers back from the mapping. A FirstThunk or AddressOfIndex below SizeOfHeaders therefore replaced e_lfanew or the section table, and the next read went outside the image or used headers nobody validated. The loader already refuses a section or a base relocation there; this closes the two remaining writes. An index at RVA 0 is refused too: index_rva doubles as "no index", so the index was silently never written. Found by mutation fuzzing rt::Loader::load. The six new cases in test_pe_loader_bounds build their images by hand; four of them fail without this change. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Diffstat (limited to 'runtime/src/thread_stacks.cpp')
0 files changed, 0 insertions, 0 deletions