From: Guillaume Nault <gnault@redhat.com>
To: Eric Dumazet <edumazet@google.com>
Cc: "David S . Miller" <davem@davemloft.net>,
netdev <netdev@vger.kernel.org>,
Eric Dumazet <eric.dumazet@gmail.com>,
James Chapman <jchapman@katalix.com>,
syzbot <syzkaller@googlegroups.com>
Subject: Re: [PATCH net] l2tp: add sk_family checks to l2tp_validate_socket
Date: Sat, 30 May 2020 17:51:36 +0200 [thread overview]
Message-ID: <20200530155136.GA31596@pc-3.home> (raw)
In-Reply-To: <20200529183225.150288-1-edumazet@google.com>
On Fri, May 29, 2020 at 11:32:25AM -0700, Eric Dumazet wrote:
> syzbot was able to trigger a crash after using an ISDN socket
> and fool l2tp.
>
> Fix this by making sure the UDP socket is of the proper family.
>
> --- a/net/l2tp/l2tp_core.c
> +++ b/net/l2tp/l2tp_core.c
> @@ -1458,6 +1458,9 @@ static int l2tp_validate_socket(const struct sock *sk, const struct net *net,
> if (sk->sk_type != SOCK_DGRAM)
> return -EPROTONOSUPPORT;
>
> + if (sk->sk_family != PF_INET && sk->sk_family != PF_INET6)
> + return -EPROTONOSUPPORT;
> +
> if ((encap == L2TP_ENCAPTYPE_UDP && sk->sk_protocol != IPPROTO_UDP) ||
> (encap == L2TP_ENCAPTYPE_IP && sk->sk_protocol != IPPROTO_L2TP))
> return -EPROTONOSUPPORT;
>
Thanks a lot!
Acked-by: Guillaume Nault <gnault@redhat.com>
next prev parent reply other threads:[~2020-05-30 15:51 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-29 18:32 [PATCH net] l2tp: add sk_family checks to l2tp_validate_socket Eric Dumazet
2020-05-30 15:51 ` Guillaume Nault [this message]
2020-05-31 4:57 ` 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=20200530155136.GA31596@pc-3.home \
--to=gnault@redhat.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=eric.dumazet@gmail.com \
--cc=jchapman@katalix.com \
--cc=netdev@vger.kernel.org \
--cc=syzkaller@googlegroups.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.