netfilter: xt_recent: fix buffer overflow
authorTim Gardner <tim.gardner@canonical.com>
Tue, 23 Feb 2010 13:55:21 +0000 (14:55 +0100)
committerPatrick McHardy <kaber@trash.net>
Tue, 23 Feb 2010 13:55:21 +0000 (14:55 +0100)
commit359018948fd56476e7b27d5843d5761bc8dc003e
treeb82c724797d76d29143c6b267bd006f40466f9c3
parentf1e19f04cbcf8199a07967c8cc5abe937b03b49f
netfilter: xt_recent: fix buffer overflow

e->index overflows e->stamps[] every ip_pkt_list_tot packets.

Consider the case when ip_pkt_list_tot==1; the first packet received is stored
in e->stamps[0] and e->index is initialized to 1. The next received packet
timestamp is then stored at e->stamps[1] in recent_entry_update(),
a buffer overflow because the maximum e->stamps[] index is 0.

Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Cc: stable@kernel.org
Signed-off-by: Patrick McHardy <kaber@trash.net>
net/netfilter/xt_recent.c