Views
No views yet
.pte Delegate Metadata Null-Deref Crash PoC.pte flatbuffer that registers a backend delegate but omits required delegate-metadata fields is accepted by Program::load(). When Program::load_method("forward") later runs, the C++ runtime dereferences nullable flatbuffer fields without null-checks, causing SIGSEGV on model load before any inputs are supplied.ExecutionPlan.delegates[0].processed omitted entirelyProgram.backend_delegate_data omitted while delegates[0].processed.location = INLINEbackend_delegate_data present as an empty vector) returns a clean RuntimeError: 0x:20, proving the crash is specifically a missing-field validation gap and not a generic invalid-index issue..pte model file consumed by ExecuTorch runtime.pytorch/executorch main @ HEAD 84f39aa707da6350d39efcce9961c600134d6f98 (2026-05-12, verified via GitHub connector)runtime/executor/method.cpp — delegate.processed() dereferenced without null-check:
1const executorch_flatbuffer::BackendDelegateDataReference* processed =
2 delegate.processed();
3switch (processed->location()) { // crash: processed is nullruntime/executor/program.cpp — backend_delegate_data() dereferenced without null-check:
1const auto* data_list = static_cast<const executorch_flatbuffer::Program*>(internal_program_)
2 ->backend_delegate_data();
3ET_CHECK_OR_RETURN_ERROR(index < data_list->size(), ...); // crash: data_list is nullruntime/executor/program_validation.cpp — validate_program() does not validate delegate entries, BackendDelegate.processed, Program.backend_delegate_data, or inline delegate-data indices. The flatbuffer schema does not mark these fields as required.1cd /tmp/executorch-audit/poc
2python3 repro_delegate_null_crash.pyrepro_delegate_null_crash.out):missing_delegate_processed.pte → SIGSEGV (exit -11)missing_backend_delegate_data_field.pte → SIGSEGV (exit -11)empty_backend_data_vector.pte (control) → RuntimeError 0x:20 (graceful)missing_delegate_processed_faulthandler.out confirms native frame in Method::load_method.from executorch.runtime import Runtime; Runtime.get().load_program(...).load_method(...)Module::load(..., Verification::Minimal) + Program::load_methodexamples/portable/executor_runner — Program::load(loader.get()) → program->load_method(...).pte will crash. No execution, no inputs required — crash is at metadata load time.| File | SHA-256 (first 16 hex) | Purpose |
|---|---|---|
missing_delegate_processed.pte | 00bad33491e9da03 | Crash variant 1: omitted processed field |
missing_backend_delegate_data_field.pte | 558151a27ba83d79 | Crash variant 2: omitted backend_delegate_data |
empty_backend_data_vector.pte | (control) | Empty vector — returns RuntimeError, does NOT crash |
baseline-valid.pte | (control) | Valid .pte for comparison |
repro_delegate_null_crash.py | — | Reproducer driver |
repro_delegate_null_crash.out | — | Captured stdout/stderr |
missing_delegate_processed_faulthandler.out | — | Native stack trace |
Method::load_method:1const auto* processed = delegate.processed();
2if (processed == nullptr) {
3 ET_LOG(Error, "Delegate missing 'processed' metadata");
4 return Error::InvalidProgram;
5}
6
7const auto* data_list = program->backend_delegate_data();
8if (data_list == nullptr) {
9 ET_LOG(Error, "Program missing 'backend_delegate_data' array");
10 return Error::InvalidProgram;
11}validate_program() in program_validation.cpp to walk all delegate entries and verify required fields are present before returning Error::Ok.lendtrain (huntr) / tonydav41 (HuggingFace). Filed 2026-05-12.