Skip to contentSkip to conversation

tipc: eliminate access after delete in group_filter_msg()

PATCH In review Jon Maloy 2 participants 2 messages Nov 27, 2017

Subsystems (3)
lore
Share & tools
lore

Jon Maloy

author
#0 lore raw

PATCH 1/1 tipc: eliminate access after delete in group_filter_msg()

KASAN revealed another access after delete in group.c. This time it found that we read the header of a received message after the buffer has been released.

---
 net/tipc/group.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/tipc/group.c +1 -1
index 12777ca..95fec2c 100644
@@ -497,6 +497,7 @@ void tipc_group_filter_msg(struct tipc_group *grp, struct sk_buff_head *inputq,
 	while ((skb = skb_peek(defq))) {
 		hdr = buf_msg(skb);
 		mtyp = msg_type(hdr);
+		blks = msg_blocks(hdr);
 		deliver = true;
 		ack = false;
 		update = false;
@@ -546,7 +547,6 @@ void tipc_group_filter_msg(struct tipc_group *grp, struct sk_buff_head *inputq,
 		if (!update)
 			continue;
 
-		blks = msg_blocks(hdr);
 		tipc_group_update_rcv_win(grp, blks, node, port, xmitq);
 	}
 	return;
Signature · 1 line
2.1.4
maintainer
#1 lore raw

From: Jon Maloy <[email protected]>
Date: Mon, 27 Nov 2017 20:13:39 +0100

Quoted 5 lines

KASAN revealed another access after delete in group.c. This time it found that we read the header of a received message after the buffer has been released.

Looks good, 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