From patchwork Mon Jul 31 11:38:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leon Romanovsky X-Patchwork-Id: 13334463 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 6F0F1182A0 for ; Mon, 31 Jul 2023 11:38:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C3B4EC433C8; Mon, 31 Jul 2023 11:38:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690803521; bh=4Kut+Aj34e0b4FvRLDaGTDfUM4AGVvNXmN+OkJ4YXXg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nZmMlhhZ3HC73+irFN/YqJ6Ws5nW8xV53e8kw/p0PoPh1SyL5qxdVlb3bivSjg0BC SzjeIATzrh23JxGezenpCat3hoT0ueIGMG1QPzCGai62NbcGwDAGGqkubsCjZuo4fF c3k+DH0hj1IHqlmiCBgmLSrCrsfXjBj0x5j9yLYkeBuxIIy1cGaEK5+Khnfl0KgGhk Ux2aRG5Vcj7aL/8xlYhaUshsYVj8mGqxRdkddV6Jh5BZ3JqIMifR7EOD9hQyVsZBU0 ATYflLiR9TsX8IV1CqoMc30c2aqoDLch+w7OTUEGL79PknSuaXWQcRlYU61jhhQPhV mIdtbWfRgZu6Q== 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 1/2] xfrm: delete offloaded policy Date: Mon, 31 Jul 2023 14:38:26 +0300 Message-ID: <8a4865f5b78314be70cb8540027cc48f86d45d89.1690803052.git.leon@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: 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 The policy memory was released but not HW driver data. Add call to xfrm_dev_policy_delete(), so drivers will have a chance to release their resources. Fixes: 919e43fad516 ("xfrm: add an interface to offload policy") Signed-off-by: Leon Romanovsky --- net/xfrm/xfrm_user.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c index c34a2a06ca94..5a117aac4274 100644 --- a/net/xfrm/xfrm_user.c +++ b/net/xfrm/xfrm_user.c @@ -2336,6 +2336,7 @@ static int xfrm_get_policy(struct sk_buff *skb, struct nlmsghdr *nlh, NETLINK_CB(skb).portid); } } else { + xfrm_dev_policy_delete(xp); xfrm_audit_policy_delete(xp, err ? 0 : 1, true); if (err != 0)