]> git.baikalelectronics.ru Git - kernel.git/commit
udp6: fix jumbogram reception
authorPaolo Abeni <pabeni@redhat.com>
Mon, 31 Jul 2017 14:52:36 +0000 (16:52 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 1 Aug 2017 05:01:21 +0000 (22:01 -0700)
commitb5e5574d3a6921cb9795f0ae3005d21ffcef17f5
treebd5ac01acb50fe8873102d5d3084ee2cc1c73548
parent62fa25f165ac198b94fd279dfbaf9b91f448d8f7
udp6: fix jumbogram reception

Since commit a425f09cd2b7 ("ipv6: udp: leverage scratch area
helpers") udp6_recvmsg() read the skb len from the scratch area,
to avoid a cache miss.
But the UDP6 rx path support RFC 2675 UDPv6 jumbograms, and their
length exceeds the 16 bits available in the scratch area. As a side
effect the length returned by recvmsg() is:
<ingress datagram len> % (1<<16)

This commit addresses the issue allocating one more bit in the
IP6CB flags field and setting it for incoming jumbograms.
Such field is still in the first cacheline, so at recvmsg()
time we can check it and fallback to access skb->len if
required, without a measurable overhead.

Fixes: a425f09cd2b7 ("ipv6: udp: leverage scratch area helpers")
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/ipv6.h
net/ipv6/exthdrs.c
net/ipv6/udp.c