]> git.baikalelectronics.ru Git - kernel.git/commit
ip_vti: receive ipip packet by calling ip_tunnel_rcv
authorXin Long <lucien.xin@gmail.com>
Tue, 21 Apr 2020 12:46:11 +0000 (20:46 +0800)
committerSteffen Klassert <steffen.klassert@secunet.com>
Thu, 23 Apr 2020 06:02:31 +0000 (08:02 +0200)
commit7ae5b2c67c6aed81c96a8ee439b234fec243ade9
treed59cbb291980440a8656187cdd8930e35e749b08
parent8a73f1b86fe2b041d150cf51c9793b06376cad24
ip_vti: receive ipip packet by calling ip_tunnel_rcv

In Commit 125bb8f0a427 ("vti4: Fix a ipip packet processing bug in
'IPCOMP' virtual tunnel"), it tries to receive IPIP packets in vti
by calling xfrm_input(). This case happens when a small packet or
frag sent by peer is too small to get compressed.

However, xfrm_input() will still get to the IPCOMP path where skb
sec_path is set, but never dropped while it should have been done
in vti_ipcomp4_protocol.cb_handler(vti_rcv_cb), as it's not an
ipcomp4 packet. This will cause that the packet can never pass
xfrm4_policy_check() in the upper protocol rcv functions.

So this patch is to call ip_tunnel_rcv() to process IPIP packets
instead.

Fixes: 125bb8f0a427 ("vti4: Fix a ipip packet processing bug in 'IPCOMP' virtual tunnel")
Reported-by: Xiumei Mu <xmu@redhat.com>
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
net/ipv4/ip_vti.c