]> git.karo-electronics.de Git - karo-tx-linux.git/commit
power_meter: acpi_device_class "power_meter_resource" too long
authorDan Carpenter <error27@gmail.com>
Tue, 27 Apr 2010 21:01:07 +0000 (14:01 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 12 May 2010 21:57:15 +0000 (14:57 -0700)
commitd62aa1407cc32750ed94c594b01f28b13d42f23d
tree4ae37fa698db438eaf974548cef9e8a0f27d57f2
parentf1b184b1a3a327df299fb1ffd3da1cceaa013efb
power_meter: acpi_device_class "power_meter_resource" too long

commit 18262714ca0fb65c290b8ea1807b2b02bb52d0e3 upstream.

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>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/acpi/power_meter.c