Skip to contentSkip to conversation

acpi_pad: "processor_aggregator" name too long

PATCH Superseded Dan Carpenter 4 participants 7 messages Mar 19, 2010 – Apr 6, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 acpi_pad: "processor_aggregator" name too long

cpi_device_class can only be 19 characters and a NULL terminator.

With the current name we get a buffer overflow in acpi_pad_add()

        strcpy(acpi_device_class(device), ACPI_PROCESSOR_AGGREGATOR_CLASS);

---
Feel free to pick your own name if you don't like mine. :)

drivers/acpi/acpi_pad.c +1 -1
index 7e52295..2db89d9 100644
@@ -30,7 +30,7 @@
 #include <acpi/acpi_bus.h>
 #include <acpi/acpi_drivers.h>
 
-#define ACPI_PROCESSOR_AGGREGATOR_CLASS	"processor_aggregator"
+#define ACPI_PROCESSOR_AGGREGATOR_CLASS	"proc_aggregator"
 #define ACPI_PROCESSOR_AGGREGATOR_DEVICE_NAME "Processor Aggregator"
 #define ACPI_PROCESSOR_AGGREGATOR_NOTIFY 0x80
 static DEFINE_MUTEX(isolated_cpus_lock);
#1 lore raw
Quoted 15 lines · Dan Carpenter

cpi_device_class can only be 19 characters and a NULL terminator.

With the current name we get a buffer overflow in acpi_pad_add()

        strcpy(acpi_device_class(device), ACPI_PROCESSOR_AGGREGATOR_CLASS);

---
Feel free to pick your own name if you don't like mine. :)

drivers/acpi/acpi_pad.c +0 -0
index 7e52295..2db89d9 100644

drivers/acpi/acpi_pad.c line 36

Quoted 8 lines
drivers/acpi/acpi_pad.c +1 -1
@@ -30,7 +30,7 @@
 #include <acpi/acpi_bus.h>
 #include <acpi/acpi_drivers.h>
 
-#define ACPI_PROCESSOR_AGGREGATOR_CLASS	"processor_aggregator"
+#define ACPI_PROCESSOR_AGGREGATOR_CLASS	"proc_aggregator"
 #define ACPI_PROCESSOR_AGGREGATOR_DEVICE_NAME "Processor Aggregator"
 #define ACPI_PROCESSOR_AGGREGATOR_NOTIFY 0x80
 static DEFINE_MUTEX(isolated_cpus_lock);

Hi Dan,
IMHO this does not solve the core problem. acpi should use kstrncpy or better a pointer. The next guy that use "my_great_indentifier_is_longer_than_yours" will cause the same problem.
But this is something that the acpi group needs to answer (fast).

re,
wh

#2 lore raw
In reply to Dan Carpenter
Quoted 15 lines · Dan Carpenter

cpi_device_class can only be 19 characters and a NULL terminator.

With the current name we get a buffer overflow in acpi_pad_add()

        strcpy(acpi_device_class(device), ACPI_PROCESSOR_AGGREGATOR_CLASS);

---
Feel free to pick your own name if you don't like mine. :)

drivers/acpi/acpi_pad.c +0 -0
index 7e52295..2db89d9 100644

drivers/acpi/acpi_pad.c line 36

Quoted 8 lines
drivers/acpi/acpi_pad.c +1 -1
@@ -30,7 +30,7 @@
 #include <acpi/acpi_bus.h>
 #include <acpi/acpi_drivers.h>
 
-#define ACPI_PROCESSOR_AGGREGATOR_CLASS	"processor_aggregator"
+#define ACPI_PROCESSOR_AGGREGATOR_CLASS	"proc_aggregator"
 #define ACPI_PROCESSOR_AGGREGATOR_DEVICE_NAME "Processor Aggregator"
 #define ACPI_PROCESSOR_AGGREGATOR_NOTIFY 0x80
 static DEFINE_MUTEX(isolated_cpus_lock);

Hi Dan,
IMHO this does not solve the core problem. acpi should use kstrncpy or better a pointer. The next guy that use "my_great_indentifier_is_longer_than_yours" will cause the same problem.
But this is something that the acpi group needs to answer (fast).

re,
wh

#3 lore raw
In reply to Dan Carpenter
Quoted 15 lines · Dan Carpenter

cpi_device_class can only be 19 characters and a NULL terminator.

With the current name we get a buffer overflow in acpi_pad_add()

        strcpy(acpi_device_class(device), ACPI_PROCESSOR_AGGREGATOR_CLASS);

---
Feel free to pick your own name if you don't like mine. :)

