Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ddc42881 authored by Konstantin Meskhidze's avatar Konstantin Meskhidze Committed by Greg Kroah-Hartman
Browse files

drm/radeon: possible buffer overflow



[ Upstream commit dd05484f99d16715a88eedfca363828ef9a4c2d4 ]

Buffer 'afmt_status' of size 6 could overflow, since index 'afmt_idx' is
checked after access.

Fixes: 5cc4e5fc ("drm/radeon: Cleanup HDMI audio interrupt handling for evergreen")
Co-developed-by: default avatarIvanov Mikhail <ivanov.mikhail1@huawei-partners.com>
Signed-off-by: default avatarKonstantin Meskhidze <konstantin.meskhidze@huawei.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 4a29f0f7
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -4819,14 +4819,15 @@ int evergreen_irq_process(struct radeon_device *rdev)
			break;
		case 44: /* hdmi */
			afmt_idx = src_data;
			if (!(afmt_status[afmt_idx] & AFMT_AZ_FORMAT_WTRIG))
				DRM_DEBUG("IH: IH event w/o asserted irq bit?\n");

			if (afmt_idx > 5) {
				DRM_ERROR("Unhandled interrupt: %d %d\n",
					  src_id, src_data);
				break;
			}

			if (!(afmt_status[afmt_idx] & AFMT_AZ_FORMAT_WTRIG))
				DRM_DEBUG("IH: IH event w/o asserted irq bit?\n");

			afmt_status[afmt_idx] &= ~AFMT_AZ_FORMAT_WTRIG;
			queue_hdmi = true;
			DRM_DEBUG("IH: HDMI%d\n", afmt_idx + 1);