linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Fix bug in end absolute address in drivers/mtd/devices/slram.c
@ 2012-09-20 13:48 Jiri Engelthaler
  2012-09-20 15:55 ` Jiri Kosina
  0 siblings, 1 reply; 3+ messages in thread
From: Jiri Engelthaler @ 2012-09-20 13:48 UTC (permalink / raw)
  To: linux-kernel

Hello.
  I found a bug in parsing end absolute address in
drivers/mtd/devices/slram.c. There is checking for startaddress <
endaddress and endaddress subtracted by startaddress before check. The
bug is there from commit 3afd522de8d8ec446efe957b86e4f63e3dd8ce9d Mon,
19 Jan 2009 01:24:21 +0000

Here is the patch

Signed-off-by: Jiri Engelthaler <engycz@gmail.com>

--- linux-3.2.28/drivers/mtd/devices/slram.c	2012-08-19 19:15:38.000000000 +0200
+++ linux-3.2.28.mod/drivers/mtd/devices/slram.c	2012-09-19
18:29:28.012740703 +0200
@@ -266,7 +266,7 @@ static int parse_cmdline(char *devname,

 	if (*(szlength) != '+') {
 		devlength = simple_strtoul(szlength, &buffer, 0);
-		devlength = handle_unit(devlength, buffer) - devstart;
+		devlength = handle_unit(devlength, buffer);
 		if (devlength < devstart)
 			goto err_out;

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

* Re: Fix bug in end absolute address in drivers/mtd/devices/slram.c
  2012-09-20 13:48 Fix bug in end absolute address in drivers/mtd/devices/slram.c Jiri Engelthaler
@ 2012-09-20 15:55 ` Jiri Kosina
  2012-09-22  9:14   ` Roel Kluin
  0 siblings, 1 reply; 3+ messages in thread
From: Jiri Kosina @ 2012-09-20 15:55 UTC (permalink / raw)
  To: Jiri Engelthaler; +Cc: linux-kernel, Roel Kluin, David Woodhouse

On Thu, 20 Sep 2012, Jiri Engelthaler wrote:

> Hello.
>   I found a bug in parsing end absolute address in
> drivers/mtd/devices/slram.c. There is checking for startaddress <
> endaddress and endaddress subtracted by startaddress before check. The
> bug is there from commit 3afd522de8d8ec446efe957b86e4f63e3dd8ce9d Mon,
> 19 Jan 2009 01:24:21 +0000
> 
> Here is the patch
> 
> Signed-off-by: Jiri Engelthaler <engycz@gmail.com>
> 
> --- linux-3.2.28/drivers/mtd/devices/slram.c	2012-08-19 19:15:38.000000000 +0200
> +++ linux-3.2.28.mod/drivers/mtd/devices/slram.c	2012-09-19
> 18:29:28.012740703 +0200
> @@ -266,7 +266,7 @@ static int parse_cmdline(char *devname,
> 
>  	if (*(szlength) != '+') {
>  		devlength = simple_strtoul(szlength, &buffer, 0);
> -		devlength = handle_unit(devlength, buffer) - devstart;
> +		devlength = handle_unit(devlength, buffer);
>  		if (devlength < devstart)
>  			goto err_out;

... adding the suspects to CC so that they are aware of this.

-- 
Jiri Kosina
SUSE Labs


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

* Re: Fix bug in end absolute address in drivers/mtd/devices/slram.c
  2012-09-20 15:55 ` Jiri Kosina
@ 2012-09-22  9:14   ` Roel Kluin
  0 siblings, 0 replies; 3+ messages in thread
From: Roel Kluin @ 2012-09-22  9:14 UTC (permalink / raw)
  To: Jiri Kosina; +Cc: Jiri Engelthaler, linux-kernel, David Woodhouse

On Thu, Sep 20, 2012 at 5:55 PM, Jiri Kosina <jkosina@suse.cz> wrote:
> On Thu, 20 Sep 2012, Jiri Engelthaler wrote:
>
>> Hello.
>>   I found a bug in parsing end absolute address in
>> drivers/mtd/devices/slram.c. There is checking for startaddress <
>> endaddress and endaddress subtracted by startaddress before check. The
>> bug is there from commit 3afd522de8d8ec446efe957b86e4f63e3dd8ce9d Mon,
>> 19 Jan 2009 01:24:21 +0000
>>
>> Here is the patch
>>
>> Signed-off-by: Jiri Engelthaler <engycz@gmail.com>
>>
>> --- linux-3.2.28/drivers/mtd/devices/slram.c  2012-08-19 19:15:38.000000000 +0200
>> +++ linux-3.2.28.mod/drivers/mtd/devices/slram.c      2012-09-19
>> 18:29:28.012740703 +0200
>> @@ -266,7 +266,7 @@ static int parse_cmdline(char *devname,
>>
>>       if (*(szlength) != '+') {
>>               devlength = simple_strtoul(szlength, &buffer, 0);
>> -             devlength = handle_unit(devlength, buffer) - devstart;
>> +             devlength = handle_unit(devlength, buffer);
>>               if (devlength < devstart)
>>                       goto err_out;
>
> ... adding the suspects to CC so that they are aware of this.

Yes, that's what it should have been. FWIW,

Acked-by: Roel Kluin <roel.kluin@gmail.com>

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

end of thread, other threads:[~2012-09-22  9:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-20 13:48 Fix bug in end absolute address in drivers/mtd/devices/slram.c Jiri Engelthaler
2012-09-20 15:55 ` Jiri Kosina
2012-09-22  9:14   ` Roel Kluin

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).