From: Steffen Klassert <steffen.klassert@secunet.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: "David S . Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>, netdev <netdev@vger.kernel.org>,
Eric Dumazet <edumazet@google.com>, Cong Wang <amwang@redhat.com>
Subject: Re: [PATCH net-next] xfrm: use net device refcount tracker helpers
Date: Thu, 9 Dec 2021 10:20:36 +0100 [thread overview]
Message-ID: <20211209092036.GK427717@gauss3.secunet.de> (raw)
In-Reply-To: <20211207193203.2706158-1-eric.dumazet@gmail.com>
On Tue, Dec 07, 2021 at 11:32:03AM -0800, Eric Dumazet wrote:
> From: Eric Dumazet <edumazet@google.com>
>
> xfrm4_fill_dst() and xfrm6_fill_dst() build dst,
> getting a device reference that will likely be released
> by standard dst_release() code.
>
> We have to track these references or risk a warning if
> CONFIG_NET_DEV_REFCNT_TRACKER=y
>
> Note to XFRM maintainers :
>
> Error path in xfrm6_fill_dst() releases the reference,
> but does not clear xdst->u.dst.dev, so I wonder
> if this could lead to double dev_put() in some cases,
> where a dst_release() _is_ called by the callers in their
> error path.
Yes, looks like it can, so this should be fixed.
>
> This extra dev_put() was added in commit 84c4a9dfbf430 ("xfrm6:
> release dev before returning error")
>
> Fixes: 9038c320001d ("net: dst: add net device refcount tracking to dst_entry")
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Cc: Cong Wang <amwang@redhat.com>
> Cc: Steffen Klassert <steffen.klassert@secunet.com>
As the refcount tracking infrastructure is not yet in ipsec-next:
Acked-by: Steffen Klassert <steffen.klassert@secunet.com>
Thanks!
next prev parent reply other threads:[~2021-12-09 9:20 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-07 19:32 [PATCH net-next] xfrm: use net device refcount tracker helpers Eric Dumazet
2021-12-09 9:20 ` Steffen Klassert [this message]
2021-12-09 19:53 ` Jakub Kicinski
2021-12-09 20:00 ` patchwork-bot+netdevbpf
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=20211209092036.GK427717@gauss3.secunet.de \
--to=steffen.klassert@secunet.com \
--cc=amwang@redhat.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=eric.dumazet@gmail.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
/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