]> git.baikalelectronics.ru Git - kernel.git/commit
udp: cope with UDP GRO packet misdirection
authorPaolo Abeni <pabeni@redhat.com>
Wed, 7 Nov 2018 11:38:33 +0000 (12:38 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 8 Nov 2018 00:23:05 +0000 (16:23 -0800)
commit6b9bfa80f245c6d43bedd59fbf7d8ffbf9cc7cd3
treea77ca02d32c95a4bcb22ba09917bc6e1edade2c5
parent5cc296ceb94f1dba56cc5df19d12e42570ef1423
udp: cope with UDP GRO packet misdirection

In some scenarios, the GRO engine can assemble an UDP GRO packet
that ultimately lands on a non GRO-enabled socket.
This patch tries to address the issue explicitly checking for the UDP
socket features before enqueuing the packet, and eventually segmenting
the unexpected GRO packet, as needed.

We must also cope with re-insertion requests: after segmentation the
UDP code calls the helper introduced by the previous patches, as needed.

Segmentation is performed by a common helper, which takes care of
updating socket and protocol stats is case of failure.

rfc v3 -> v1
 - fix compile issues with rxrpc
 - when gso_segment returns NULL, treat is as an error
 - added 'ipv4' argument to udp_rcv_segment()

rfc v2 -> rfc v3
 - moved udp_rcv_segment() into net/udp.h, account errors to socket
   and ns, always return NULL or segs list

Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/udp.h
include/net/udp.h
net/ipv4/udp.c
net/ipv6/udp.c