From owner-freebsd-net@FreeBSD.ORG Thu May 1 08:38:50 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BEE5B37B401 for ; Thu, 1 May 2003 08:38:50 -0700 (PDT) Received: from relay.pair.com (relay.pair.com [209.68.1.20]) by mx1.FreeBSD.org (Postfix) with SMTP id 6B8FF43F75 for ; Thu, 1 May 2003 08:38:49 -0700 (PDT) (envelope-from silby@silby.com) Received: (qmail 6285 invoked from network); 1 May 2003 15:38:48 -0000 Received: from niwun.pair.com (HELO localhost) (209.68.2.70) by relay.pair.com with SMTP; 1 May 2003 15:38:48 -0000 X-pair-Authenticated: 209.68.2.70 Date: Thu, 1 May 2003 10:38:31 -0500 (CDT) From: Mike Silbersack To: Luigi Rizzo In-Reply-To: <20030501041210.A3514@xorpc.icir.org> Message-ID: <20030501103520.S6445@odysseus.silby.com> References: <20030430142532.F3741@odysseus.silby.com> <20030501041210.A3514@xorpc.icir.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-net@freebsd.org Subject: Re: Review needed: Mbuf double-free detection patch X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 May 2003 15:38:51 -0000 On Thu, 1 May 2003, Luigi Rizzo wrote: > as Bosko noticed, it would be a good idea to make the change to subr_mbuf.c > conditionally compiled under DIAGNOSTIC or INVARIANTS or the like. Hsu already convinced me to put it under INVARIANTS in private mail. > I was actually wondering if you have caught already any bug > with this code enabled. Nope, not yet. I was just trying to figure out how mbuf free list corruption could occur, and a double-free seemed to be an obvious thing to try. Once I found how much it messed things up, I came up with this patch. > [on a side note, it is a bit depressing to see the same > code replicated twice, in m_free() and m_freem(). Couldn't > one try to make m_freem() just call m_free() in a loop and > save some code bloat ? I doubt the extra function call > would harm performance too much.] > > cheers > luigi Someone seems to have placed a SEP field around that paragraph, I'm having trouble reading it. :) Mike "Silby" Silbersack