drivers/acpi/acpi_pad.c +0 -0
index 7e52295..2db89d9 100644

drivers/acpi/acpi_pad.c line 33

Quoted 5 lines
drivers/acpi/acpi_pad.c +1 -1
@@ -30,7 +30,7 @@
 #include <acpi/acpi_bus.h>
 #include <acpi/acpi_drivers.h>
 
-#define ACPI_PROCESSOR_AGGREGATOR_CLASS	"processor_aggregator"
+#define ACPI_PROCESSOR_AGGREGATOR_CLASS	"proc_aggregator"

Sounds like /proc aggregator to me. "cpu_aggregator"?

Quoted 8 lines
drivers/acpi/acpi_pad.c +0 -1
 #define ACPI_PROCESSOR_AGGREGATOR_DEVICE_NAME "Processor Aggregator"
 #define ACPI_PROCESSOR_AGGREGATOR_NOTIFY 0x80
 static DEFINE_MUTEX(isolated_cpus_lock);
--

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#4 lore raw

PATCH v2 1/1 acpi_pad: "processor_aggregator" name too long

cpi_device_class can only be 19 characters and a NULL terminator.

With the current name we get a buffer overflow in acpi_pad_add()

	strcpy(acpi_device_class(device), ACPI_PROCESSOR_AGGREGATOR_CLASS);

---
V2: Thanks to Pavel Machek for coming up with the right name for this.

drivers/acpi/acpi_pad.c +1 -1
index 7e52295..790aaa1 100644
@@ -30,7 +30,7 @@
 #include <acpi/acpi_bus.h>
 #include <acpi/acpi_drivers.h>
 
-#define ACPI_PROCESSOR_AGGREGATOR_CLASS	"processor_aggregator"
+#define ACPI_PROCESSOR_AGGREGATOR_CLASS	"cpu_aggregator"
 #define ACPI_PROCESSOR_AGGREGATOR_DEVICE_NAME "Processor Aggregator"
 #define ACPI_PROCESSOR_AGGREGATOR_NOTIFY 0x80
 static DEFINE_MUTEX(isolated_cpus_lock);
#5 lore raw
Quoted 6 lines · Dan Carpenter

cpi_device_class can only be 19 characters and a NULL terminator.

With the current name we get a buffer overflow in acpi_pad_add()

	strcpy(acpi_device_class(device), ACPI_PROCESSOR_AGGREGATOR_CLASS);

ACK.

Quoted 16 lines

---
V2: Thanks to Pavel Machek for coming up with the right name for this.

drivers/acpi/acpi_pad.c +1 -1
index 7e52295..790aaa1 100644
@@ -30,7 +30,7 @@
 #include <acpi/acpi_bus.h>
 #include <acpi/acpi_drivers.h>
 
-#define ACPI_PROCESSOR_AGGREGATOR_CLASS	"processor_aggregator"
+#define ACPI_PROCESSOR_AGGREGATOR_CLASS	"cpu_aggregator"
 #define ACPI_PROCESSOR_AGGREGATOR_DEVICE_NAME "Processor Aggregator"
 #define ACPI_PROCESSOR_AGGREGATOR_NOTIFY 0x80
 static DEFINE_MUTEX(isolated_cpus_lock);
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#6 lore raw
In reply to Dan Carpenter
Quoted 14 lines · Dan Carpenter

cpi_device_class can only be 19 characters and a NULL terminator.

With the current name we get a buffer overflow in acpi_pad_add()

	strcpy(acpi_device_class(device), ACPI_PROCESSOR_AGGREGATOR_CLASS);

---
V2: Thanks to Pavel Machek for coming up with the right name for this.

drivers/acpi/acpi_pad.c +0 -0
index 7e52295..790aaa1 100644

drivers/acpi/acpi_pad.c line 36

Quoted 8 lines
drivers/acpi/acpi_pad.c +1 -1
@@ -30,7 +30,7 @@
 #include <acpi/acpi_bus.h>
 #include <acpi/acpi_drivers.h>
 
-#define ACPI_PROCESSOR_AGGREGATOR_CLASS	"processor_aggregator"
+#define ACPI_PROCESSOR_AGGREGATOR_CLASS	"cpu_aggregator"
 #define ACPI_PROCESSOR_AGGREGATOR_DEVICE_NAME "Processor Aggregator"
 #define ACPI_PROCESSOR_AGGREGATOR_NOTIFY 0x80
 static DEFINE_MUTEX(isolated_cpus_lock);

sorry for being later to reply. Better the name could be 'acpi_pad', which is what the spec called. cpu_aggregator looks like a invented name.

Thanks,
Shaohua