kernel_optimize_test/net/xfrm
Ayush Sawal 78e6587585 xfrm: Fix xfrm offload fallback fail case
[ Upstream commit dd72fadf2186fc8a6018f97fe72f4d5ca05df440 ]

In case of xfrm offload, if xdo_dev_state_add() of driver returns
-EOPNOTSUPP, xfrm offload fallback is failed.
In xfrm state_add() both xso->dev and xso->real_dev are initialized to
dev and when err(-EOPNOTSUPP) is returned only xso->dev is set to null.

So in this scenario the condition in func validate_xmit_xfrm(),
if ((x->xso.dev != dev) && (x->xso.real_dev == dev))
                return skb;
returns true, due to which skb is returned without calling esp_xmit()
below which has fallback code. Hence the CRYPTO_FALLBACK is failing.

So fixing this with by keeping x->xso.real_dev as NULL when err is
returned in func xfrm_dev_state_add().

Fixes: bdfd2d1fa7 ("bonding/xfrm: use real_dev instead of slave_dev")
Signed-off-by: Ayush Sawal <ayush.sawal@chelsio.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-07-14 16:56:25 +02:00
..
espintcp.c espintcp: restore IP CB before handing the packet to xfrm 2020-08-17 15:58:04 +02:00
Kconfig xfrm/compat: Add 32=>64-bit messages translator 2020-09-24 08:53:03 +02:00
Makefile xfrm: Provide API to register translator module 2020-09-24 08:53:03 +02:00
xfrm_algo.c
xfrm_compat.c xfrm/compat: Cleanup WARN()s that can be user-triggered 2021-04-14 08:41:56 +02:00
xfrm_device.c xfrm: Fix xfrm offload fallback fail case 2021-07-14 16:56:25 +02:00
xfrm_hash.c
xfrm_hash.h
xfrm_inout.h
xfrm_input.c xfrm: Fix oops in xfrm_replay_advance_bmp 2021-02-03 23:28:45 +01:00
xfrm_interface.c xfrm: interface: fix ipv4 pmtu check to honor ip header df 2021-04-14 08:42:05 +02:00
xfrm_ipcomp.c
xfrm_output.c xfrm: remove the fragment check for ipv6 beet mode 2021-07-14 16:56:19 +02:00
xfrm_policy.c xfrm: Fix wraparound in xfrm_policy_addr_delta() 2021-02-03 23:28:45 +01:00
xfrm_proc.c
xfrm_replay.c
xfrm_state.c xfrm: xfrm_state_mtu should return at least 1280 for ipv6 2021-07-14 16:56:14 +02:00
xfrm_sysctl.c
xfrm_user.c xfrm/compat: Add 32=>64-bit messages translator 2020-09-24 08:53:03 +02:00