Skip to content

Commit 049fa17

Browse files
Tuong Liendavem330
authored andcommitted
Revert "tipc: Fix potential tipc_node refcnt leak in tipc_rcv"
This reverts commit de05842. There is no actual tipc_node refcnt leak as stated in the above commit. The refcnt is hold carefully for the case of an asynchronous decryption (i.e. -EINPROGRESS/-EBUSY and skb = NULL is returned), so that the node object cannot be freed in the meantime. The counter will be re-balanced when the operation's callback arrives with the decrypted buffer if any. In other cases, e.g. a synchronous crypto the counter will be decreased immediately when it is done. Now with that commit, a kernel panic will occur when there is no node found (i.e. n = NULL) in the 'tipc_rcv()' or a premature release of the node object. This commit solves the issues by reverting the said commit, but keeping one valid case that the 'skb_linearize()' is failed. Acked-by: Jon Maloy <[email protected]> Signed-off-by: Tuong Lien <[email protected]> Tested-by: Hoang Le <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 11e877b commit 049fa17

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

net/tipc/node.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2038,7 +2038,6 @@ void tipc_rcv(struct net *net, struct sk_buff *skb, struct tipc_bearer *b)
20382038
n = tipc_node_find_by_id(net, ehdr->id);
20392039
}
20402040
tipc_crypto_rcv(net, (n) ? n->crypto_rx : NULL, &skb, b);
2041-
tipc_node_put(n);
20422041
if (!skb)
20432042
return;
20442043

0 commit comments

Comments
 (0)