From patchwork Mon Jun 5 07:36:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leon Romanovsky X-Patchwork-Id: 13267027 X-Patchwork-Delegate: kuba@kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4662F194 for ; Mon, 5 Jun 2023 07:36:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1FC19C433D2; Mon, 5 Jun 2023 07:36:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1685950580; bh=5H7FUn5pwJFv3fBM+cmCTciSdUDXJ11tuvYg9R9jMdQ=; h=From:To:Cc:Subject:Date:From; b=tGePzUVkXXMYfTa/g8FAN9/vulgXNerBcqbqIPCJByyH5y+RQx7XWdrM8Wb+IaLLX gFEYQanJ5Hsc2e7oSwBPZiNEJT9QDGxmMKbUtjzrgtvsgKrgSglMzpKDxvfw/fc5C8 4rBcnVmYd5h9jisN2aHdk/KkgZ2B0DK/+FoszzHf0epg4deOl9MzA3NnZmQ1tD48KF sXPdF6oO7LhCw5IhuGRvYQH7C7ubELGwKnRWUAMeGWAic1P9N+lCZdWsYAwQyHEJX7 rM3lSYEEwyajniN2GCS0vIDShTVpMsDyEBKaWJcOJht39lOw9CZOUvHMCFkjP/9BKz 9aByhQ+QZLAuw== From: Leon Romanovsky To: Steffen Klassert Cc: Leon Romanovsky , "David S. Miller" , Eric Dumazet , Herbert Xu , Jakub Kicinski , netdev@vger.kernel.org, Paolo Abeni , Raed Salem Subject: [PATCH ipsec-rc] xfrm: add missed call to delete offloaded policies Date: Mon, 5 Jun 2023 10:36:15 +0300 Message-Id: <45c05c0028fd9bbd42893966caee2a314af91bab.1685950471.git.leonro@nvidia.com> X-Mailer: git-send-email 2.40.1 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org From: Leon Romanovsky Offloaded policies are deleted through two flows: netdev is going down and policy flush. In both cases, the code lacks relevant call to delete offloaded policy. Fixes: 919e43fad516 ("xfrm: add an interface to offload policy") Signed-off-by: Leon Romanovsky Reviewed-by: Simon Horman --- net/xfrm/xfrm_policy.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c index 6d15788b5123..6dcc714a9258 100644 --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c @@ -1831,6 +1831,7 @@ int xfrm_policy_flush(struct net *net, u8 type, bool task_valid) __xfrm_policy_unlink(pol, dir); spin_unlock_bh(&net->xfrm.xfrm_policy_lock); + xfrm_dev_policy_delete(pol); cnt++; xfrm_audit_policy_delete(pol, 1, task_valid); xfrm_policy_kill(pol); @@ -1869,6 +1870,7 @@ int xfrm_dev_policy_flush(struct net *net, struct net_device *dev, __xfrm_policy_unlink(pol, dir); spin_unlock_bh(&net->xfrm.xfrm_policy_lock); + xfrm_dev_policy_delete(pol); cnt++; xfrm_audit_policy_delete(pol, 1, task_valid); xfrm_policy_kill(pol);