From owner-freebsd-hackers@FreeBSD.ORG Sat Feb 21 10:16:41 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B282716A4CE; Sat, 21 Feb 2004 10:16:41 -0800 (PST) Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5D2A543D1F; Sat, 21 Feb 2004 10:16:41 -0800 (PST) (envelope-from robert@fledge.watson.org) Received: from fledge.watson.org (localhost [127.0.0.1]) by fledge.watson.org (8.12.10/8.12.10) with ESMTP id i1LIFtDL072587; Sat, 21 Feb 2004 13:15:55 -0500 (EST) (envelope-from robert@fledge.watson.org) Received: from localhost (robert@localhost)i1LIFtW1072584; Sat, 21 Feb 2004 13:15:55 -0500 (EST) (envelope-from robert@fledge.watson.org) Date: Sat, 21 Feb 2004 13:15:55 -0500 (EST) From: Robert Watson X-Sender: robert@fledge.watson.org To: John Baldwin In-Reply-To: <200402201340.23218.jhb@FreeBSD.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: hackers@FreeBSD.org cc: Ted Unangst Subject: Re: use after free bugs X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Feb 2004 18:16:41 -0000 On Fri, 20 Feb 2004, John Baldwin wrote: > On Thursday 19 February 2004 08:43 pm, Ted Unangst wrote: > > Hi. These are some bugs found by Coverity in a static analysis run on the > > FreeBSD kernel. All these are use after free bugs. > > Thanks for the excellent bug reports! I wonder if the same approach relating to memory allocation and free checking via static analysis could be applied to locking and unlocking of locks? I.e.: - We don't release locks more than once. - We don't forget to unlock. - We hold a lock before accessing certain fields (defined by annotation) of a structure. Robert N M Watson FreeBSD Core Team, TrustedBSD Projects robert@fledge.watson.org Senior Research Scientist, McAfee Research