]> git.baikalelectronics.ru Git - kernel.git/commit
udp: fix poll()
authorPaolo Abeni <pabeni@redhat.com>
Fri, 23 Jun 2017 12:19:51 +0000 (14:19 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 23 Jun 2017 15:18:43 +0000 (11:18 -0400)
commit3ac527c53b2a5709027b9811e460ad9528a7d54b
tree9179096d14dd69ac1cd7355d55d0c4ade8ac0b9e
parent56bb373b7a96130d89dd7ad22fa900b59a9d104e
udp: fix poll()

Michael reported an UDP breakage caused by the commit 00219296fbc1
("udp: try to avoid 2 cache miss on dequeue").
The function __first_packet_length() can update the checksum bits
of the pending skb, making the scratched area out-of-sync, and
setting skb->csum, if the skb was previously in need of checksum
validation.

On later recvmsg() for such skb, checksum validation will be
invoked again - due to the wrong udp_skb_csum_unnecessary()
value - and will fail, causing the valid skb to be dropped.

This change addresses the issue refreshing the scratch area in
__first_packet_length() after the possible checksum update.

Fixes: 00219296fbc1 ("udp: try to avoid 2 cache miss on dequeue")
Reported-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/udp.c