summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorAyush Sawal <ayush.sawal@chelsio.com>2021-06-22 09:25:31 +0530
committerSteffen Klassert <steffen.klassert@secunet.com>2021-06-22 09:08:15 +0200
commitdd72fadf2186fc8a6018f97fe72f4d5ca05df440 (patch)
treebe69d4bc2741704da8e86704a1080ebd05c9b48b /net
parent6fd06963fa74197103cdbb4b494763127b3f2f34 (diff)
downloadlinux-stable-dd72fadf2186fc8a6018f97fe72f4d5ca05df440.tar.gz
linux-stable-dd72fadf2186fc8a6018f97fe72f4d5ca05df440.tar.bz2
linux-stable-dd72fadf2186fc8a6018f97fe72f4d5ca05df440.zip
xfrm: Fix xfrm offload fallback fail case
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: bdfd2d1fa79a ("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>
Diffstat (limited to 'net')
-rw-r--r--net/xfrm/xfrm_device.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/xfrm/xfrm_device.c b/net/xfrm/xfrm_device.c
index 6d6917b68856..e843b0d9e2a6 100644
--- a/net/xfrm/xfrm_device.c
+++ b/net/xfrm/xfrm_device.c
@@ -268,6 +268,7 @@ int xfrm_dev_state_add(struct net *net, struct xfrm_state *x,
xso->num_exthdrs = 0;
xso->flags = 0;
xso->dev = NULL;
+ xso->real_dev = NULL;
dev_put(dev);
if (err != -EOPNOTSUPP)