public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
From: Andi Kleen <andi@firstfloor.org>
To: linux-ia64@vger.kernel.org
Subject: Re: [PATCH] SN2: security hole in sn2_ptc_proc_write
Date: Sun, 22 Jun 2008 17:41:35 +0000	[thread overview]
Message-ID: <87r6apwenk.fsf@basil.nowhere.org> (raw)
In-Reply-To: <E1K9SIg-0005n6-Ea@eag09.americas.sgi.com>

Cliff Wickman <cpw@sgi.com> writes:
>
> Signed-off-by: Cliff Wickman <cpw@sgi.com>
> ---
>  arch/ia64/sn/kernel/sn2/sn2_smp.c |    2 ++
>  1 file changed, 2 insertions(+)
>
> Index: linux-2.6/arch/ia64/sn/kernel/sn2/sn2_smp.c
> =================================> --- linux-2.6.orig/arch/ia64/sn/kernel/sn2/sn2_smp.c
> +++ linux-2.6/arch/ia64/sn/kernel/sn2/sn2_smp.c
> @@ -512,6 +512,8 @@ static ssize_t sn2_ptc_proc_write(struct
>  	int cpu;
>  	char optstr[64];
>  
> +	if (count > 64)
> +		return -EINVAL;
>  	if (copy_from_user(optstr, user, count))
>  		return -EFAULT;
>  	optstr[count - 1] = '\0';


When someone passes 0 you get an buffer underflow? 

You need if (count < 0 || count > 64) me thinks.

-Andi

  reply	other threads:[~2008-06-22 17:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-19 22:08 [PATCH] SN2: security hole in sn2_ptc_proc_write Cliff Wickman
2008-06-22 17:41 ` Andi Kleen [this message]
2008-06-22 18:58 ` Bernhard Walle
2008-06-22 19:13 ` Petr Tesarik
2008-06-22 20:04 ` Andi Kleen

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=87r6apwenk.fsf@basil.nowhere.org \
    --to=andi@firstfloor.org \
    --cc=linux-ia64@vger.kernel.org \
    /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