net/xfrm: IPsec tunnel mode fix inner_ipproto setting in sec_path
authorRaed Salem <raeds@nvidia.com>
Mon, 3 Jan 2022 11:19:29 +0000 (13:19 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Jan 2022 10:03:49 +0000 (11:03 +0100)
commit10f849d3e563f0b443cdc38ff9e4000ec12ca432
tree5c7de7db083169e242356238798cffaa88fe384b
parent4849eca4fc6fc35fdf3e667110fd8156fe77f90a
net/xfrm: IPsec tunnel mode fix inner_ipproto setting in sec_path

[ Upstream commit 45a98ef4922def8c679ca7c454403d1957fe70e7 ]

The inner_ipproto saves the inner IP protocol of the plain
text packet. This allows vendor's IPsec feature making offload
decision at skb's features_check and configuring hardware at
ndo_start_xmit, current code implenetation did not handle the
case where IPsec is used in tunnel mode.

Fix by handling the case when IPsec is used in tunnel mode by
reading the protocol of the plain text packet IP protocol.

Fixes: fa4535238fb5 ("net/xfrm: Add inner_ipproto into sec_path")
Signed-off-by: Raed Salem <raeds@nvidia.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/xfrm/xfrm_output.c