: Buffer overflow
Subsystems (3)
PATCH 1/1 : Buffer overflow
If arp_format_neigh_entry() can be called with n->dev->addr_len == 0, then a write to hbuffer[-1] occurs.
---
Found with Parfait, http://research.sun.com/projects/parfait/
It's not clear whether this can happen or not.
net/ipv4/arp.c +2 -1
@@ -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 ;#if defined(CONFIG_AX25 ) || defined(CONFIG_AX25_MODULE ) }#endif
Roel Kluin wrote, On 07/29/2009 12:52 PM:
Quoted 14 lines
If
arp_format_neigh_entry()can be called withn->dev->addr_len== 0, then a write to hbuffer[-1] occurs.Signed-off-by Roel Kluin <[email protected]>---
Found with Parfait, http://research.sun.com/projects/parfait/It's not clear whether this can happen or not.
net/ipv4/arp.c +0
-0
net/ipv4/arp.c static void arp_format_neigh_entry(struct seq_file *seq, · line 1308
Quoted 6 lines
net/ipv4/arp.c +2
-1@@ -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.
Quoted 8 lines
net/ipv4/arp.c +0
-1#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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
If arp_format_neigh_entry() can be called with n->dev->addr_len == 0, then a write to hbuffer[-1] occurs.
---
Op 30-07-09 00:02, Jarek Poplawski schreef:
Quoted 10 lines
Roel Kluin wrote, On 07/29/2009 12:52 PM:
Review
Quoted 3 lines
(quoted diff) +2
-1- hbuffer[--k] = 0; + if (k != 0) + hbuffer[--k] = 0;I guess for k == 0 we need hbuffer[0] = 0 too.
Jarek P.
Thanks, updated patch below.
net/ipv4/arp.c +3 -1
@@ -1304,7 +1304,9 @@ 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 ) + --k; + hbuffer[k] =0 ;#if defined(CONFIG_AX25 ) || defined(CONFIG_AX25_MODULE ) }#endif
From: Roel Kluin <[email protected]>
Date: Thu, 30 Jul 2009 11:46:59 +0200
Quoted 4 lines
If
arp_format_neigh_entry()can be called withn->dev->addr_len== 0, then a write to hbuffer[-1] occurs.Signed-off-by Roel Kluin <[email protected]>
Applied.