From: Simon Horman <simon.horman@corigine.com>
To: Leon Romanovsky <leon@kernel.org>
Cc: Steffen Klassert <steffen.klassert@secunet.com>,
Leon Romanovsky <leonro@nvidia.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Herbert Xu <herbert@gondor.apana.org.au>,
Jakub Kicinski <kuba@kernel.org>,
netdev@vger.kernel.org, Paolo Abeni <pabeni@redhat.com>,
Raed Salem <raeds@nvidia.com>
Subject: Re: [PATCH xfrm 1/2] xfrm: release all offloaded policy memory
Date: Thu, 20 Apr 2023 17:10:16 +0200 [thread overview]
Message-ID: <ZEFV2GgKHfRShyXz@corigine.com> (raw)
In-Reply-To: <c84041b660cf6b0f0886488e740cd43b0f21c341.1681906552.git.leon@kernel.org>
On Wed, Apr 19, 2023 at 03:19:07PM +0300, Leon Romanovsky wrote:
> From: Leon Romanovsky <leonro@nvidia.com>
>
> Failure to add offloaded policy will cause to the following
> error once user will try to reload driver.
>
> Unregister_netdevice: waiting for eth3 to become free. Usage count = 2
>
> This was caused by xfrm_dev_policy_add() which increments reference
> to net_device. That reference was supposed to be decremented
> in xfrm_dev_policy_free(). However the latter wasn't called.
>
> unregister_netdevice: waiting for eth3 to become free. Usage count = 2
> leaked reference.
> xfrm_dev_policy_add+0xff/0x3d0
> xfrm_policy_construct+0x352/0x420
> xfrm_add_policy+0x179/0x320
> xfrm_user_rcv_msg+0x1d2/0x3d0
> netlink_rcv_skb+0xe0/0x210
> xfrm_netlink_rcv+0x45/0x50
> netlink_unicast+0x346/0x490
> netlink_sendmsg+0x3b0/0x6c0
> sock_sendmsg+0x73/0xc0
> sock_write_iter+0x13b/0x1f0
> vfs_write+0x528/0x5d0
> ksys_write+0x120/0x150
> do_syscall_64+0x3d/0x90
> entry_SYSCALL_64_after_hwframe+0x46/0xb0
>
> Fixes: 919e43fad516 ("xfrm: add an interface to offload policy")
> Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
next prev parent reply other threads:[~2023-04-20 15:10 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-19 12:19 [PATCH xfrm 0/2] Couple of error unwind fixes to packet offload Leon Romanovsky
2023-04-19 12:19 ` [PATCH xfrm 1/2] xfrm: release all offloaded policy memory Leon Romanovsky
2023-04-20 15:10 ` Simon Horman [this message]
2023-04-20 16:51 ` Eric Dumazet
2023-04-20 17:04 ` Leon Romanovsky
2023-04-20 17:33 ` Eric Dumazet
2023-04-21 8:46 ` Steffen Klassert
2023-04-19 12:19 ` [PATCH xfrm 2/2] xfrm: Fix leak of dev tracker Leon Romanovsky
2023-04-20 15:10 ` Simon Horman
2023-04-20 16:44 ` Eric Dumazet
2023-04-21 8:45 ` [PATCH xfrm 0/2] Couple of error unwind fixes to packet offload Steffen Klassert
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZEFV2GgKHfRShyXz@corigine.com \
--to=simon.horman@corigine.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=herbert@gondor.apana.org.au \
--cc=kuba@kernel.org \
--cc=leon@kernel.org \
--cc=leonro@nvidia.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=raeds@nvidia.com \
--cc=steffen.klassert@secunet.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).