diff options
| author | Chenglei Xie <Chenglei.Xie@amd.com> | 2026-05-11 15:24:29 -0400 |
|---|---|---|
| committer | Alex Deucher <alexander.deucher@amd.com> | 2026-05-27 10:48:27 -0400 |
| commit | ebbd73d089bd47021e67a43bed665178adb55b4b (patch) | |
| tree | c9e48b17c83d95e3718e86fd4dff328906c4a68b /include/linux/debugobjects.h | |
| parent | 2d071f6457af08f4692d340fcae030b5eabd6837 (diff) | |
drm/amdgpu: bound SR-IOV RAS CPER dump parsing against used_size
The VF copies a PF-provided CPER telemetry blob and walks records using
cper_dump->count and each entry's record_length. count is u64 while the
loop used u32, so a large count could loop indefinitely. record_length was
not limited to the kmemdup'd region, so the first iteration could read far
past the allocation; record_length == 0 could spin forever on the same
entry. Together that allowed a malicious hypervisor to leak heap past the
blob into the CPER ring or hang the guest.
Require used_size to cover the fixed header before buf and stay within the
telemetry cap. Track remaining bytes in buf, cap iterations with u64 and
CPER_MAX_ALLOWED_COUNT, and reject record_length outside
[sizeof(cper_hdr), remaining] before writing to the ring.
Signed-off-by: Chenglei Xie <Chenglei.Xie@amd.com>
Reviewed-by: YiPeng Chai <YiPeng.Chai@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'include/linux/debugobjects.h')
0 files changed, 0 insertions, 0 deletions
