From owner-svn-src-head@FreeBSD.ORG Fri Aug 19 08:29:11 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2ACCE106564A; Fri, 19 Aug 2011 08:29:11 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1A3E28FC0A; Fri, 19 Aug 2011 08:29:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7J8TAd5094408; Fri, 19 Aug 2011 08:29:10 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7J8TAVd094406; Fri, 19 Aug 2011 08:29:10 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201108190829.p7J8TAVd094406@svn.freebsd.org> From: Robert Watson Date: Fri, 19 Aug 2011 08:29:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224999 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 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: Fri, 19 Aug 2011 08:29:11 -0000 Author: rwatson Date: Fri Aug 19 08:29:10 2011 New Revision: 224999 URL: http://svn.freebsd.org/changeset/base/224999 Log: r222015 introduced a new assertion that the size of a fixed-length sbuf buffer is greater than 1. This triggered panics in at least one spot in the kernel (the MAC Framework) which passes non-negative, rather than >1 buffer sizes based on the size of a user buffer passed into a system call. While 0-size buffers aren't particularly useful, they also aren't strictly incorrect, so loosen the assertion. Discussed with: phk (fears I might be EDOOFUS but willing to go along) Spotted by: pho + stress2 Approved by: re (kib) Modified: head/sys/kern/subr_sbuf.c Modified: head/sys/kern/subr_sbuf.c ============================================================================== --- head/sys/kern/subr_sbuf.c Fri Aug 19 07:21:19 2011 (r224998) +++ head/sys/kern/subr_sbuf.c Fri Aug 19 08:29:10 2011 (r224999) @@ -184,7 +184,7 @@ sbuf_newbuf(struct sbuf *s, char *buf, i s->s_buf = buf; if ((s->s_flags & SBUF_AUTOEXTEND) == 0) { - KASSERT(s->s_size > 1, + KASSERT(s->s_size >= 0, ("attempt to create a too small sbuf")); }