From: Sowmini Varadhan <sowmini.varadhan@oracle.com>
To: Cong Wang <cwang@twopensource.com>
Cc: netdev <netdev@vger.kernel.org>,
"Eric W. Biederman" <ebiederm@xmission.com>,
David Miller <davem@davemloft.net>
Subject: Re: netns refcnt leak for kernel accept sock
Date: Mon, 27 Jul 2015 20:19:46 +0200 [thread overview]
Message-ID: <20150727181946.GJ16447@oracle.com> (raw)
In-Reply-To: <CAHA+R7Pe08rfERd1rMR1Y_kK2iUm4TDc92rRhhJhr-e+_fsioA@mail.gmail.com>
On (07/27/15 11:13), Cong Wang wrote:
>
> That refcnt should be released in sock destructor too, when the tcp
> connection is terminated.
yes, but in my case, the listen socket is opened as part of
the ->init indirection in pernet_operations (thus it is a kernel socket)
and the expectation is that this listen socket, and any accept sockets
derived from it, will be closed in ->exit.
But if the accept socket is treated as a uspace socket (thus holds a get_net())
then it will block cleanup_net() and the associated ->exit cleanup operations.
This is probably not a problem for other systems like vxlan/gue/geneve etc
because they all use udp sockets, thus dont have the "accept" equivalent.
But fundamentally, its wrong for a kspace listen socket to result in a
"uspace" accept socket.
> Given the fact that sk_destruct() checks for sk_net_refcnt, your
> patch makes sense to me. But I am not sure how a TCP kernel
> socket is supposed to use.
Thanks for the confirmation - I think RDS is a bit of a maverick here in
that it uses tcp sockets unlike vxlan etc.
For those curious about RDS-TCP, I've actually updated the documentation at
https://oss.oracle.com/projects/rds/dist/documentation/rds-3.1-spec.html
recently. I hope that helps.
--Sowmini
next prev parent reply other threads:[~2015-07-27 18:19 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-27 14:21 netns refcnt leak for kernel accept sock Sowmini Varadhan
2015-07-27 17:40 ` Eric W. Biederman
2015-07-27 17:57 ` Sowmini Varadhan
2015-07-27 18:13 ` Cong Wang
2015-07-27 18:19 ` Sowmini Varadhan [this message]
2015-07-27 18:37 ` Cong Wang
2015-07-27 18:50 ` Sowmini Varadhan
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=20150727181946.GJ16447@oracle.com \
--to=sowmini.varadhan@oracle.com \
--cc=cwang@twopensource.com \
--cc=davem@davemloft.net \
--cc=ebiederm@xmission.com \
--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;
as well as URLs for NNTP newsgroup(s).