linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH]: ACPI: Change the array size from 5 to 8 for acpi_bus_id
@ 2009-05-21  8:25 yakui_zhao
  2009-05-21 18:26 ` Len Brown
  2009-05-27  3:55 ` Len Brown
  0 siblings, 2 replies; 5+ messages in thread
From: yakui_zhao @ 2009-05-21  8:25 UTC (permalink / raw)
  To: lenb; +Cc: linux-acpi

From: Zhao Yakui <yaui.zhao@intel.com>

In fact the following three bytes can't be used when the following data
type is unsigned long or unsigned long long.

Change the array size from 5 to 8 for the acpi_bus_id.

Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
---
 include/acpi/acpi_bus.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-2.6/include/acpi/acpi_bus.h
===================================================================
--- linux-2.6.orig/include/acpi/acpi_bus.h	2009-04-20 09:13:42.000000000 +0800
+++ linux-2.6/include/acpi/acpi_bus.h	2009-05-21 16:18:25.000000000 +0800
@@ -168,7 +168,7 @@
 
 /* Plug and Play */
 
-typedef char acpi_bus_id[5];
+typedef char acpi_bus_id[8];
 typedef unsigned long acpi_bus_address;
 typedef char acpi_hardware_id[15];
 typedef char acpi_unique_id[9];



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH]: ACPI: Change the array size from 5 to 8 for acpi_bus_id
  2009-05-21  8:25 [PATCH]: ACPI: Change the array size from 5 to 8 for acpi_bus_id yakui_zhao
@ 2009-05-21 18:26 ` Len Brown
  2009-05-21 19:07   ` Matthew Garrett
  2009-05-27  3:55 ` Len Brown
  1 sibling, 1 reply; 5+ messages in thread
From: Len Brown @ 2009-05-21 18:26 UTC (permalink / raw)
  To: yakui_zhao; +Cc: linux-acpi

what bad things happen if this patch is not applied --
do some of those strcpy()'s overflow?

what good things happen if it is applied?

are you just eating up the padding because it is there?

thanks,
Len Brown, Intel Open Source Technology Center

On Thu, 21 May 2009, yakui_zhao wrote:

> From: Zhao Yakui <yaui.zhao@intel.com>
> 
> In fact the following three bytes can't be used when the following data
> type is unsigned long or unsigned long long.
> 
> Change the array size from 5 to 8 for the acpi_bus_id.
> 
> Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
> ---
>  include/acpi/acpi_bus.h |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> Index: linux-2.6/include/acpi/acpi_bus.h
> ===================================================================
> --- linux-2.6.orig/include/acpi/acpi_bus.h	2009-04-20 09:13:42.000000000 +0800
> +++ linux-2.6/include/acpi/acpi_bus.h	2009-05-21 16:18:25.000000000 +0800
> @@ -168,7 +168,7 @@
>  
>  /* Plug and Play */
>  
> -typedef char acpi_bus_id[5];
> +typedef char acpi_bus_id[8];
>  typedef unsigned long acpi_bus_address;
>  typedef char acpi_hardware_id[15];
>  typedef char acpi_unique_id[9];
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH]: ACPI: Change the array size from 5 to 8 for acpi_bus_id
  2009-05-21 18:26 ` Len Brown
@ 2009-05-21 19:07   ` Matthew Garrett
  2009-05-22  2:08     ` yakui_zhao
  0 siblings, 1 reply; 5+ messages in thread
From: Matthew Garrett @ 2009-05-21 19:07 UTC (permalink / raw)
  To: Len Brown; +Cc: yakui_zhao, linux-acpi

On Thu, May 21, 2009 at 02:26:32PM -0400, Len Brown wrote:
> what bad things happen if this patch is not applied --
> do some of those strcpy()'s overflow?

Looks like there'd be issues with the change to the CPU name on systems 
with lots of CPUs in ACPI.

-- 
Matthew Garrett | mjg59@srcf.ucam.org

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH]: ACPI: Change the array size from 5 to 8 for acpi_bus_id
  2009-05-21 19:07   ` Matthew Garrett
@ 2009-05-22  2:08     ` yakui_zhao
  0 siblings, 0 replies; 5+ messages in thread
From: yakui_zhao @ 2009-05-22  2:08 UTC (permalink / raw)
  To: Matthew Garrett; +Cc: Len Brown, linux-acpi@vger.kernel.org

On Fri, 2009-05-22 at 03:07 +0800, Matthew Garrett wrote:
> On Thu, May 21, 2009 at 02:26:32PM -0400, Len Brown wrote:
> > what bad things happen if this patch is not applied --
> > do some of those strcpy()'s overflow?
> 
> Looks like there'd be issues with the change to the CPU name on systems 
> with lots of CPUs in ACPI.
What Matthew said is right.

On some boxes I want to change the ACPI processor bus id. And the new
bus id is generated as the following format:
	sprintf(acpi_device_bid(device), "CPU%X", cpu_id)
    
If the CPU number exceeds 255, the string length will exceed the array
size of acpi_bus_id.

Although it doesn't matter, it still looks not very good.  The reason
that it still can work is that the following three bytes are not used.

So I change the array size of acpi_bus_id from 5 to 8.

Thanks.    
> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH]: ACPI: Change the array size from 5 to 8 for acpi_bus_id
  2009-05-21  8:25 [PATCH]: ACPI: Change the array size from 5 to 8 for acpi_bus_id yakui_zhao
  2009-05-21 18:26 ` Len Brown
@ 2009-05-27  3:55 ` Len Brown
  1 sibling, 0 replies; 5+ messages in thread
From: Len Brown @ 2009-05-27  3:55 UTC (permalink / raw)
  To: yakui_zhao; +Cc: linux-acpi

applied

thanks,
Len Brown, Intel Open Source Technology Center


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-05-27  3:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-21  8:25 [PATCH]: ACPI: Change the array size from 5 to 8 for acpi_bus_id yakui_zhao
2009-05-21 18:26 ` Len Brown
2009-05-21 19:07   ` Matthew Garrett
2009-05-22  2:08     ` yakui_zhao
2009-05-27  3:55 ` Len Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).