Commit 7690b50d authored by Parthasarathy Bhuvaragan's avatar Parthasarathy Bhuvaragan Committed by Tim Gardner

tipc: fix nullptr crash during subscription cancel

commit 4d5cfcba ('tipc: fix connection abort during subscription
cancel'), removes the check for a valid subscription before calling
tipc_nametbl_subscribe().

This will lead to a nullptr exception when we process a
subscription cancel request. For a cancel request, a null
subscription is passed to tipc_nametbl_subscribe() resulting
in exception.

In this commit, we call tipc_nametbl_subscribe() only for
a valid subscription.

Fixes: 4d5cfcba ('tipc: fix connection abort during subscription cancel')
Reported-by: default avatarAnders Widell <anders.widell@ericsson.com>
Signed-off-by: default avatarParthasarathy Bhuvaragan <parthasarathy.bhuvaragan@ericsson.com>
Acked-by: default avatarJon Maloy <jon.maloy@ericsson.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
(cherry picked from commit 4de13d7e)
Signed-off-by: default avatarTim Gardner <tim.gardner@canonical.com>
parent 970a2f22
...@@ -296,7 +296,8 @@ static void tipc_subscrb_rcv_cb(struct net *net, int conid, ...@@ -296,7 +296,8 @@ static void tipc_subscrb_rcv_cb(struct net *net, int conid,
if (tipc_subscrp_create(net, (struct tipc_subscr *)buf, subscrb, &sub)) if (tipc_subscrp_create(net, (struct tipc_subscr *)buf, subscrb, &sub))
return tipc_conn_terminate(tn->topsrv, subscrb->conid); return tipc_conn_terminate(tn->topsrv, subscrb->conid);
tipc_nametbl_subscribe(sub); if (sub)
tipc_nametbl_subscribe(sub);
} }
/* Handle one request to establish a new subscriber */ /* Handle one request to establish a new subscriber */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment