Skip to content

fix(native): avoid reading device mappings as ELF files - #2025

Merged
jpnurmi merged 4 commits into
masterfrom
jpnurmi/fix/native-elf
Aug 26, 2026
Merged

fix(native): avoid reading device mappings as ELF files#2025
jpnurmi merged 4 commits into
masterfrom
jpnurmi/fix/native-elf

Conversation

@jpnurmi

@jpnurmi jpnurmi commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

Linux module discovery treated every pathname in /proc/<pid>/maps as a potential ELF file. GPU buffer mappings can be backed by a DRM render node such as /dev/dri/renderD128, which is a character device. Reading it to check the ELF magic waits for DRM events and can block the crash daemon indefinitely.

Open mapping paths non-blocking and reject non-regular files before reading ELF data. Apply the validation to module discovery, minidump generation, and symbolization, and cover device and FIFO mappings with a regression test.

💡 Accidentally found while running a hardware-accelerated QtQuick app with the Native backend on my Framework 13 Linux laptop. It would always hang on a native crash.

Linux module discovery treated every pathname in /proc/<pid>/maps as a
potential ELF file. GPU buffer mappings can be backed by a DRM render
node such as /dev/dri/renderD128, which is a character device. Reading it
to check the ELF magic waits for DRM events and can block the crash
daemon indefinitely.

The issue was traced by finding the blocked daemon in drm_read,
inspecting its file descriptors, and correlating the open render node
with the crashed process's memory mappings.

Open mapping paths non-blocking and reject non-regular files before
reading ELF data. Apply the validation to module discovery, minidump
generation, and symbolization, and cover device and FIFO mappings with a
regression test.
@jpnurmi
jpnurmi force-pushed the jpnurmi/fix/native-elf branch from 8ceb829 to afd6612 Compare August 25, 2026 19:13
@codecov

codecov Bot commented Aug 25, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.22222% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 74.24%. Comparing base (3d74596) to head (2e29f61).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2025      +/-   ##
==========================================
- Coverage   74.30%   74.24%   -0.07%     
==========================================
  Files         104      104              
  Lines       26603    26619      +16     
  Branches     4841     4844       +3     
==========================================
- Hits        19768    19763       -5     
- Misses       5486     5505      +19     
- Partials     1349     1351       +2     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jpnurmi
jpnurmi merged commit 34a94d5 into master Aug 26, 2026
111 of 112 checks passed
@jpnurmi
jpnurmi deleted the jpnurmi/fix/native-elf branch August 26, 2026 15:17
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.

2 participants