From 310dc5a403c9afb27edc28ad48439e0bbd18f52a Mon Sep 17 00:00:00 2001 From: "Bjoern A. Zeeb" Date: Thu, 17 Nov 2016 14:03:44 +0000 Subject: [PATCH] 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 --- sys/netgraph/ng_l2tp.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sys/netgraph/ng_l2tp.c b/sys/netgraph/ng_l2tp.c index 85cd6c3e340..55fa2cd3106 100644 --- a/sys/netgraph/ng_l2tp.c +++ b/sys/netgraph/ng_l2tp.c @@ -1544,6 +1544,16 @@ ng_l2tp_xmit_ctrl(priv_p priv, struct mbuf *m, u_int16_t ns) 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 */