Messages in this thread | | | Date | Mon, 15 May 2006 22:45:00 +0200 | From | Patrick McHardy <> | Subject | Re: [PATCH] fix mem-leak in netfilter |
| |
Stephen Frost wrote: > * Patrick McHardy (kaber@trash.net) wrote: > >>This is the updated patch, it changes the eviction strategy >>to LRU and fixes a bug related to TTL handling, the TTL stored >>in the entry should only be overwritten if the IPT_RECENT_TTL >>flag is set. > > > This looks like least-recently-added as opposed to least-recently-used > (or, really, least-recently-updated). Not sure how you move an entry in > the lru list (perhaps just delete/add?) but I'm pretty sure > recent_entry_update() needs to be modified to move the updated entry to > the end of the list for correct operation.
Good point, I'll fix the patch.
> You also don't appear to check if 't' (the table following the > recent_table_lookup() call) is valid in the 'match' (around > line 191). recent_entry_lookup() doesn't check that either. It seems > like you should be guarenteed to always get a table back but it might be > prudent to check anyway.
It is guaranteed that we will get a valid table back, otherwise there must be a serious bug somewhere else, in which case I prefer to crash instead of hiding it away. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |