diff options
| author | 2026-04-14 05:08:42 +0000 | |
|---|---|---|
| committer | 2026-04-17 15:41:13 -0400 | |
| commit | fc3659f178d4a65599167d5a648bbeef4b0d4446 (patch) | |
| tree | 427ecede5edc36615115f8fd2666aa03d202acb5 /scripts/Makefile.thinlto | |
| parent | drm/amdgpu/jpeg: Fix sprintf buffer overflow warning in jpeg_v2_5 (diff) | |
drm/amdgpu: fix integer overflow in amdgpu_gem_align_pitch()
amdgpu_gem_align_pitch() is passed u32 width and cpp from dumb buffer
creation but uses signed int internally. The round-up add and the
aligned * cpp multiplication can overflow, returning zero or a negative
pitch. A zero pitch propagates to a zero-sized GEM object allocation
that reaches userspace via DRM_IOCTL_MODE_CREATE_DUMB.
Switch the helper to unsigned int and use check_add_overflow() /
check_mul_overflow() so wraparound returns zero. Reject a zero pitch
or size in amdgpu_mode_dumb_create() rather than allocating a zero-
byte BO.
Fixes: 8e911ab770f7 ("drm: amdgpu: Replace drm_fb_get_bpp_depth() with drm_format_plane_cpp()")
Signed-off-by: Werner Kasselman <werner@verivus.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions
