diff options
author | Jesse.Zhang <Jesse.Zhang@amd.com> | 2025-08-23 15:00:06 +0800 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2025-08-27 13:57:51 -0400 |
commit | a7a411e2462675327e07dd35f226c48d236bdbb3 (patch) | |
tree | dd6ad077fdd4e3cec0d545d36c7fe26b0767d833 /rust/helpers/pci.c | |
parent | 268da6fc8d89f322358750922b626c8fda33043b (diff) |
drm/amdgpu: fix shift-out-of-bounds in amdgpu_debugfs_jpeg_sched_mask_set
Fix a UBSAN shift-out-of-bounds warning in amdgpu_debugfs_jpeg_sched_mask_set
when the shift exponent reaches or exceeds 32 bits. The issue occurred because
a 32-bit integer '1' was being shifted by up to 32 bits, which is undefined
behavior.
Replace '1' with '1ULL' to ensure 64-bit arithmetic, matching the u64 type of
'val' and preventing the shift overflow. This is consistent with the existing
mask calculation that already uses 1ULL.
The error manifested as:
UBSAN: shift-out-of-bounds in drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.c:373:17
shift exponent 32 is too large for 32-bit type 'int'
v2: remove debug log
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Suggested-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Jesse Zhang <Jesse.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'rust/helpers/pci.c')
0 files changed, 0 insertions, 0 deletions