* [patch] acpi_pad: "processor_aggregator" name too long
@ 2010-03-19 11:48 Dan Carpenter
2010-03-19 12:25 ` walter harms
2010-03-25 14:27 ` Pavel Machek
0 siblings, 2 replies; 6+ messages in thread
From: Dan Carpenter @ 2010-03-19 11:48 UTC (permalink / raw)
To: Shaohua Li
Cc: Len Brown, Andrew Morton, Chen Gong, Peter Zijlstra, linux-acpi,
linux-kernel, kernel-janitors
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);
Signed-off-by: Dan Carpenter <error27@gmail.com>
---
Feel free to pick your own name if you don't like mine. :)
diff --git a/drivers/acpi/acpi_pad.c b/drivers/acpi/acpi_pad.c
index 7e52295..2db89d9 100644
--- a/drivers/acpi/acpi_pad.c
+++ b/drivers/acpi/acpi_pad.c
@@ -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);
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [patch] acpi_pad: "processor_aggregator" name too long
2010-03-19 11:48 [patch] acpi_pad: "processor_aggregator" name too long Dan Carpenter
@ 2010-03-19 12:25 ` walter harms
2010-03-25 14:27 ` Pavel Machek
1 sibling, 0 replies; 6+ messages in thread
From: walter harms @ 2010-03-19 12:25 UTC (permalink / raw)
To: Dan Carpenter, Shaohua Li, Len Brown, Andrew Morton, Chen Gong,
Peter Zijlstra, linux-acpi, linux-kernel, kernel-janitors
Dan Carpenter schrieb:
> 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);
>
> Signed-off-by: Dan Carpenter <error27@gmail.com>
> ---
> Feel free to pick your own name if you don't like mine. :)
>
>
> diff --git a/drivers/acpi/acpi_pad.c b/drivers/acpi/acpi_pad.c
> index 7e52295..2db89d9 100644
> --- a/drivers/acpi/acpi_pad.c
> +++ b/drivers/acpi/acpi_pad.c
> @@ -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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [patch] acpi_pad: "processor_aggregator" name too long
2010-03-19 11:48 [patch] acpi_pad: "processor_aggregator" name too long Dan Carpenter
2010-03-19 12:25 ` walter harms
@ 2010-03-25 14:27 ` Pavel Machek
2010-03-25 14:41 ` [patch v2] " Dan Carpenter
1 sibling, 1 reply; 6+ messages in thread
From: Pavel Machek @ 2010-03-25 14:27 UTC (permalink / raw)
To: Dan Carpenter, Shaohua Li, Len Brown, Andrew Morton, Chen Gong,
Peter Zijlstra, linux-acpi, linux-kernel, kernel-janitors
On Fri 2010-03-19 14:48:06, Dan Carpenter wrote:
> 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);
>
> Signed-off-by: Dan Carpenter <error27@gmail.com>
> ---
> Feel free to pick your own name if you don't like mine. :)
>
>
> diff --git a/drivers/acpi/acpi_pad.c b/drivers/acpi/acpi_pad.c
> index 7e52295..2db89d9 100644
> --- a/drivers/acpi/acpi_pad.c
> +++ b/drivers/acpi/acpi_pad.c
> @@ -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"?
> #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 majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
^ permalink raw reply [flat|nested] 6+ messages in thread
* [patch v2] acpi_pad: "processor_aggregator" name too long
2010-03-25 14:27 ` Pavel Machek
@ 2010-03-25 14:41 ` Dan Carpenter
2010-03-25 18:38 ` Pavel Machek
2010-04-06 1:21 ` Shaohua Li
0 siblings, 2 replies; 6+ messages in thread
From: Dan Carpenter @ 2010-03-25 14:41 UTC (permalink / raw)
To: Pavel Machek
Cc: Shaohua Li, Len Brown, Andrew Morton, Chen Gong, Peter Zijlstra,
linux-acpi, linux-kernel, kernel-janitors
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);
Signed-off-by: Dan Carpenter <error27@gmail.com>
---
V2: Thanks to Pavel Machek for coming up with the right name for this.
diff --git a/drivers/acpi/acpi_pad.c b/drivers/acpi/acpi_pad.c
index 7e52295..790aaa1 100644
--- a/drivers/acpi/acpi_pad.c
+++ b/drivers/acpi/acpi_pad.c
@@ -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);
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [patch v2] acpi_pad: "processor_aggregator" name too long
2010-03-25 14:41 ` [patch v2] " Dan Carpenter
@ 2010-03-25 18:38 ` Pavel Machek
2010-04-06 1:21 ` Shaohua Li
1 sibling, 0 replies; 6+ messages in thread
From: Pavel Machek @ 2010-03-25 18:38 UTC (permalink / raw)
To: Dan Carpenter, Shaohua Li, Len Brown, Andrew Morton, Chen Gong,
Peter Zijlstra, linux-acpi, linux-kernel, kernel-janitors
On Thu 2010-03-25 17:41:22, Dan Carpenter wrote:
> 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);
>
> Signed-off-by: Dan Carpenter <error27@gmail.com>
ACK.
> ---
> V2: Thanks to Pavel Machek for coming up with the right name for this.
>
> diff --git a/drivers/acpi/acpi_pad.c b/drivers/acpi/acpi_pad.c
> index 7e52295..790aaa1 100644
> --- a/drivers/acpi/acpi_pad.c
> +++ b/drivers/acpi/acpi_pad.c
> @@ -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);
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [patch v2] acpi_pad: "processor_aggregator" name too long
2010-03-25 14:41 ` [patch v2] " Dan Carpenter
2010-03-25 18:38 ` Pavel Machek
@ 2010-04-06 1:21 ` Shaohua Li
1 sibling, 0 replies; 6+ messages in thread
From: Shaohua Li @ 2010-04-06 1:21 UTC (permalink / raw)
To: Dan Carpenter, Pavel Machek, Len Brown, Andrew Morton, Chen Gong,
Peter Zijlstra, linux-acpi, linux-kernel, kernel-janitors
On Thu, Mar 25, 2010 at 10:41:22PM +0800, Dan Carpenter wrote:
> 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);
>
> Signed-off-by: Dan Carpenter <error27@gmail.com>
> ---
> V2: Thanks to Pavel Machek for coming up with the right name for this.
>
> diff --git a/drivers/acpi/acpi_pad.c b/drivers/acpi/acpi_pad.c
> index 7e52295..790aaa1 100644
> --- a/drivers/acpi/acpi_pad.c
> +++ b/drivers/acpi/acpi_pad.c
> @@ -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
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2010-04-06 1:21 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-19 11:48 [patch] acpi_pad: "processor_aggregator" name too long Dan Carpenter
2010-03-19 12:25 ` walter harms
2010-03-25 14:27 ` Pavel Machek
2010-03-25 14:41 ` [patch v2] " Dan Carpenter
2010-03-25 18:38 ` Pavel Machek
2010-04-06 1:21 ` Shaohua Li
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox