From: David Miller <davem@davemloft.net>
To: xiyou.wangcong@gmail.com
Cc: netdev@vger.kernel.org, tipc-discussion@lists.sourceforge.net,
jon.maloy@ericsson.com, ying.xue@windriver.com
Subject: Re: [Patch net v2] tipc: fix a null pointer deref on error path
Date: Mon, 04 Dec 2017 13:57:16 -0500 (EST) [thread overview]
Message-ID: <20171204.135716.731762293431821544.davem@davemloft.net> (raw)
In-Reply-To: <20171204183143.7395-1-xiyou.wangcong@gmail.com>
From: Cong Wang <xiyou.wangcong@gmail.com>
Date: Mon, 4 Dec 2017 10:31:43 -0800
> In tipc_topsrv_kern_subscr() when s->tipc_conn_new() fails
> we call tipc_close_conn() to clean up, but in this case
> calling conn_put() is just enough.
>
> This fixes the folllowing crash:
...
> Fixes: 14c04493cb77 ("tipc: add ability to order and receive topology events in driver")
> Reported-by: syzbot <syzkaller@googlegroups.com>
> Cc: Jon Maloy <jon.maloy@ericsson.com>
> Cc: Ying Xue <ying.xue@windriver.com>
> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
...
> @@ -511,7 +511,7 @@ bool tipc_topsrv_kern_subscr(struct net *net, u32 port, u32 type,
> s = con->server;
> scbr = s->tipc_conn_new(*conid);
> if (!scbr) {
> - tipc_close_conn(con);
> + conn_put(con);
> return false;
> }
>
> --
> 2.13.0
>
It looks like tipc_accept_from_sock() has a similar problem? The
tipc_close_conn() will get invoked indirectly from the sock_release()
path right?
next prev parent reply other threads:[~2017-12-04 18:57 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-04 18:31 [Patch net v2] tipc: fix a null pointer deref on error path Cong Wang
2017-12-04 18:57 ` David Miller [this message]
2017-12-04 19:23 ` Cong Wang
2017-12-04 19:41 ` Cong Wang
2017-12-04 19:49 ` Jon Maloy
2017-12-04 20:32 ` Jon Maloy
2017-12-04 22:34 ` Cong Wang
2017-12-05 1:56 ` Jon Maloy
2017-12-04 19:48 ` David Miller
2017-12-04 19:44 ` Jon Maloy
2017-12-05 19:53 ` 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=20171204.135716.731762293431821544.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=jon.maloy@ericsson.com \
--cc=netdev@vger.kernel.org \
--cc=tipc-discussion@lists.sourceforge.net \
--cc=xiyou.wangcong@gmail.com \
--cc=ying.xue@windriver.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).