public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] sbshc: acpi_device_class "smbus_host_controller" too long
@ 2010-03-19 11:44 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2010-03-19 11:44 UTC (permalink / raw)
  To: Alexey Starikovskiy; +Cc: Len Brown, linux-acpi, linux-kernel, kernel-janitors

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>

diff --git a/drivers/acpi/sbshc.c b/drivers/acpi/sbshc.c
index fd09229..1fbf073 100644
--- a/drivers/acpi/sbshc.c
+++ b/drivers/acpi/sbshc.c
@@ -17,7 +17,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 {

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2010-03-19 11:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-19 11:44 [patch] sbshc: acpi_device_class "smbus_host_controller" too long Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox