From owner-freebsd-net Fri May 31 13:52:39 2002 Delivered-To: freebsd-net@freebsd.org Received: from tesla.distributel.net (nat.MTL.distributel.NET [66.38.181.24]) by hub.freebsd.org (Postfix) with ESMTP id 176EF37B420 for ; Fri, 31 May 2002 13:52:00 -0700 (PDT) Received: (from bmilekic@localhost) by tesla.distributel.net (8.11.6/8.11.6) id g4VKoeQ71755; Fri, 31 May 2002 16:50:40 -0400 (EDT) (envelope-from bmilekic@unixdaemons.com) Date: Fri, 31 May 2002 16:50:40 -0400 From: Bosko Milekic To: Archie Cobbs Cc: Julian Elischer , freebsd-net@FreeBSD.ORG Subject: Re: m_split() considered harmful Message-ID: <20020531165040.A71744@unixdaemons.com> References: <200205312025.g4VKP9t02205@arch20m.dellroad.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <200205312025.g4VKP9t02205@arch20m.dellroad.org>; from archie@dellroad.org on Fri, May 31, 2002 at 01:25:09PM -0700 Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Fri, May 31, 2002 at 01:25:09PM -0700, Archie Cobbs wrote: [...] > As a temporary saftey measure, I'll add M_WRITABLE(m) into the > M_TRAILINGSPACE() macro. However, I see this as a temporary hack; > the correct fix is to put the burden of writability on the caller. > After all, M_TRAILINGSPACE() doesn't modify the mbuf data! > > That is, what we really need is a more general audit for code that > writes into mbufs that might be read-only -- and, as one special case > of tha, code that calls M_TRAILINGSPACE()/M_LEADINGSPACE() before writing > into an mbuf. Agreed. [...] > Updated patch below. > > -Archie [...] Patch looks good. -- Bosko Milekic bmilekic@unixdaemons.com bmilekic@FreeBSD.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message