sbshc: acpi_device_class "smbus_host_controller" too long
authorDan Carpenter <error27@gmail.com>
Tue, 27 Apr 2010 21:06:05 +0000 (14:06 -0700)
committerLen Brown <len.brown@intel.com>
Thu, 6 May 2010 06:38:25 +0000 (02:38 -0400)
acpi_device_class can only be 19 characters and a NULL terminator.

With the current name we get a buffer overflow in acpi_smbus_hc_add()
when we do:
strcpy(acpi_device_class(device), ACPI_SMB_HC_CLASS);

Signed-off-by: Dan Carpenter <error27@gmail.com>
Cc: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Len Brown <len.brown@intel.com>
drivers/acpi/sbshc.c

index 36704b887ccf34cfbc1313f2dc5bb72060c84cb5..f8be23b6c12919f5d31a4cce63908b920f8f3c4b 100644 (file)
@@ -18,7 +18,7 @@
 
 #define PREFIX "ACPI: "
 
-#define ACPI_SMB_HC_CLASS      "smbus_host_controller"
+#define ACPI_SMB_HC_CLASS      "smbus_host_ctl"
 #define ACPI_SMB_HC_DEVICE_NAME        "ACPI SMBus HC"
 
 struct acpi_smb_hc {