public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Rene Herman <rene.herman@keyaccess.nl>
Cc: Cyrill Gorcunov <gorcunov@gmail.com>,
	Andrew Morton <akpm@osdl.org>, Yinghai Lu <yhlu.kernel@gmail.com>,
	Linux Kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] x86: kill arch/x86/kernel/mpparse.c debugging printk.
Date: Mon, 11 Aug 2008 19:41:47 +0200	[thread overview]
Message-ID: <20080811174147.GO4524@elte.hu> (raw)
In-Reply-To: <48A074D1.4070803@keyaccess.nl>


* Rene Herman <rene.herman@keyaccess.nl> wrote:

> On 11-08-08 18:45, Cyrill Gorcunov wrote:
>
>> | From: Rene Herman <rene.herman@gmail.com>
>> | Date: Mon, 11 Aug 2008 17:35:41 +0200
>> | Subject: [PATCH] x86: make "apic" an early_param() on 32-bit
>
> [ ... ]
>
>> you turned it into early_param so now it's NULL injecting vulnerabled.
>> Could you please add checking for NULL str param?
>
> Ah, I was unaware of that difference, thank you. Ingo, can you replace  
> the previous incarnation with this one?

sure - but some other commits were queued already so i've applied the 
delta fix below.

	Ingo

-------------->
>From 48d97cb65e62a5f1122ac2cf1149800d4f4693e8 Mon Sep 17 00:00:00 2001
From: Rene Herman <rene.herman@keyaccess.nl>
Date: Mon, 11 Aug 2008 19:20:17 +0200
Subject: [PATCH] x86: make "apic" an early_param() on 32-bit, NULL check

Cyrill Gorcunov observed:

> you turned it into early_param so now it's NULL injecting vulnerabled.
> Could you please add checking for NULL str param?

fix that.

Also, change the name of 'str' into 'arg', to make it more apparent
that this is an optional argument that can be NULL, not a string
parameter that is empty when unset.

Reported-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 arch/x86/kernel/apic_32.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/arch/x86/kernel/apic_32.c b/arch/x86/kernel/apic_32.c
index f432d48..039a8d4 100644
--- a/arch/x86/kernel/apic_32.c
+++ b/arch/x86/kernel/apic_32.c
@@ -1720,12 +1720,16 @@ static int __init parse_lapic_timer_c2_ok(char *arg)
 }
 early_param("lapic_timer_c2_ok", parse_lapic_timer_c2_ok);
 
-static int __init apic_set_verbosity(char *str)
+static int __init apic_set_verbosity(char *arg)
 {
-	if (strcmp("debug", str) == 0)
+	if (!arg)
+		return -EINVAL;
+
+	if (strcmp(arg, "debug") == 0)
 		apic_verbosity = APIC_DEBUG;
-	else if (strcmp("verbose", str) == 0)
+	else if (strcmp(arg, "verbose") == 0)
 		apic_verbosity = APIC_VERBOSE;
+
 	return 0;
 }
 early_param("apic", apic_set_verbosity);

  reply	other threads:[~2008-08-11 17:42 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-08 16:43 [PATCH] x86: kill arch/x86/kernel/mpparse.c debugging printk Rene Herman
2008-08-11 12:20 ` Ingo Molnar
2008-08-11 15:44   ` Rene Herman
2008-08-11 15:45     ` Rene Herman
2008-08-11 16:45       ` Cyrill Gorcunov
2008-08-11 17:20         ` Rene Herman
2008-08-11 17:41           ` Ingo Molnar [this message]
2008-08-11 18:06             ` Rene Herman
2008-08-11 18:33               ` Ingo Molnar
2008-08-11 18:42                 ` Cyrill Gorcunov
2008-08-11 18:46                   ` Cyrill Gorcunov
2008-08-11 18:49                   ` Ingo Molnar
2008-08-11 19:01                     ` Cyrill Gorcunov
2008-08-11 18:54                 ` Rene Herman
2008-08-11 16:38     ` Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080811174147.GO4524@elte.hu \
    --to=mingo@elte.hu \
    --cc=akpm@osdl.org \
    --cc=gorcunov@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rene.herman@keyaccess.nl \
    --cc=yhlu.kernel@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox