On Sunday, January 25, 2015 07:45:44 PM John Baldwin wrote: > Author: jhb > Date: Sun Jan 25 19:45:44 2015 > New Revision: 277709 > URL: https://svnweb.freebsd.org/changeset/base/277709 > > Log: > Use an sbuf to generate the output of the net.inet.tcp.hostcache.list > sysctl to avoid a possible buffer overflow if the cache grows while the > text is being generated. > > PR: 172675 > MFC after: 2 weeks
There is an additional bug still in that the 'cache_count' variable is not protected (it is modified while any one of a number of per-hashbucket locks are held). It should probably be changed to be updated via atomic ops, but this fix should prevent memory corruption and/or panics due to overflowing the buffer allocated for this. Of course, I really dislike sysctl nodes that output raw text. I would much rather this output a structure and rely on userland code to convert it to human-readable text. -- John Baldwin _______________________________________________ [email protected] mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "[email protected]"
