Skip to contentSkip to conversation

Warn if packages with invalid references are evaluated

PATCH Applied Thomas Renninger 3 participants 3 messages Mar 6, 2008 – Mar 12, 2008 ACPI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Warn if packages with invalid references are evaluated

Warn if packages with invalid references are evaluated

And return an error to avoid NULL pointer access. Lin Ming's patch avoids corrupted mem access when BIOS has invalid references included, the handle is now zero instead of corrupted.

---

drivers/acpi/utils.c +6 -0
Index: linux-2.6.24/drivers/acpi/utils.c
===================================================================
@@ -407,6 +407,12 @@ acpi_evaluate_reference(acpi_handle hand
 			break;
 		}
 
+		if (!element->reference.handle) {
+			printk(KERN_WARNING PREFIX "Invalid reference in"
+			       " package %s\n", pathname);
+			status = AE_NULL_ENTRY;
+			break;
+		}
 		/* Get the  acpi_handle. */
 
 		list->handles[i] = element->reference.handle;
#1 lore raw
Quoted 6 lines · Thomas Renninger

Warn if packages with invalid references are evaluated

And return an error to avoid NULL pointer access. Lin Ming's patch avoids corrupted mem access when BIOS has invalid references included, the handle is now zero instead of corrupted.

Thanks,
Lin Ming

Quoted 24 lines

---
Index: linux-2.6.24/drivers/acpi/utils.c
===================================================================

drivers/acpi/utils.c +6 -0
@@ -407,6 +407,12 @@ acpi_evaluate_reference(acpi_handle hand
 			break;
 		}
 
+		if (!element->reference.handle) {
+			printk(KERN_WARNING PREFIX "Invalid reference in"
+			       " package %s\n", pathname);
+			status = AE_NULL_ENTRY;
+			break;
+		}
 		/* Get the  acpi_handle. */
 
 		list->handles[i] = element->reference.handle;
reviewer Applied
#2 lore raw
In reply to Thomas Renninger

applied.

thanks,
-len

Quoted 35 lines · Thomas Renninger

Warn if packages with invalid references are evaluated

And return an error to avoid NULL pointer access. Lin Ming's patch avoids corrupted mem access when BIOS has invalid references included, the handle is now zero instead of corrupted.

---
Index: linux-2.6.24/drivers/acpi/utils.c
===================================================================

drivers/acpi/utils.c +6 -1
@@ -407,6 +407,12 @@ acpi_evaluate_reference(acpi_handle hand
 			break;
 		}
 
+		if (!element->reference.handle) {
+			printk(KERN_WARNING PREFIX "Invalid reference in"
+			       " package %s\n", pathname);
+			status = AE_NULL_ENTRY;
+			break;
+		}
 		/* Get the  acpi_handle. */
 
 		list->handles[i] = element->reference.handle;
 
 
--

To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html