From: Sowmini Varadhan <sowmini.varadhan@oracle.com>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Subject: Re: RFC: sk leak in sock_graft?
Date: Tue, 27 Jun 2017 15:59:21 -0400 [thread overview]
Message-ID: <20170627195921.GA9171@oracle.com> (raw)
In-Reply-To: <20170627.153816.46774843898605825.davem@davemloft.net>
On (06/27/17 15:38), David Miller wrote:
>
> It could simply be the case that rds-tcp is the first setup that
> created that situation where there is a parent->sk already.
Possibly, I noticed that other callers call sock_create_lite()
and I dont know the history here - this seems to have been
the case from day-1 of rds-tcp. (and I dread changing
rds_tcp_accept_kern() to do this, because then every module unload
would need to go and check if sock->sk is non-null first, before
cleaning it up
> Why does rds-tcp need to call sock_graft() without those invariants
> met?
It would certainly help to declare "dont use sock_creeate_kern()
if you are going to accept on this socket"- I dont see that being
mandated anywhere.
It would also help to have a BUG_ON(parent->sk) or at least a
WARN_ON(parent->sk) in sock_graft, before unilaterally assigning
it to the new sk.
--Sowmini
next prev parent reply other threads:[~2017-06-27 19:59 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-24 13:08 RFC: sk leak in sock_graft? Sowmini Varadhan
2017-06-27 19:38 ` David Miller
2017-06-27 19:59 ` Sowmini Varadhan [this message]
2017-06-27 20:45 ` Sowmini Varadhan
2017-06-29 16:46 ` David Miller
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=20170627195921.GA9171@oracle.com \
--to=sowmini.varadhan@oracle.com \
--cc=davem@davemloft.net \
--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).