Bug 207597
Summary: | pppoe does not check dst addr of received packets | ||
---|---|---|---|
Product: | Drivers | Reporter: | David Balažic (xerces9) |
Component: | Network | Assignee: | drivers_network (drivers_network) |
Status: | RESOLVED CODE_FIX | ||
Severity: | normal | CC: | patrakov, tony.jewell |
Priority: | P1 | ||
Hardware: | All | ||
OS: | Linux | ||
Kernel Version: | 4.14.171 | Subsystem: | |
Regression: | No | Bisected commit-id: | |
Attachments: |
patch with debug output
quick fix |
Description
David Balažic
2020-05-06 10:32:29 UTC
Created attachment 288955 [details]
quick fix
The same patch but without printk, just the code
note: this is a quickfix, probably not a correct solution
This was fied in May 2020, for kernel versions 4.19, 4.14 (and 4.9, 4.4): From: Guillaume Nault <gnault@redhat.com> [ Upstream commit b8c158395119be62294da73646a3953c29ac974b ] 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> --- drivers/net/ppp/pppoe.c | 3 +++ 1 file changed, 3 insertions(+) --- a/drivers/net/ppp/pppoe.c +++ b/drivers/net/ppp/pppoe.c @@ -497,6 +497,9 @@ static int pppoe_disc_rcv(struct sk_buff if (!skb) goto out; + if (skb->pkt_type != PACKET_HOST) + goto abort; + if (!pskb_may_pull(skb, sizeof(struct pppoe_hdr))) goto abort; |