netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jarek Poplawski <jarkao2@gmail.com>
To: Roel Kluin <roel.kluin@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>,
	netdev@vger.kernel.org, Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] [IPV4]: Buffer overflow
Date: Thu, 30 Jul 2009 00:02:39 +0200	[thread overview]
Message-ID: <4A70C6FF.9060302@gmail.com> (raw)
In-Reply-To: <4A702A02.30509@gmail.com>

Roel Kluin wrote, On 07/29/2009 12:52 PM:

> If arp_format_neigh_entry() can be called with n->dev->addr_len == 0, then a
> write to hbuffer[-1] occurs.
> 
> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
> ---
> Found with Parfait, http://research.sun.com/projects/parfait/
> 
> It's not clear whether this can happen or not.
> 
> diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c
> index c29d75d..252336f 100644
> --- a/net/ipv4/arp.c
> +++ b/net/ipv4/arp.c
> @@ -1304,7 +1304,8 @@ static void arp_format_neigh_entry(struct seq_file *seq,
>  		hbuffer[k++] = hex_asc_lo(n->ha[j]);
>  		hbuffer[k++] = ':';
>  	}
> -	hbuffer[--k] = 0;
> +	if (k != 0)
> +		hbuffer[--k] = 0;


I guess for k == 0 we need hbuffer[0] = 0 too.

Jarek P.

>  #if defined(CONFIG_AX25) || defined(CONFIG_AX25_MODULE)
>  	}
>  #endif
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 



  reply	other threads:[~2009-07-29 22:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-29 10:52 [PATCH] [IPV4]: Buffer overflow Roel Kluin
2009-07-29 22:02 ` Jarek Poplawski [this message]
2009-07-30  9:46   ` Roel Kluin
2009-07-30 20:28     ` David Miller

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=4A70C6FF.9060302@gmail.com \
    --to=jarkao2@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=roel.kluin@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;
as well as URLs for NNTP newsgroup(s).