]> git.baikalelectronics.ru Git - kernel.git/commit
vxlan: Don't assume linear buffers in error handler
authorStefano Brivio <sbrivio@redhat.com>
Mon, 10 Jun 2019 22:27:05 +0000 (00:27 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 11 Jun 2019 19:07:33 +0000 (12:07 -0700)
commit9cddf458f8a2922712546060a522690f80080463
treee1efe7f840434d69d3d22d924def0ac30150e5b0
parent5a8616799f98a9804b4d7fc808cc8d4d5eb8294c
vxlan: Don't assume linear buffers in error handler

In commit 8f390148a04c ("vxlan: ICMP error lookup handler") I wrongly
assumed buffers from icmp_socket_deliver() would be linear. This is not
the case: icmp_socket_deliver() only guarantees we have 8 bytes of linear
data.

Eric fixed this same issue for fou and fou6 in commits c626a4560f43
("fou, fou6: do not assume linear skbs") and eb1b70caa60e ("fou, fou6:
avoid uninit-value in gue_err() and gue6_err()").

Use pskb_may_pull() instead of checking skb->len, and take into account
the fact we later access the VXLAN header with udp_hdr(), so we also
need to sum skb_transport_header() here.

Reported-by: Guillaume Nault <gnault@redhat.com>
Fixes: 8f390148a04c ("vxlan: ICMP error lookup handler")
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/vxlan.c