]> git.itanic.dy.fi Git - linux-stable/commit
udp: fix bcast packet reception
authorPaolo Abeni <pabeni@redhat.com>
Mon, 9 Oct 2017 12:52:10 +0000 (14:52 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 Oct 2017 09:56:19 +0000 (11:56 +0200)
commit0d3476c1395a39dcb2b78809424344ca7dadbfe2
tree9d85f28dfce9cb9597923061c12583a0b2999aa8
parentf8a055eadfd437689a6bf8749d5fef37ae242bfe
udp: fix bcast packet reception

commit 996b44fcef8f216ea0b6b6e74468c5a77b5e341f upstream.

The commit bc044e8db796 ("udp: perform source validation for
mcast early demux") does not take into account that broadcast packets
lands in the same code path and they need different checks for the
source address - notably, zero source address are valid for bcast
and invalid for mcast.

As a result, 2nd and later broadcast packets with 0 source address
landing to the same socket are dropped. This breaks dhcp servers.

Since we don't have stringent performance requirements for ingress
broadcast traffic, fix it by disabling UDP early demux such traffic.

Reported-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Fixes: bc044e8db796 ("udp: perform source validation for mcast early demux")
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/ipv4/udp.c