diff options
author | roel kluin <roel.kluin@gmail.com> | 2009-07-29 19:46:59 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-07-30 16:27:29 -0400 |
commit | a3e8ee682003685b8b9c98c89340a42e48c3e813 (patch) | |
tree | 11d1c94289aa4c4aa668b3df6bd121d9eb76acdc /net | |
parent | 3d54015b750e5d5e950a1dcee2735387fd4b6e1a (diff) |
ipv4: ARP neigh procfs buffer overflow
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv4/arp.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c index c29d75d8f1b1..090e9991ac2a 100644 --- a/net/ipv4/arp.c +++ b/net/ipv4/arp.c | |||
@@ -1304,7 +1304,9 @@ static void arp_format_neigh_entry(struct seq_file *seq, | |||
1304 | hbuffer[k++] = hex_asc_lo(n->ha[j]); | 1304 | hbuffer[k++] = hex_asc_lo(n->ha[j]); |
1305 | hbuffer[k++] = ':'; | 1305 | hbuffer[k++] = ':'; |
1306 | } | 1306 | } |
1307 | hbuffer[--k] = 0; | 1307 | if (k != 0) |
1308 | --k; | ||
1309 | hbuffer[k] = 0; | ||
1308 | #if defined(CONFIG_AX25) || defined(CONFIG_AX25_MODULE) | 1310 | #if defined(CONFIG_AX25) || defined(CONFIG_AX25_MODULE) |
1309 | } | 1311 | } |
1310 | #endif | 1312 | #endif |