9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] netif stat bug
@ 2013-02-21 15:40 cinap_lenrek
  2013-02-21 15:48 ` erik quanstrom
  0 siblings, 1 reply; 2+ messages in thread
From: cinap_lenrek @ 2013-02-21 15:40 UTC (permalink / raw)
  To: 9fans

stating the "stats" and "ifstats" files in a ethernet tree
that has no active connections can cause the kernel to
go into endless loop or returns wrong stat data.

the bug is in port/netif.c in the netifgen() function:

-	if(t == N2ndqid || t == Ncloneqid || t == Naddrqid){
+	if(t == N2ndqid || t == Ncloneqid || t == Naddrqid || t == Nstatqid || t == Nifstatqid){

the problem is subtile and comes from the dual use
of the gen functions for generating tree enumeration
and stating.

maybe it would be a good idea to make devstat()
error out after a million iterations just instead
of looping forever to make this easier to diagnose?

this is the same class of bug that was discovered
in the devdraw device some time ago. it would be a
good idea to audit other devices for these kind of
bugs while being at it.

--
cinap



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-02-21 15:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-21 15:40 [9fans] netif stat bug cinap_lenrek
2013-02-21 15:48 ` erik quanstrom

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).