Date: Sun, 25 Jan 2015 14:49:42 -0500 From: John Baldwin <jhb@freebsd.org> To: src-committers@freebsd.org Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r277709 - head/sys/netinet Message-ID: <4934698.3R1IGXPu9N@ralph.baldwin.cx> In-Reply-To: <201501251945.t0PJjikt046431@svn.freebsd.org> References: <201501251945.t0PJjikt046431@svn.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4934698.3R1IGXPu9N>