提交 4de13d7e 编写于 作者: P Parthasarathy Bhuvaragan 提交者: David S. Miller

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: NAnders Widell <anders.widell@ericsson.com>
Signed-off-by: NParthasarathy Bhuvaragan <parthasarathy.bhuvaragan@ericsson.com>
Acked-by: NJon Maloy <jon.maloy@ericsson.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 11f7f79b
...@@ -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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册