]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
pppoe: only process PADT targeted at local interfaces
authorGuillaume Nault <gnault@redhat.com>
Thu, 14 May 2020 10:15:39 +0000 (12:15 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 11 Jun 2020 07:22:19 +0000 (09:22 +0200)
We don't want to disconnect a session because of a stray PADT arriving
while the interface is in promiscuous mode.
Furthermore, multicast and broadcast packets make no sense here, so
only PACKET_HOST is accepted.

Reported-by: David Balažic <xerces9@gmail.com>
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Guillaume Nault <gnault@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ppp/pppoe.c

index fa8f7c40a384c12ae48e473f4fe4c1036914654b..804c52c35f074d9913ee31a88eed4a60d2960204 100644 (file)
@@ -494,6 +494,9 @@ static int pppoe_disc_rcv(struct sk_buff *skb, struct net_device *dev,
        if (!skb)
                goto out;
 
+       if (skb->pkt_type != PACKET_HOST)
+               goto abort;
+
        if (!pskb_may_pull(skb, sizeof(struct pppoe_hdr)))
                goto abort;