radeon_dp_mst: missing NULL check on create_fake_mst_encoder return -> NULL deref on best_encoder callback
Summary
radeon_dp_add_mst_connector at 288 stores radeon_dp_create_fake_mst_encoder(master) without NULL check. Returns NULL on kzalloc failure (619-620, 623-626). radeon_mst_best_encoder at 230 returns &radeon_connector->mst_encoder->base -> NULL deref. Any unpriv user via DRM_IOCTL_MODE_GETCONNECTOR after malicious hub floods port-add events under memory pressure. Fix: NULL check + drm_connector_cleanup + kfree on failure.
Discussion (0)
PoC verification
Evidence pack
findings/poc/DF-1777 Β· 2 files| File | Type | Description | Size | |
|---|---|---|---|---|
| fix.diff | suggested-fix | Add NULL check after create_fake_mst_encoder; cleanup and return NULL on failure | 721 B | view raw |
| VERDICT.md | verdict | full analysis | 1.1 KB | β raw |
DF-1777 β Verdict
Severity: Low Status: REPRODUCED (source-only confirmation β driver/HW-gated, not runtime-triggered on QEMU guest) Impact: panic Confidence: certain
Verdict
REPRODUCED. The cited bug is confirmed real in the audited source at sys/dev/drm/radeon/radeon_dp_mst.c:288.
Mechanism
radeon_dp_add_mst_connector stores radeon_dp_create_fake_mst_encoder result without NULL check; kzalloc failure returns NULL, radeon_mst_best_encoder derefs NULL.
Fix
Add NULL check after create_fake_mst_encoder; cleanup and return NULL on failure.
The full git-apply-able diff is in fix.diff.
Build validation
fix.diff applies cleanly and compiles with -Werror as part of the batch module build
(all 51 fixes applied to /usr/src, kernel+modules built).
Notes
Source-only confirmation: this finding is in a GPU/display code path that requires specific hardware not present in the QEMU guest. The bug is confirmed by source tracing (cited path:line verified against sys/), and the fix compiles clean. No runtime trigger was attempted as the relevant device/module is HW-gated.
Fix verification
fixedVALIDATED via batch build rc=0.
radeon sources compiled with -Werror.
Confirmed kernel references
- s
- y
- s
- /
- d
- e
- v
- /
- d
- r
- m
- /
- r
- a
- d
- e
- o
- n
- /
- r
- a
- d
- e
- o
- n
- _
- d
- p
- _
- m
- s
- t
- .
- c
- :
- 2
- 8
- 8
Detail
Exploit chain
none
Evidence (decisive lines)
Source traced at sys/dev/drm/radeon/radeon_dp_mst.c:288. Fix compiled clean.
PoC changes
authored fix.diff: NULL check after create_fake_mst_encoder
Verified recommended fix
Add NULL check after create_fake_mst_encoder. Matches finding proposal.
Verdict
REPRODUCED (source-only). radeon_dp_create_fake_mst_encoder result stored without NULL check; kzalloc failure -> NULL deref in best_encoder.
No comments yet.