Skip to content

Commit

Permalink
power_meter: acpi_device_class "power_meter_resource" too long
Browse files Browse the repository at this point in the history
acpi_device_class can only be 19 characters and a NULL terminator.

The current code has a buffer overflow in acpi_power_meter_add():
       strcpy(acpi_device_class(device), ACPI_POWER_METER_CLASS);

Signed-off-by: Dan Carpenter <error27@gmail.com>
Cc: Len Brown <lenb@kernel.org>
Cc: "Darrick J. Wong" <djwong@us.ibm.com>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Len Brown <len.brown@intel.com>
  • Loading branch information
Dan Carpenter authored and Len Brown committed May 6, 2010
1 parent a40770a commit 1826271
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/acpi/power_meter.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#define ACPI_POWER_METER_NAME "power_meter"
ACPI_MODULE_NAME(ACPI_POWER_METER_NAME);
#define ACPI_POWER_METER_DEVICE_NAME "Power Meter"
#define ACPI_POWER_METER_CLASS "power_meter_resource"
#define ACPI_POWER_METER_CLASS "pwr_meter_resource"

#define NUM_SENSORS 17

Expand Down

0 comments on commit 1826271

Please sign in to comment.