Skip to content

Commit

Permalink
[PATCH] ACPI: fix vendor resource length computation
Browse files Browse the repository at this point in the history
acpi_rs_get_list_length() needs to account for all the vendor-defined data
bytes.  Failing to include these causes buffers to be sized too small,
which causes slab corruption when we later convert AML to resources and run
off the end of the buffer.

This causes slab corruption on machines that use ACPI vendor-defined
resources.  All HP ia64 machines do, and I'm told that some NEC machines
may as well.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Cc: "Brown, Len" <len.brown@intel.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Bjorn Helgaas authored and Linus Torvalds committed Feb 17, 2006
1 parent 636f13c commit 35b73ce
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/acpi/resources/rscalc.c
Original file line number Diff line number Diff line change
Expand Up @@ -391,8 +391,7 @@ acpi_rs_get_list_length(u8 * aml_buffer,
* Ensure a 32-bit boundary for the structure
*/
extra_struct_bytes =
ACPI_ROUND_UP_to_32_bITS(resource_length) -
resource_length;
ACPI_ROUND_UP_to_32_bITS(resource_length);
break;

case ACPI_RESOURCE_NAME_END_TAG:
Expand All @@ -408,8 +407,7 @@ acpi_rs_get_list_length(u8 * aml_buffer,
* Add vendor data and ensure a 32-bit boundary for the structure
*/
extra_struct_bytes =
ACPI_ROUND_UP_to_32_bITS(resource_length) -
resource_length;
ACPI_ROUND_UP_to_32_bITS(resource_length);
break;

case ACPI_RESOURCE_NAME_ADDRESS32:
Expand Down

0 comments on commit 35b73ce

Please sign in to comment.