From owner-cvs-src@FreeBSD.ORG Sun Jul 4 16:03:41 2004 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from green.homeunix.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id C789916A4CE; Sun, 4 Jul 2004 16:03:40 +0000 (GMT) Received: from green.homeunix.org (green@localhost [127.0.0.1]) by green.homeunix.org (8.12.11/8.12.11) with ESMTP id i64G3eYN001134; Sun, 4 Jul 2004 12:03:40 -0400 (EDT) (envelope-from green@green.homeunix.org) Received: (from green@localhost) by green.homeunix.org (8.12.11/8.12.11/Submit) id i64G3d1r001133; Sun, 4 Jul 2004 12:03:39 -0400 (EDT) (envelope-from green) Date: Sun, 4 Jul 2004 12:03:39 -0400 From: Brian Fundakowski Feldman To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org Message-ID: <20040704160339.GA997@green.homeunix.org> References: <200407041559.i64FxPpj048980@repoman.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200407041559.i64FxPpj048980@repoman.freebsd.org> User-Agent: Mutt/1.5.6i Subject: Re: cvs commit: src/sys/vm uma_core.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Jul 2004 16:03:41 -0000 On Sun, Jul 04, 2004 at 03:59:25PM +0000, Brian Feldman wrote: > green 2004-07-04 15:59:25 UTC > > FreeBSD src repository > > Modified files: > sys/vm uma_core.c > Log: > Reextend the M_WAITOK-disabling-hack to all three of the mbuf-related > zones, and do it by direct comparison of uma_zone_t instead of strcmp. > > The mbuf subsystem used to provide M_TRYWAIT/M_DONTWAIT semantics, but > this is mostly no longer the case. M_WAITOK has taken over the spot > M_TRYWAIT used to have, and for mbuf things, still may return NULL if > the code path is incorrectly holding a mutex going into mbuf allocation > functions. > > The M_WAITOK/M_NOWAIT semantics are absolute; though it may deadlock > the system to try to malloc or uma_zalloc something with a mutex held > and M_WAITOK specified, it is absolutely required to not return NULL > and will result in instability and/or security breaches otherwise. > There is still room to add the WITNESS_WARN() to all cases so that > we are notified of the possibility of deadlocks, but it cannot change > the value of the "badness" variable and allow allocation to actually > fail except for the specialized cases which used to be M_TRYWAIT. Any subsequent desire to change the semantics of malloc(9) or uma_zalloc(9) in the M_WAITOK case, such as this, absolutely must be taken up with the Security Officer. -- Brian Fundakowski Feldman \'[ FreeBSD ]''''''''''\ <> green@FreeBSD.org \ The Power to Serve! \ Opinions expressed are my own. \,,,,,,,,,,,,,,,,,,,,,,\