]> 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)
commit24cff2e3e972d7e8a86b5bd269354122ce46ffee
treebd5ac01acb50fe8873102d5d3084ee2cc1c73548
parent83fab0b50d9b0a1c6303c7121454408ad054d31e
udp6: fix jumbogram reception

Since commit 34787b9641d4 ("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: 34787b9641d4 ("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