]> git.baikalelectronics.ru Git - kernel.git/commit
drm/amdgpu: Prevent shift wrapping in amdgpu_read_mask()
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 2 Feb 2021 05:56:36 +0000 (08:56 +0300)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 2 Feb 2021 17:12:55 +0000 (12:12 -0500)
commitb7dd298251a856e9ba4d8f510f93efe090f8b212
tree026abda0448ad3b1cf339c1587c00f83c20c4e39
parent9224914b3882250f2d49cbf873a8478e79c054e9
drm/amdgpu: Prevent shift wrapping in amdgpu_read_mask()

If the user passes a "level" value which is higher than 31 then that
leads to shift wrapping.  The undefined behavior will lead to a
syzkaller stack dump.

Fixes: eeecab2dc8a0 ("drm/amd/powerplay: add dpm force multiple levels on cz/tonga/fiji/polaris (v2)")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/pm/amdgpu_pm.c