DragonFlyBSD Kernel Audit
DF-1674 / fix.diff
← back to finding ↓ download raw
--- a/sys/dev/drm/amd/amdgpu/amdgpu_dpm.c
+++ b/sys/dev/drm/amd/amdgpu/amdgpu_dpm.c
@@ -284,6 +284,9 @@
 {
 	u32 size = atom_table->ucNumEntries *
 		sizeof(struct amdgpu_clock_voltage_dependency_entry);
+
+	if (atom_table->ucNumEntries == 0 || atom_table->ucNumEntries > 256)
+		return -EINVAL;
 	int i;
 	ATOM_PPLIB_Clock_Voltage_Dependency_Record *entry;