udp: Fix udp_poll() and ioctl()
commitf2f3a6990f1c7dd8bb8e14cc8026faaf2d9ade21
authorEric Dumazet <eric.dumazet@gmail.com>
Fri, 9 Oct 2009 04:43:40 +0000 (9 04:43 +0000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 8 Dec 2009 18:21:58 +0000 (8 10:21 -0800)
tree3d3747ae3d9ca81d5636107d2e6b082510289eec
parent6a36e5969e91cd0c13ffc83e83a2b8a718efe862
udp: Fix udp_poll() and ioctl()

[ Upstream commit 85584672012ee0c3b7b8e033a1ecf7c11878e45f ]

udp_poll() can in some circumstances drop frames with incorrect checksums.

Problem is we now have to lock the socket while dropping frames, or risk
sk_forward corruption.

This bug is present since commit 95766fff6b9a78d1
([UDP]: Add memory accounting.)

While we are at it, we can correct ioctl(SIOCINQ) to also drop bad frames.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
net/ipv4/udp.c