drm/radeon: possible buffer overflow
authorjsg <jsg@openbsd.org>
Tue, 21 Nov 2023 02:22:04 +0000 (02:22 +0000)
committerjsg <jsg@openbsd.org>
Tue, 21 Nov 2023 02:22:04 +0000 (02:22 +0000)
From Konstantin Meskhidze
341e79f8aec6af6b0061b8171d77b085835c6a58 in linux-6.1.y/6.1.63
dd05484f99d16715a88eedfca363828ef9a4c2d4 in mainline linux

sys/dev/pci/drm/radeon/evergreen.c

index 42507f7..7e6befd 100644 (file)
@@ -4823,14 +4823,15 @@ restart_ih:
                        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);