| Summary: | 4.x IPFW2 kernel memory leak (IPFW2+rote flaps+verrevpath) | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Base System | Reporter: | Dmitry Morozovsky <marck> | ||||
| Component: | kern | Assignee: | freebsd-ipfw (Nobody) <ipfw> | ||||
| Status: | Closed FIXED | ||||||
| Severity: | Affects Only Me | CC: | oleg | ||||
| Priority: | Normal | ||||||
| Version: | Unspecified | ||||||
| Hardware: | Any | ||||||
| OS: | Any | ||||||
| Attachments: |
|
||||||
|
Description
Dmitry Morozovsky
2004-03-16 16:30:24 UTC
Forwarding misfiled message to audit-trail: Sincerely, D.Marck [DM5020, MCK-RIPE, DM3-RIPN] ------------------------------------------------------------------------ *** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck@rinet.ru *** ------------------------------------------------------------------------ ---------- Forwarded message ---------- Date: Wed, 17 Mar 2004 17:16:13 +0300 (MSK) From: Oleg Bulyzhin <oleg@rinet.ru> To: Dmitry Morozovsky <marck@rinet.ru> Cc: FreeBSD-gnats-submit@freebsd.org Subject: Re: 4.x IPFW2 kernel memory leak (IPFW2+rote flaps+verrevpath) In order to reproduce problem do the following: ifconfig fxp0 10.0.0.1/24 ipfw add 1 count verrevpath in while (true); do ping -c 2 -i 0.01 -S 10.0.0.1 localhost>/dev/null; ping -c 2 -i 0.01 -S 127.0.0.1 localhost>/dev/null; route delete 10.0.0.1>/dev/null;netstat -rs|tail -1;vmstat -m|grep routetbl|tail -1; done and look at numbers. If you run this script long enough (depends on your kernel memory size) you will get panic like this: panic: kmem_malloc(4096): kmem_map too small: 33554432 total allocated This happens due to verify_rev_path() calls rtalloc_ign() (for not cached routes) which increments rt_refcnt for corresponding rtentry structure. This lead to always 'held' routes which cannot be released by rtfree() (due to their rt_refcnt will never hit zero) P.S. this bug is remotely exploitable (at least if attacker is in your LAN). -- Oleg. ================================================================ === Oleg Bulyzhin -- OBUL-RIPN -- OBUL-RIPE -- oleg@rinet.ru === ================================================================ Responsible Changed From-To: freebsd-bugs->ipfw Assign to ipfw mailing list State Changed From-To: open->closed Andre has fixed this bug in rev. 1.6.2.21 sys/netinet/ip_fw2.c. Thanks for the report. |