summaryrefslogtreecommitdiff
path: root/scripts/Makefile.vmlinux
diff options
context:
space:
mode:
authorXiang Liu <xiang.liu@amd.com>2026-04-09 12:10:21 +0300
committerAlex Deucher <alexander.deucher@amd.com>2026-04-17 21:49:47 +0300
commitb8939bd764c9c8bf6488dc0d71d9c718c25d8cfc (patch)
treeec20cae520f062a331b849b45d6f91d29fbff111 /scripts/Makefile.vmlinux
parentd42d3012b278151b65bb8e328bbc6fdc678822a4 (diff)
downloadlinux-b8939bd764c9c8bf6488dc0d71d9c718c25d8cfc.tar.xz
drm/amdgpu: fix CPER ring header parsing
amdgpu_cper_ring_get_ent_sz() parses CPER headers directly from the circular ring buffer to determine the current entry size. When the ring is full and the write pointer lands near the end of the buffer, the header can wrap across the ring boundary. The existing code treats the 4-byte CPER signature as a C string and uses strcmp() on in-ring binary data, then reads record_length through a direct struct pointer cast. Both assumptions are unsafe for wrapped entries and can read past the end of the ring mapping. Fix the parser by comparing the signature as raw bytes and by copying the header into a local buffer before reading record_length, handling wraparound explicitly in both cases. This avoids out-of-bounds reads in amdgpu_cper_ring_get_ent_sz() when the CPER ring is full or the current entry starts at the tail of the ring. Signed-off-by: Xiang Liu <xiang.liu@amd.com> Reviewed-by: Tao Zhou <tao.zhou1@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'scripts/Makefile.vmlinux')
0 files changed, 0 insertions, 0 deletions