amdgpu_acp.c is a dead translation unit: not in any build, unbuildable (missing shim headers), config-gated off β known findings DF-1907/DF-1908/DF-1909/DF-1910 are unreachable at runtime on DragonFly
Summary
Proven five ways: absent from the Makefile SRCS; includes reference shim headers that do not exist (pm_domain.h, the whole include/sound/ tree) so the TU cannot compile; CONFIG_DRM_AMD_ACP never defined so adev->acp and the IP-block registrations compile out; DFly has no mfd/genpd subsystem for it to call into; the shipped amdgpu.ko contains zero ACP symbols (acpi positive control: 17). Triage value: re-classify DF-1907/08/09/10 deferred/latent; re-validate at the next drm vendor sync if the shims appear. Additional latent error-path defects documented in the pack.
Discussion (0)
PoC verification
Evidence pack
findings/poc/DF-4826 Β· 8 files| File | Type | Description | Size | |
|---|---|---|---|---|
| check_dead.sh | β | 2.6 KB | view raw | |
| build.sh | β | 145 B | view raw | |
| run.sh | β | 151 B | view raw | |
| run.log | β | 2.7 KB | view raw | |
| env.txt | β | 479 B | view raw | |
| VERDICT.md | β | 5.8 KB | β raw | |
| README.md | β | 2.6 KB | β raw | |
| verdict.json | β | 3.5 KB | view raw |
DF-4826 β amdgpu_acp.c is a dead translation unit on DragonFly
Claim
sys/dev/drm/amd/amdgpu/amdgpu_acp.c is never compiled into the DragonFly
kernel or the amdgpu.ko module, and cannot be compiled as-shipped. Every
code path in it β including the four open pass-1 findings DF-1907, DF-1908,
DF-1909, DF-1910 β is unreachable at runtime on a DragonFly system.
Build
Nothing to build (that is the finding):
sh build.sh # include-resolution gate; any C compiler dies on
# <linux/pm_domain.h>, which does not exist in
# sys/dev/drm/include/
Run
sh run.sh # deterministic tree checks + recorded guest artifact check
Expected output (all five verdict inputs)
amdgpu_acp.cappears in no SRCS line ofsys/dev/drm/amd/amdgpu/Makefile(the only "acp" hit isamdgpu_acpi.c, a different file β line 168).sys/dev/drm/include/linux/pm_domain.hdoes not exist (onlypm.h,pm_qos.h,pm_runtime.h); the entiresys/dev/drm/include/sound/directory does not exist, so<sound/designware_i2s.h>and<sound/pcm.h>(amdgpu_acp.c:29-30) are fatal include errors.CONFIG_DRM_AMD_ACPis never defined anywhere insys/β its only occurrences are#ifdef/#if definedconsumers (amdgpu.h:823, vi.c:74/1685/1706, smu8_hwmgr.c:667), soadev->acp, theacp_ip_blockregistration in vi.c, and the smu8 ACP hwmgr path are all compiled out.- No
mfd_add_hotplug_devices/mfd_add_devices/mfd_remove_devices/pm_genpd_init/pm_genpd_add_device/bus_find_device_by_nameimplementation exists anywhere insys/β the DFly mfd/genpd "shims" are include-guard-only headers (mfd/core.hdefines nothing;struct platform_deviceis an empty struct). - Guest binary artifact:
/boot/kernel/amdgpu.kocontains zero amdgpu ACP symbols (acp_ip_block,acp_hw_init,acp_poweron, β¦) while the acpi positive control matches 17.
Files
check_dead.shβ deterministic tree + membership checks (the PoC source)build.sh/run.shβ exact commandsrun.logβ full untrimmed output of the decisive run (host + guest)env.txtβ host git rev, guest unameVERDICT.mdβ full narrativemanifest.json/verdict.json
No fix.diff: this is a reachability refutation, not a memory-corruption
finding; there is no kernel defect introduced by this file on DragonFly
(because the file is not in the kernel). Recommended triage action lives in
verdict.json recommended_fix.
DF-4826 VERDICT β dead translation unit; DF-1907/08/09/10 unreachable
Status: reproduced (the dead-code claim), impact: none, confidence: certain.
What was claimed (pass-2 reachability question)
The pass-2 task for sys/dev/drm/amd/amdgpu/amdgpu_acp.c was to determine
which of the known findings (DF-1907 pp_funcs NULL deref in acp_poweron;
DF-1908 dev_info(NULL,...) in get_mfd_cell_dev; DF-1909 genpd dangling in
a global list after acp_hw_fini; DF-1910 i2s_pdata leak) are actually
reachable given the state of the DragonFly linux-compat shims.
Answer: none of them β the translation unit is never built
Five independent proofs, all reproduced in run.log:
- Not in the build.
sys/dev/drm/amd/amdgpu/Makefile(67 SRCS lines, explicit lists, no wildcards) never mentionsamdgpu_acp.c. The only grep hit for "amdgpu_acp" isamdgpu_acpi.c(line 168) β a different file whose presence is the positive control. - Cannot compile even if added.
amdgpu_acp.c:27includes<linux/pm_domain.h>and:29-30include<sound/designware_i2s.h>/<sound/pcm.h>. None of these headers exist:sys/dev/drm/include/linux/contains onlypm.h,pm_qos.h,pm_runtime.h, and thesys/dev/drm/include/sound/directory does not exist at all. Any compile attempt dies at line 27. - Config gate never opens.
CONFIG_DRM_AMD_ACPis only ever consumed (#ifdefat amdgpu.h:823 guardingstruct amdgpu_device::acp;#if definedat vi.c:74, vi.c:1685, vi.c:1706 guarding theacp_ip_blockIP-block registration on CZ/Stoney; smu8_hwmgr.c:667) and never defined anywhere in the tree. Without it,adev->acpdoes not even exist as a struct member, so no caller-side path can reach ACP state either. - The shims the code depends on do not exist. DFly has no mfd and no
genpd implementation:
sys/dev/drm/include/linux/mfd/core.his an empty include-guard;struct platform_deviceis an empty struct (platform_device.h:36-37);mfd_add_hotplug_devices,mfd_remove_devices,pm_genpd_init,pm_genpd_add_device,pm_genpd_remove_device,bus_find_device_by_name,struct generic_pm_domain,struct mfd_cell,struct i2s_platform_dataappear in exactly one file of the wholesys/tree: amdgpu_acp.c itself. There is noplatform_bus_type, no cell device creation, no pdataprobecallback that could re-enter this file. - The shipped binary agrees. On the audit guest
(DragonFly v6.5.0.1712.g89e6a-DEVELOPMENT),
nm /boot/kernel/amdgpu.ko | grep -cE 'acp_ip_block|acp_hw_init|acp_poweron'β 0, while the acpi control (grep -ci acpi) β 17. The module that ships with the OS contains no ACP code.
Consequence for the known findings (do not re-file; re-triage)
- DF-1907 (
acp_poweronpp_funcs NULL deref, amdgpu_acp.c:159): latent in vendored source only. Runtime trigger requiresacp_ip_blockto be registered, which requiresCONFIG_DRM_AMD_ACP, which is never defined. - DF-1908 (
dev_info(dev,...)withdev==NULL, amdgpu_acp.c:173): latent only; additionallybus_find_device_by_name/platform_bus_typehave no implementation in this tree, so even a compiled-in file would fail at link time. - DF-1909 (genpd left in global list / freed in
acp_hw_fini, amdgpu_acp.c:228/463): latent only;pm_genpd_inithas no DFly implementation and no global genpd list exists. - DF-1910 (
i2s_pdataleak, amdgpu_acp.c:242): latent only.
All four remain valid upstream Linux/vendored-source observations worth carrying in future drm syncs (upstream Linux reworked this file heavily after 4.x), but none is reachable on DragonFly as shipped.
Latent shapes analyzed in pass 2 and killed by the same dead-TU fact
For the record (these are additional latent defects found this pass; all unreachable for the same reason, so not filed separately):
- Error-path lifetime:
acp_hw_initcallspm_genpd_initat :228 before thekcallocs at :230/:236/:242; a later allocation failure returns -ENOMEM leavingacp_genpdinitialized, and :238/:245kfreeacp_res/acp_cellwhile the pointers stay dangling inadev->acp. The subsequentacp_hw_finiwould then walkadev->acp.acp_cell[i].nameat :454 β NULL/UAF read. Requires kcalloc failure on dead code β not reachable. - Timeout paths leak state: the
-ETIMEDOUTreturns at :369/:385 (and fini's :431/:447) skipmfd_remove_devices/genpd teardown; recovery depends on the IP-fin callback running. Dead code β not reachable. - The register-wait loops are bounded (0xFF iterations Γ udelay(100) β 25.5 ms per loop, amdgpu_acp.c:361-372, 378-389, 423-434, 440-451) β the "infinite wait" hypothesis is killed: they are not infinite.
- Cell/resource bookkeeping is in-bounds: ACP_DEVS=4 cells over a 4-entry
kcalloc, 5 resources over a 5-entrykcalloc,num_resources5/1/1/1 consistent with the resource array β no OOB shape exists (amdgpu_acp.c:230-338). - No firmware path, no audio-component interplay exists in this file
(no
component_add, no audio-component registration).
Fix
No kernel fix required β the code is not built. Triage action: mark
DF-1907/DF-1908/DF-1909/DF-1910 deferred/latent (dead code on DFly) and
carry the notes into the next drm vendor sync; optionally delete the file
locally to prevent confusion (vendored-tree hygiene, not security).
Fix status (batch validation)
Applied with the 36 sibling fix.diffs of this batch in findings/poc/_batch41/all_fixes.patch; single in-guest make -j6 nativekernel KERNCONF=X86_64_GENERIC completed RC=0 with zero errors under -Werror (full log: findings/poc/_batch41/fix_build8.log). Behavior A/B intentionally skipped for this Info-tier item.
(No fix.diff for this item: documented recommendation only - see Fix above.)
Fix verification
not_testablenot_applicable β no kernel code change involved; the finding is a build-membership refutation, so there is no patched-kernel behavior to compare. Mapped to not_testable for the fix_results CHECK constraint.
n/a (no fix.diff; see VERDICT.md 'Fix' section)
Confirmed kernel references
- sys/dev/drm/amd/amdgpu/Makefile:53-347
- sys/dev/drm/amd/amdgpu/amdgpu_acp.c:26
- sys/dev/drm/amd/amdgpu/amdgpu_acp.c:29
- sys/dev/drm/amd/amdgpu/amdgpu.h:823
- sys/dev/drm/amd/amdgpu/vi.c:74
- sys/dev/drm/amd/amdgpu/vi.c:1685
- sys/dev/drm/amd/amdgpu/vi.c:1706
- sys/dev/drm/amd/powerplay/hwmgr/smu8_hwmgr.c:667
- sys/dev/drm/include/linux/platform_device.h:36
- sys/dev/drm/include/linux/mfd/core.h:31
Detail
Evidence (decisive lines)
findings/poc/DF-4826/run.log β all five verdict inputs: [1] Makefile grep 'amdgpu_acp.c' -> none (amdgpu_acpi.c:168 positive control), [2] pm_domain.h/designware_i2s.h/pcm.h ABSENT, [3] CONFIG_DRM_AMD_ACP zero definitions / five ifdef consumers, [4] zero shim implementations for mfd_add_hotplug_devices/mfd_remove_devices/pm_genpd_init/pm_genpd_add_device/bus_find_device_by_name, [5] guest nm amdgpu.ko ACP symbol count 0 vs acpi count 17
PoC changes
n/a β pass-2 originated; PoC authored fresh (check_dead.sh), no seed existed
Verified recommended fix
Re-triage DF-1907/DF-1908/DF-1909/DF-1910 as deferred/latent (dead code on DFly); optionally remove amdgpu_acp.c from the vendored tree or finish the mfd/genpd shims before ever wiring CONFIG_DRM_AMD_ACP on.
Verdict
The dead-code claim reproduced on every axis: amdgpu_acp.c is absent from the amdgpu Makefile SRCS, its required shim headers (linux/pm_domain.h, sound/designware_i2s.h, sound/pcm.h) do not exist anywhere in sys/dev/drm/include, CONFIG_DRM_AMD_ACP is never defined (so adev->acp and the vi.c acp_ip_block registrations are compiled out), no mfd_/pm_genpd_/bus_find_device_by_name implementation exists in the tree, and the shipped guest /boot/kernel/amdgpu.ko contains zero ACP symbols (positive control amdgpu_acpi: 17 matches). Conclusion: DF-1907, DF-1908, DF-1909 and DF-1910 are latent vendored-source defects that cannot execute on DragonFly as shipped; they should be re-triaged as deferred/latent rather than live Medium/Low findings.
No comments yet.