From owner-cvs-src-old@FreeBSD.ORG Sun Jan 23 13:00:41 2011 Return-Path: Delivered-To: cvs-src-old@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 696C31065782 for ; Sun, 23 Jan 2011 13:00:41 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 579788FC08 for ; Sun, 23 Jan 2011 13:00:41 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.4/8.14.4) with ESMTP id p0ND0fKp086157 for ; Sun, 23 Jan 2011 13:00:41 GMT (envelope-from lstewart@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.4/8.14.4/Submit) id p0ND0fqi086156 for cvs-src-old@freebsd.org; Sun, 23 Jan 2011 13:00:41 GMT (envelope-from lstewart@repoman.freebsd.org) Message-Id: <201101231300.p0ND0fqi086156@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to lstewart@repoman.freebsd.org using -f From: Lawrence Stewart Date: Sun, 23 Jan 2011 13:00:25 +0000 (UTC) To: cvs-src-old@freebsd.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/sys/netinet/cc cc.c X-BeenThere: cvs-src-old@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: **OBSOLETE** CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Jan 2011 13:00:41 -0000 lstewart 2011-01-23 13:00:25 UTC FreeBSD src repository Modified files: sys/netinet/cc cc.c Log: SVN rev 217748 on 2011-01-23 13:00:25Z by lstewart An sbuf configured with SBUF_AUTOEXTEND will call malloc with M_WAITOK when a write to the buffer causes it to overflow. We therefore can't hold the CC list rwlock over a call to sbuf_printf() for an sbuf configured with SBUF_AUTOEXTEND. Switch to a fixed length sbuf which should be of sufficient size except in the very unlikely event that the sysctl is being processed as one or more new algorithms are loaded. If that happens, we accept the race and may fail the sysctl gracefully if there is insufficient room to print the names of all the algorithms. This should address a WITNESS warning and the potential panic that would occur if the sbuf call to malloc did sleep whilst holding the CC list rwlock. Sponsored by: FreeBSD Foundation Reported by: Nick Hibma Reviewed by: bz MFC after: 3 weeks X-MFC with: r215166 Revision Changes Path 1.7 +21 -4 src/sys/netinet/cc/cc.c