]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
drm/amdgpu: Check for valid number of registers to read
authorTrek <trek00@inbox.ru>
Sat, 31 Aug 2019 19:25:36 +0000 (21:25 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 17 Oct 2019 20:42:12 +0000 (13:42 -0700)
commit8f2e3c7f8b57f033bb163cbcfa65c53c78baa9d4
tree38dcdbfc8c85cfb112f2c4d6fe6fff5b3dc823ea
parent60991fefbbed8a26ef0ddfba1b1ab42435954ea4
drm/amdgpu: Check for valid number of registers to read

[ Upstream commit 73d8e6c7b841d9bf298c8928f228fb433676635c ]

Do not try to allocate any amount of memory requested by the user.
Instead limit it to 128 registers. Actually the longest series of
consecutive allowed registers are 48, mmGB_TILE_MODE0-31 and
mmGB_MACROTILE_MODE0-15 (0x2644-0x2673).

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=111273
Signed-off-by: Trek <trek00@inbox.ru>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c