Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Linux: Kernel

[patch 1/5] x86: ACPI - add checking for NULL early param

 

 

Linux kernel RSS feed   Index | Next | Previous | View Threaded


gorcunov at gmail

Jul 5, 2008, 4:53 AM

Post #1 of 3 (238 views)
Permalink
[patch 1/5] x86: ACPI - add checking for NULL early param

Signed-off-by: Cyrill Gorcunov <gorcunov [at] gmail>
---

Index: linux-2.6.git/drivers/acpi/tables.c
====================================================================
--- linux-2.6.git.orig/drivers/acpi/tables.c 2008-01-21 23:14:47.000000000 +0300
+++ linux-2.6.git/drivers/acpi/tables.c 2008-07-05 12:24:16.000000000 +0400
@@ -300,6 +300,8 @@ int __init acpi_table_init(void)

static int __init acpi_parse_apic_instance(char *str)
{
+ if (!str)
+ return -EINVAL;

acpi_apic_instance = simple_strtoul(str, NULL, 0);


--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


akpm at linux-foundation

Jul 22, 2008, 2:53 AM

Post #2 of 3 (197 views)
Permalink
Re: [patch 1/5] x86: ACPI - add checking for NULL early param [In reply to]

On Sat, 05 Jul 2008 15:53:35 +0400 Cyrill Gorcunov <gorcunov [at] gmail> wrote:

> Signed-off-by: Cyrill Gorcunov <gorcunov [at] gmail>
> ---
>
> Index: linux-2.6.git/drivers/acpi/tables.c
> ====================================================================
> --- linux-2.6.git.orig/drivers/acpi/tables.c 2008-01-21 23:14:47.000000000 +0300
> +++ linux-2.6.git/drivers/acpi/tables.c 2008-07-05 12:24:16.000000000 +0400
> @@ -300,6 +300,8 @@ int __init acpi_table_init(void)
>
> static int __init acpi_parse_apic_instance(char *str)
> {
> + if (!str)
> + return -EINVAL;
>
> acpi_apic_instance = simple_strtoul(str, NULL, 0);
>

Could you please explain this patch?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


gorcunov at gmail

Jul 22, 2008, 3:19 AM

Post #3 of 3 (199 views)
Permalink
Re: [patch 1/5] x86: ACPI - add checking for NULL early param [In reply to]

[Andrew Morton - Tue, Jul 22, 2008 at 02:53:32AM -0700]
| On Sat, 05 Jul 2008 15:53:35 +0400 Cyrill Gorcunov <gorcunov [at] gmail> wrote:
|
| > Signed-off-by: Cyrill Gorcunov <gorcunov [at] gmail>
| > ---
| >
| > Index: linux-2.6.git/drivers/acpi/tables.c
| > ====================================================================
| > --- linux-2.6.git.orig/drivers/acpi/tables.c 2008-01-21 23:14:47.000000000 +0300
| > +++ linux-2.6.git/drivers/acpi/tables.c 2008-07-05 12:24:16.000000000 +0400
| > @@ -300,6 +300,8 @@ int __init acpi_table_init(void)
| >
| > static int __init acpi_parse_apic_instance(char *str)
| > {
| > + if (!str)
| > + return -EINVAL;
| >
| > acpi_apic_instance = simple_strtoul(str, NULL, 0);
| >
|
| Could you please explain this patch?
|

we could get NULL deref here - if you start kernel as

qemu-system-x86_64 -kernel arch/x86/boot/bzImage -append "root=/dev/sda acpi_apic_instance" ../images/root-j

so user was not carried about correct boot option and the kernel respond by
hang - which is not good I think. Actually - by the patch we easy protect
ourself from user-madness :)

- Cyrill -
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

Linux kernel RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.