From owner-svn-src-head@FreeBSD.ORG Sun Jan 25 20:45:35 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 38F0C695; Sun, 25 Jan 2015 20:45:35 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1184E74E; Sun, 25 Jan 2015 20:45:35 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-70-85-31.nwrknj.fios.verizon.net [173.70.85.31]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 1771BB9B1; Sun, 25 Jan 2015 15:45:34 -0500 (EST) From: John Baldwin To: src-committers@freebsd.org Subject: Re: svn commit: r277709 - head/sys/netinet Date: Sun, 25 Jan 2015 14:49:42 -0500 Message-ID: <4934698.3R1IGXPu9N@ralph.baldwin.cx> User-Agent: KMail/4.14.2 (FreeBSD/10.1-STABLE; KDE/4.14.2; amd64; ; ) In-Reply-To: <201501251945.t0PJjikt046431@svn.freebsd.org> References: <201501251945.t0PJjikt046431@svn.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Sun, 25 Jan 2015 15:45:34 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Jan 2015 20:45:35 -0000 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