tipc: fix a potental access after delete in tipc_sk_join()
Subsystems (3)
PATCH 1/1 tipc: fix a potental access after delete in tipc_sk_join()
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.
--- net/tipc/socket.c | 1 + 1 file changed, 1 insertion(+)
net/tipc/socket.c +1 -0
@@ -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;
Signature · 1 line
2.1.4
From: Jon Maloy <[email protected]>
Date: Wed, 10 Jan 2018 21:08:50 +0100
Quoted 10 lines
In commit
d12d2e12cec2"tipc: send out join messages as soon as new member is discovered") we added a call to the functiontipc_group_join()without considering the case that the precedingtipc_sk_publish()might have failed, and the group item already deleted.We fix this by returning from
tipc_sk_join()directly after the failedtipc_sk_publish.Reported-by [email protected]Signed-off-by Jon Maloy <[email protected]>
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