acpi_pad: "processor_aggregator" name too long
Subsystems (2)
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
@@ -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 0x80static DEFINE_MUTEX (isolated_cpus_lock);
Quoted 15 lines · Dan Carpenter
cpi_device_classcan 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);Signed-off-by Dan Carpenter <[email protected]>---
Feel free to pick your own name if you don't like mine. :)drivers/acpi/acpi_pad.c +0
-0
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 0x80static 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
Quoted 15 lines · Dan Carpenter
cpi_device_classcan 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);Signed-off-by Dan Carpenter <[email protected]>---
Feel free to pick your own name if you don't like mine. :)drivers/acpi/acpi_pad.c +0
-0
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 0x80static 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
Quoted 15 lines · Dan Carpenter
cpi_device_classcan 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);Signed-off-by Dan Carpenter <[email protected]>---
Feel free to pick your own name if you don't like mine. :)drivers/acpi/acpi_pad.c +0
-0
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 0x80static 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
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
@@ -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 0x80static DEFINE_MUTEX (isolated_cpus_lock);
Quoted 6 lines · Dan Carpenter
cpi_device_classcan 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);Signed-off-by Dan Carpenter <[email protected]>
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@@ -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 0x80static 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
Quoted 14 lines · Dan Carpenter
cpi_device_classcan 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);Signed-off-by Dan Carpenter <[email protected]>---
V2: Thanks to Pavel Machek for coming up with the right name for this.drivers/acpi/acpi_pad.c +0
-0
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 0x80static 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