From: Eric Dumazet <eric.dumazet@gmail.com>
To: Guillaume Nault <g.nault@alphalink.fr>
Cc: netdev@vger.kernel.org, James Chapman <jchapman@katalix.com>,
David Miller <davem@davemloft.net>
Subject: Re: [PATCH net,stable 1/2] l2tp: Fix PPP header erasure and memory leak
Date: Wed, 12 Jun 2013 07:41:20 -0700 [thread overview]
Message-ID: <1371048080.3252.61.camel@edumazet-glaptop> (raw)
In-Reply-To: <20130612140723.GB3500@alphalink.fr>
On Wed, 2013-06-12 at 16:07 +0200, Guillaume Nault wrote:
> Copy user data after PPP framing header. This prevents erasure of the
> added PPP header and avoids leaking two bytes of uninitialised memory
> at the end of skb's data buffer.
>
> Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
> ---
> net/l2tp/l2tp_ppp.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/net/l2tp/l2tp_ppp.c b/net/l2tp/l2tp_ppp.c
> index 637a341..681c626 100644
> --- a/net/l2tp/l2tp_ppp.c
> +++ b/net/l2tp/l2tp_ppp.c
> @@ -346,12 +346,12 @@ static int pppol2tp_sendmsg(struct kiocb *iocb, struct socket *sock, struct msgh
> skb_put(skb, 2);
>
> /* Copy user data into skb */
> - error = memcpy_fromiovec(skb->data, m->msg_iov, total_len);
> + error = memcpy_fromiovec(skb_put(skb, total_len), m->msg_iov,
> + total_len);
> if (error < 0) {
> kfree_skb(skb);
> goto error_put_sess_tun;
> }
> - skb_put(skb, total_len);
>
> l2tp_xmit_skb(session, skb, session->hdr_len);
>
I see no real change in your patch.
skb_put(skb, X) returns skb->data before the put operation.
Could you elaborate ?
next prev parent reply other threads:[~2013-06-12 14:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <cover.1371044671.git.g.nault@alphalink.fr>
2013-06-12 14:07 ` [PATCH net,stable 1/2] l2tp: Fix PPP header erasure and memory leak Guillaume Nault
2013-06-12 14:41 ` Eric Dumazet [this message]
2013-06-12 14:50 ` Eric Dumazet
2013-06-13 9:39 ` David Miller
2013-06-12 14:07 ` [PATCH net,stable 2/2] l2tp: Fix sendmsg() return value Guillaume Nault
2013-06-13 9:39 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1371048080.3252.61.camel@edumazet-glaptop \
--to=eric.dumazet@gmail.com \
--cc=davem@davemloft.net \
--cc=g.nault@alphalink.fr \
--cc=jchapman@katalix.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox