netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [net-next  1/1] tipc: fix a potental access after delete in tipc_sk_join()
@ 2018-01-10 20:08 Jon Maloy
  2018-01-15 18:44 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Jon Maloy @ 2018-01-10 20:08 UTC (permalink / raw)
  To: davem, netdev
  Cc: mohan.krishna.ghanta.krishnamurthy, tung.q.nguyen, hoang.h.le,
	jon.maloy, canh.d.luu, ying.xue, tipc-discussion

In commit d12d2e12cec2 "tipc: send out join messages as soon as new
member is discovered") we added a call to the function tipc_group_join()
without considering the case that the preceding tipc_sk_publish() might
have failed, and the group item already deleted.

We fix this by returning from tipc_sk_join() directly after the
failed tipc_sk_publish.

Reported-by: syzbot+e3eeae78ea88b8d6d858@syzkaller.appspotmail.com
Signed-off-by: Jon Maloy <jon.maloy@ericsson.com>
---
 net/tipc/socket.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/tipc/socket.c b/net/tipc/socket.c
index 1f23627..f38264d 100644
--- a/net/tipc/socket.c
+++ b/net/tipc/socket.c
@@ -2774,6 +2774,7 @@ static int tipc_sk_join(struct tipc_sock *tsk, struct tipc_group_req *mreq)
 	if (rc) {
 		tipc_group_delete(net, grp);
 		tsk->group = NULL;
+		return rc;
 	}
 	/* Eliminate any risk that a broadcast overtakes sent JOINs */
 	tsk->mc_method.rcast = true;
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [net-next 1/1] tipc: fix a potental access after delete in tipc_sk_join()
  2018-01-10 20:08 [net-next 1/1] tipc: fix a potental access after delete in tipc_sk_join() Jon Maloy
@ 2018-01-15 18:44 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2018-01-15 18:44 UTC (permalink / raw)
  To: jon.maloy
  Cc: netdev, tipc-discussion, hoang.h.le, mohan.krishna.ghanta.krishnamurthy

From: Jon Maloy <jon.maloy@ericsson.com>
Date: Wed, 10 Jan 2018 21:08:50 +0100

> In commit d12d2e12cec2 "tipc: send out join messages as soon as new
> member is discovered") we added a call to the function tipc_group_join()
> without considering the case that the preceding tipc_sk_publish() might
> have failed, and the group item already deleted.
> 
> We fix this by returning from tipc_sk_join() directly after the
> failed tipc_sk_publish.
> 
> Reported-by: syzbot+e3eeae78ea88b8d6d858@syzkaller.appspotmail.com
> Signed-off-by: Jon Maloy <jon.maloy@ericsson.com>

Applied, thanks Jon.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-01-15 18:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-10 20:08 [net-next 1/1] tipc: fix a potental access after delete in tipc_sk_join() Jon Maloy
2018-01-15 18:44 ` David Miller

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).