From owner-svn-src-all@freebsd.org Thu Nov 17 14:44:14 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7377C47F66; Thu, 17 Nov 2016 14:44:14 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: from mail-ua0-x243.google.com (mail-ua0-x243.google.com [IPv6:2607:f8b0:400c:c08::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8B3D910B5; Thu, 17 Nov 2016 14:44:14 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: by mail-ua0-x243.google.com with SMTP id 12so14648455uas.3; Thu, 17 Nov 2016 06:44:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=IrUaBn/gG06jRuCGIjvhvbhw+SxYjivGeiTCmArRRwM=; b=er9StpGX77RcKyePPJgChVWcEtbP7ZahYYeYv7SA8n6zxkdCYeAqkw5aARBns/h1GZ 9UVL/+5OR/bBCQgzerHz2rSLNreuAf8+ZLnk0/+oVw3GU7nV9C9LCC7R3LvSJUDbHx/F r0t/AwMi+rTBBVa5tSZAGrUV8Q3D0DX3R66TJ1Rqdr6rAqZcpzmftcxOTkJ6yjyu1yRG vpAaBKyUGZt5SzybNiyBo8Fb7laxxf9jJUuXkROZtUbgyHrKmCrXolw+dyM4KY7bAENR Ln9z6pbEbgvwYxJxcWCUBOF9QGEGF9qwsf6or0Kxa5yqTIhrZ8Qxx7i/EXKjaahM1TzE BjZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=IrUaBn/gG06jRuCGIjvhvbhw+SxYjivGeiTCmArRRwM=; b=apw6QV7nhZCm35qVv93ys5V0x+W7YK+gFjiB3ON6GpWIA3WVYFi/OkprhPVgFfTtGb H7lQpD/4eN8A1gC+ZM3kvZ6XFU9GNaF+Izx8ryeFIimD50dGFOmFlcU4wbm1s11jirJA WOVlZI/drbKrWYWWqoHc34HVV5MACycxJJSKGIzjCbfPUt2eoFc3ztRJ4j5EgwhhSn3W EnmX62JxoGjgn4uJ8QsCP7Ak3cncYOs1CtP9eEsqR3reHYV0IABxgGWj57ButQ7439WR MsdXCaT+wXgboaYleujcesBVV3mDScFYDPQq1fku25PsLCUMqfPHrC5FF6NmrDWEYNwk lkGg== X-Gm-Message-State: ABUngvcyZbAg3We3elIt2ZASsyn7lOvxkXrD5vrZuYodYrAKc1T1u1i0/UoENufrEa6DrC4gfWD+QRch3JuFmQ== X-Received: by 10.176.85.24 with SMTP id t24mr2112640uaa.21.1479393852833; Thu, 17 Nov 2016 06:44:12 -0800 (PST) MIME-Version: 1.0 Received: by 10.159.36.247 with HTTP; Thu, 17 Nov 2016 06:44:12 -0800 (PST) In-Reply-To: <201611171403.uAHE3i3N044462@repo.freebsd.org> References: <201611171403.uAHE3i3N044462@repo.freebsd.org> From: Sepherosa Ziehau Date: Thu, 17 Nov 2016 22:44:12 +0800 Message-ID: Subject: Re: svn commit: r308748 - head/sys/netgraph To: "Bjoern A. Zeeb" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2016 14:44:14 -0000 On Thu, Nov 17, 2016 at 10:03 PM, Bjoern A. Zeeb wrote: > Author: bz > Date: Thu Nov 17 14:03:44 2016 > New Revision: 308748 > URL: https://svnweb.freebsd.org/changeset/base/308748 > > Log: > Writing out the L2TP control packet requires 12 bytes of > contiguous memory but in one path we did not always guarantee this, > thus do a m_pullup() there. > > PR: 214385 > Submitted by: Joe Jones (joeknockando googlemail.com) > MFC after: 3 days > > Modified: > head/sys/netgraph/ng_l2tp.c > > Modified: head/sys/netgraph/ng_l2tp.c > ============================================================================== > --- head/sys/netgraph/ng_l2tp.c Thu Nov 17 11:48:07 2016 (r308747) > +++ head/sys/netgraph/ng_l2tp.c Thu Nov 17 14:03:44 2016 (r308748) > @@ -1544,6 +1544,16 @@ ng_l2tp_xmit_ctrl(priv_p priv, struct mb > priv->stats.memoryFailures++; > return (ENOBUFS); > } > + > + /* > + * The below requires 12 contiguous bytes for the L2TP header > + * to be written into. > + */ > + m = m_pullup(m, 12); > + if (m == NULL) { > + priv->stats.memoryFailures++; > + return (ENOBUFS); > + } Would it be better that we do a (m->m_len < 12) test before doing the m_pullup()? Thanks, sephe -- Tomorrow Will Never Die