From owner-cvs-all Tue Apr 23 15:33:55 2002 Delivered-To: cvs-all@freebsd.org Received: from mail.speakeasy.net (mail12.speakeasy.net [216.254.0.212]) by hub.freebsd.org (Postfix) with ESMTP id B183937B43D for ; Tue, 23 Apr 2002 15:32:53 -0700 (PDT) Received: (qmail 23150 invoked from network); 23 Apr 2002 22:32:53 -0000 Received: from unknown (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) by mail12.speakeasy.net (qmail-ldap-1.03) with DES-CBC3-SHA encrypted SMTP for ; 23 Apr 2002 22:32:53 -0000 Received: from laptop.baldwin.cx (gw1.twc.weather.com [216.133.140.1]) by server.baldwin.cx (8.11.6/8.11.6) with ESMTP id g3NMWqv04119; Tue, 23 Apr 2002 18:32:52 -0400 (EDT) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.5.2 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <82146.1019562857@critter.freebsd.dk> Date: Tue, 23 Apr 2002 18:32:01 -0400 (EDT) From: John Baldwin To: Poul-Henning Kamp Subject: RE: Memory overwrite problem in the -current kernel ?? Cc: current@FreeBSD.org, cvs-all@FreeBSD.org, cvs-committers@FreeBSD.org Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On 23-Apr-2002 Poul-Henning Kamp wrote: > > This commit detects a memory overwrite problem in the kernel which > happens before we ever get into userland for the first time. > > The commit which causes the problem to appear is my own commit to > subr_disklabel.c (1.65). > > If the block below is put back in subr_disklabel.c the memory overwrite > problem goes away (or at least doesn't happen in GEOM). > > My testbox is a single-cpu machine. > > Something is screwed somewhere... Uhh, you mean if the dksort_mtx is put back? What if the function doesn't do anything, does it still work? Also, what if you just have the static mtx, maybe the mtx is preventing a buffer overflow from hosing other data? > Poul-Henning > > ] #ifdef notquite > ] /* > ] * Mutex to use when delaying niced I/O bound processes in bioqdisksort(). > ] */ > ] static struct mtx dksort_mtx; > ] static void > ] dksort_init(void) > ] { > ] > ] mtx_init(&dksort_mtx, "dksort", NULL, MTX_DEF); > ] } > ] SYSINIT(dksort, SI_SUB_DRIVERS, SI_ORDER_MIDDLE, dksort_init, NULL) > ] #endif > > > In message <200204231148.g3NBmkp36899@freefall.freebsd.org>, Poul-Henning > Kamp > writes: >>phk 2002/04/23 04:48:45 PDT >> >> Modified files: >> sys/geom geom.h geom_dump.c geom_enc.c >> geom_slice.c geom_subr.c >> Log: >> Introduce some serious paranoia to try to catch a memory overwrite problem >> as early as possible. >> >> Sponsored by: DARPA & NAI Labs >> >> Revision Changes Path >> 1.13 +13 -4 src/sys/geom/geom.h >> 1.7 +1 -0 src/sys/geom/geom_dump.c >> 1.3 +1 -0 src/sys/geom/geom_enc.c >> 1.11 +2 -0 src/sys/geom/geom_slice.c >> 1.8 +46 -2 src/sys/geom/geom_subr.c >> > > -- > Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 > phk@FreeBSD.ORG | TCP/IP since RFC 956 > FreeBSD committer | BSD since 4.3-tahoe > Never attribute to malice what can adequately be explained by incompetence. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message