DragonFlyBSD Kernel Audit
DF-1673 / fix.diff
← back to finding ↓ download raw
--- a/sys/dev/drm/radeon/cik_sdma.c
+++ b/sys/dev/drm/radeon/cik_sdma.c
@@ -473,6 +473,10 @@
 		const __le32 *fw_data;
 		u32 fw_size;
 
+		if (rdev->sdma_fw->datasize < sizeof(*hdr)) {
+			dev_err(rdev->dev, "ci_sdma: firmware too small\n");
+			return -EINVAL;
+		}
 		radeon_ucode_print_sdma_hdr(&hdr->header);
 
 		/* sdma0 */