Skip to content

Commit e0e853a

Browse files
Jon Maloydavem330
authored andcommitted
tipc: fix access of released memory
When the function tipc_group_filter_msg() finds that a member event indicates that the member is leaving the group, it first deletes the member instance, and then purges the message queue being handled by the call. But the message queue is an aggregated field in the just deleted item, leading the purge call to access freed memory. We fix this by swapping the order of the two actions. Signed-off-by: Jon Maloy <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent f9409e7 commit e0e853a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/tipc/group.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -539,8 +539,8 @@ void tipc_group_filter_msg(struct tipc_group *grp, struct sk_buff_head *inputq,
539539
tipc_group_proto_xmit(grp, m, GRP_ACK_MSG, xmitq);
540540

541541
if (leave) {
542-
tipc_group_delete_member(grp, m);
543542
__skb_queue_purge(defq);
543+
tipc_group_delete_member(grp, m);
544544
break;
545545
}
546546
if (!update)

0 commit comments

Comments
 (0)