From owner-cvs-src-old@FreeBSD.ORG Fri Oct 10 17:49:54 2008 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 71F1B106576B for ; Fri, 10 Oct 2008 17:49:54 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 644B08FC16 for ; Fri, 10 Oct 2008 17:49:54 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id m9AHns21097639 for ; Fri, 10 Oct 2008 17:49:54 GMT (envelope-from imp@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id m9AHnseu097638 for cvs-src-old@freebsd.org; Fri, 10 Oct 2008 17:49:54 GMT (envelope-from imp@repoman.freebsd.org) Message-Id: <200810101749.m9AHnseu097638@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to imp@repoman.freebsd.org using -f From: Warner Losh Date: Fri, 10 Oct 2008 17:49:47 +0000 (UTC) To: cvs-src-old@freebsd.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/sys/kern subr_bus.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: Fri, 10 Oct 2008 17:49:54 -0000 imp 2008-10-10 17:49:47 UTC FreeBSD src repository Modified files: sys/kern subr_bus.c Log: SVN rev 183750 on 2008-10-10 17:49:47Z by imp Close, but not eliminate, a race condition. It is one that properly designed drivers would never hit, but was exposed in diving into another problem... When expanding the devclass array, free the old memory after updating the pointer to the new memory. For the following single race case, this helps: allocate new memory copy to new memory free old memory read pointer to freed memory update pointer to new memory Now we do allocate new memory copy to new memory update pointer to new memory free old memory Which closes this problem, but doesn't even begin to address the multicpu races, which all should be covered by Giant at the moment, but likely aren't completely. Note: reviewers were ok with this fix, but suggested the use case wasn't one we wanted to encourage. Reviewed by: jhb, scottl. Revision Changes Path 1.210 +6 -4 src/sys/kern/subr_bus.c