]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drm/amd/ras: Fix CPER ring debugfs read overflow
authorXiang Liu <xiang.liu@amd.com>
Thu, 7 May 2026 12:56:15 +0000 (20:56 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 11 May 2026 20:14:59 +0000 (16:14 -0400)
commit1e40ef87ffdc291e05ccdade8b9170cc9c1c4249
treee2179d50d38506a182a19785fb9df8d9fa28daa5
parentd69051b4549f3fe0ee5cb11f0c2c78eb51f7b6f8
drm/amd/ras: Fix CPER ring debugfs read overflow

The legacy CPER debugfs reader can reach the payload path without a
valid pointer snapshot. The remaining user byte count is also treated as
the ring occupancy in dwords, so reads past the header can copy more than
requested.

Take the CPER lock before sampling pointers. Resample rptr/wptr for
payload reads, bound the payload copy by available dwords and the
remaining user size, and advance the file position for each dword copied.

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>
drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c