From owner-svn-src-head@freebsd.org Thu Nov 17 14:03:45 2016 Return-Path: Delivered-To: svn-src-head@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 7E0A1C4741A; Thu, 17 Nov 2016 14:03:45 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4CA83168E; Thu, 17 Nov 2016 14:03:45 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAHE3ill044463; Thu, 17 Nov 2016 14:03:44 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAHE3i3N044462; Thu, 17 Nov 2016 14:03:44 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201611171403.uAHE3i3N044462@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Thu, 17 Nov 2016 14:03:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308748 - head/sys/netgraph X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2016 14:03:45 -0000 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); + } } /* Fill in L2TP header */