Skip to content

Commit c5d4d7d

Browse files
committed
xfrm: Fix deletion of offloaded SAs on failure.
When we off load a SA, it gets pushed to the NIC before we can add it. In case of a failure, we don't delete this SA from the NIC. Fix this by calling xfrm_dev_state_delete on failure. Fixes: d77e38e ("xfrm: Add an IPsec hardware offloading API") Reported-by: Shannon Nelson <shannon.nelson@oracle.com> Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
1 parent 1f4f554 commit c5d4d7d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

net/xfrm/xfrm_user.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -657,6 +657,7 @@ static int xfrm_add_sa(struct sk_buff *skb, struct nlmsghdr *nlh,
657657

658658
if (err < 0) {
659659
x->km.state = XFRM_STATE_DEAD;
660+
xfrm_dev_state_delete(x);
660661
__xfrm_state_put(x);
661662
goto out;
662663
}

0 commit comments

Comments
 (0)