Bug #948

netstat patch

Added by Jan Schaumann almost 4 years ago. Updated almost 3 years ago.

Status:New Start date:
Priority:Normal Due date:
Assignee:- % Done:

0%

Category:-
Target version:-

Description

Hello,

There is a bug in netstat(1) that can cause it to spin out of control
and eat up all CPU. This has been reported in FreeBSD and NetBSD and
I've also seen reports of the same problem in Mac OS X, so it stands to
reason this might affect DragonFlyBSD as well.

John Baldwin fixed this in FreeBSD:
http://www.freebsd.org/cgi/cvsweb.cgi/src/usr.bin/netstat/route.c.diff?r1=1.87;r2=1.88

"Make netstat -rn more resilient to having the routing table change out
from
under it while running. Note that this is still not perfect:
- Try to do something intelligent if kvm_read() fails to read a routing
table structure such as an rtentry, radix_node, or ifnet.
- Don't follow left and right node pointers in radix_nodes unless
RNF_ACTIVE is set in rn_flags. This avoids walking through freed
radix_nodes."

The NetBSD error report is at
http://www.netbsd.org/cgi-bin/query-pr-single.pl?number=36195

-Jan


Related todos

History

Updated by Gary Stanley almost 4 years ago

Does this bug effect you, or have you encountered this bug on Dfly?

Updated by Jan Schaumann almost 4 years ago

Gary Stanley <bugs@lists.dragonflybsd.org> wrote:

I don't use DragonFlyBSD, so it has not affected me. I just filed the
bug based on the assumption that all BSDs were affected. If you
conclude that Dfly is not affected, feel free to close this.

-Jan

Updated by Sepherosa Ziehau almost 3 years ago

Grab. The patch looks good.

Also available in: Atom PDF