All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ARM:plat-s3c24xx: for memcpy, reading more things out of boundary
@ 2013-01-24  5:27 ` Chen Gang
  0 siblings, 0 replies; 4+ messages in thread
From: Chen Gang @ 2013-01-24  5:27 UTC (permalink / raw)
  To: ben-linux, kgene.kim, Russell King - ARM Linux
  Cc: linux-arm-kernel, linux-samsung-soc


  the size is made by "plls_no + 1".
  so when copy from original buffer, need dec 1, or reading out of boundary.

additional info:
  plls_no is ARRARY_SIZE(plls).


Signed-off-by: Chen Gang <gang.chen@asianux.com>
---
 arch/arm/plat-s3c24xx/cpu-freq.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm/plat-s3c24xx/cpu-freq.c b/arch/arm/plat-s3c24xx/cpu-freq.c
index 4680799..df093b2 100644
--- a/arch/arm/plat-s3c24xx/cpu-freq.c
+++ b/arch/arm/plat-s3c24xx/cpu-freq.c
@@ -700,7 +700,8 @@ int __init s3c_plltab_register(struct cpufreq_frequency_table *plls,
 
 	vals = kmalloc(size, GFP_KERNEL);
 	if (vals) {
-		memcpy(vals, plls, size);
+		memcpy(vals, plls,
+			size - sizeof(struct cpufreq_frequency_table));
 		pll_reg = vals;
 
 		/* write a terminating entry, we don't store it in the
-- 
1.7.10.4

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

* [PATCH] ARM:plat-s3c24xx: for memcpy, reading more things out of boundary
@ 2013-01-24  5:27 ` Chen Gang
  0 siblings, 0 replies; 4+ messages in thread
From: Chen Gang @ 2013-01-24  5:27 UTC (permalink / raw)
  To: linux-arm-kernel


  the size is made by "plls_no + 1".
  so when copy from original buffer, need dec 1, or reading out of boundary.

additional info:
  plls_no is ARRARY_SIZE(plls).


Signed-off-by: Chen Gang <gang.chen@asianux.com>
---
 arch/arm/plat-s3c24xx/cpu-freq.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm/plat-s3c24xx/cpu-freq.c b/arch/arm/plat-s3c24xx/cpu-freq.c
index 4680799..df093b2 100644
--- a/arch/arm/plat-s3c24xx/cpu-freq.c
+++ b/arch/arm/plat-s3c24xx/cpu-freq.c
@@ -700,7 +700,8 @@ int __init s3c_plltab_register(struct cpufreq_frequency_table *plls,
 
 	vals = kmalloc(size, GFP_KERNEL);
 	if (vals) {
-		memcpy(vals, plls, size);
+		memcpy(vals, plls,
+			size - sizeof(struct cpufreq_frequency_table));
 		pll_reg = vals;
 
 		/* write a terminating entry, we don't store it in the
-- 
1.7.10.4

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

* Re: [PATCH] ARM:plat-s3c24xx: for memcpy, reading more things out of boundary
  2013-01-24  5:27 ` Chen Gang
@ 2013-02-17  3:57   ` Chen Gang
  -1 siblings, 0 replies; 4+ messages in thread
From: Chen Gang @ 2013-02-17  3:57 UTC (permalink / raw)
  To: ben-linux, kgene.kim, Russell King - ARM Linux
  Cc: linux-arm-kernel, linux-samsung-soc

Hello relative members:

  please give a glance for this patch, when you have time.

  thanks.

  :-)


gchen.


于 2013年01月24日 13:27, Chen Gang 写道:
> 
>   the size is made by "plls_no + 1".
>   so when copy from original buffer, need dec 1, or reading out of boundary.
> 
> additional info:
>   plls_no is ARRARY_SIZE(plls).
> 
> 
> Signed-off-by: Chen Gang <gang.chen@asianux.com>
> ---
>  arch/arm/plat-s3c24xx/cpu-freq.c |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/plat-s3c24xx/cpu-freq.c b/arch/arm/plat-s3c24xx/cpu-freq.c
> index 4680799..df093b2 100644
> --- a/arch/arm/plat-s3c24xx/cpu-freq.c
> +++ b/arch/arm/plat-s3c24xx/cpu-freq.c
> @@ -700,7 +700,8 @@ int __init s3c_plltab_register(struct cpufreq_frequency_table *plls,
>  
>  	vals = kmalloc(size, GFP_KERNEL);
>  	if (vals) {
> -		memcpy(vals, plls, size);
> +		memcpy(vals, plls,
> +			size - sizeof(struct cpufreq_frequency_table));
>  		pll_reg = vals;
>  
>  		/* write a terminating entry, we don't store it in the
> 


-- 
Chen Gang

Asianux Corporation

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

* [PATCH] ARM:plat-s3c24xx: for memcpy, reading more things out of boundary
@ 2013-02-17  3:57   ` Chen Gang
  0 siblings, 0 replies; 4+ messages in thread
From: Chen Gang @ 2013-02-17  3:57 UTC (permalink / raw)
  To: linux-arm-kernel

Hello relative members:

  please give a glance for this patch, when you have time.

  thanks.

  :-)


gchen.


? 2013?01?24? 13:27, Chen Gang ??:
> 
>   the size is made by "plls_no + 1".
>   so when copy from original buffer, need dec 1, or reading out of boundary.
> 
> additional info:
>   plls_no is ARRARY_SIZE(plls).
> 
> 
> Signed-off-by: Chen Gang <gang.chen@asianux.com>
> ---
>  arch/arm/plat-s3c24xx/cpu-freq.c |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/plat-s3c24xx/cpu-freq.c b/arch/arm/plat-s3c24xx/cpu-freq.c
> index 4680799..df093b2 100644
> --- a/arch/arm/plat-s3c24xx/cpu-freq.c
> +++ b/arch/arm/plat-s3c24xx/cpu-freq.c
> @@ -700,7 +700,8 @@ int __init s3c_plltab_register(struct cpufreq_frequency_table *plls,
>  
>  	vals = kmalloc(size, GFP_KERNEL);
>  	if (vals) {
> -		memcpy(vals, plls, size);
> +		memcpy(vals, plls,
> +			size - sizeof(struct cpufreq_frequency_table));
>  		pll_reg = vals;
>  
>  		/* write a terminating entry, we don't store it in the
> 


-- 
Chen Gang

Asianux Corporation

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

end of thread, other threads:[~2013-02-17  3:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-24  5:27 [PATCH] ARM:plat-s3c24xx: for memcpy, reading more things out of boundary Chen Gang
2013-01-24  5:27 ` Chen Gang
2013-02-17  3:57 ` Chen Gang
2013-02-17  3:57   ` Chen Gang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.