From owner-svn-src-head@freebsd.org Mon Oct 9 18:19:07 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E9B0E382A5; Mon, 9 Oct 2017 18:19:07 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6E32C752BA; Mon, 9 Oct 2017 18:19:07 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v99IJ6F8009918; Mon, 9 Oct 2017 18:19:06 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v99IJ6oB009917; Mon, 9 Oct 2017 18:19:06 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201710091819.v99IJ6oB009917@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Mon, 9 Oct 2017 18:19:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324444 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 324444 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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: Mon, 09 Oct 2017 18:19:07 -0000 Author: alc Date: Mon Oct 9 18:19:06 2017 New Revision: 324444 URL: https://svnweb.freebsd.org/changeset/base/324444 Log: The recent change to initialization of blists (r324420) relied on '-1' appearing only where the code explicitly set it, but since much of the data was not initialized, '-1' appeared other places too, and led to panics. Clear the allocated data before initializing nonzero values by allocating with M_ZERO. Submitted by: Doug Moore Reported by: Oleg V. Nauman , cy Tested by: Oleg V. Nauman MFC after: 1 week X-MFC with: r324420 Differential Revision: https://reviews.freebsd.org/D12627 Modified: head/sys/kern/subr_blist.c Modified: head/sys/kern/subr_blist.c ============================================================================== --- head/sys/kern/subr_blist.c Mon Oct 9 18:00:40 2017 (r324443) +++ head/sys/kern/subr_blist.c Mon Oct 9 18:19:06 2017 (r324444) @@ -248,7 +248,8 @@ blist_create(daddr_t blocks, int flags) nodes += last_block + 1; last_block /= BLIST_META_RADIX; } - bl = malloc(offsetof(struct blist, bl_root[nodes]), M_SWAP, flags); + bl = malloc(offsetof(struct blist, bl_root[nodes]), M_SWAP, flags | + M_ZERO); if (bl == NULL) return (NULL);