[PATCH] xt_recent: Fix buffer overflow

Stefan Bader stefan.bader at canonical.com
Fri Feb 19 08:56:51 UTC 2010


Tim Gardner wrote:
> If this looks right, then I'll send it upstream, and it should be a
> pre-stable patch.
> 
> rtg
> 
Hm, assuming another call to that function happens while the first one has not
reached the restraining statement later. But if its that critical, I'd even feel
uneasy about doing an index++-
Your code now leaves e->index set to 1 after the call. Which might upset other
code. What about

e->stamps[e->index] = jiffies;
e->index = (e->index + 1) % ip_pkt_list_tot;

Stefan




More information about the kernel-team mailing list