mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 23:35:53 +01:00
[PR #2328] hw_oracle/drm: harden ELF64 bounds, subprocess timeouts, and temp cleanup #2332
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#2332
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/2328
Author: @kirigayakazima
Created: 11/26/2026
Status: 🔄 Open
Base:
main← Head:fix/hw-oracle-drm-elf-safety📝 Commits (1)
6455dafhw_oracle/drm: harden ELF64 bounds, subprocess timeouts, and temp cleanup📊 Changes
2 files changed (+209 additions, -21 deletions)
View changed files
➕
tests/test_hw_oracle_drm_safety.py(+138 -0)📝
tools/hw_oracle/drm.py(+71 -21)📄 Description
Claimed in the coordination issue as: HW-ORACLE-DRM-ELF-BOUNDS-TIMEOUT-AND-TEMP-CLEANUP (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7193870891)
What and why
.textslice, and kernel descriptor bounds checks (includingvalue < addressunderflow protection) intools/hw_oracle/drm.pyso truncated or corrupt objects raiseValueErrorinstead ofstruct.erroror out-of-range indexing.LEONIDA_HW_DRM_NODEvalues infind_node()withUnavailable.SUBPROCESS_TIMEOUT = 120topkg-config, compiler, launcher device probe, assembler, and_launch()subprocess invocations, converting(OSError, subprocess.TimeoutExpired)intoUnavailable,(None, str(e)), or(-1, "", str(e)).hw_oracle_drmbinaries in_build_launcher()withtempfile.mkstemp()and unlink temporary binaries on build or replace failure.tests/test_hw_oracle_drm_safety.py.Tested
python -I tests/test_hw_oracle_drm_safety.py -v: 3 passed, 0 failed (detachedupstream/mainbaseline with only the new test file fails with 2 errors).python -I tests/test_hw_oracle.py -v: 59 tests (OK, 3 skipped without AMD clang / libdrm gcc on host).python -I tests/test_ci_registration.py: 16 passed.python -I tests/test_text_write_line_endings.py: 3 passed.python -I scripts/check_no_game_data.py,python -I -m compileall -q tools/hw_oracle/drm.py tests/test_hw_oracle_drm_safety.py, andgit diff --cached --check: passed.GPUs tested: n/a
AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.