All of lore.kernel.org
 help / color / mirror / Atom feed
* [net  1/1] tipc: eliminate access after delete in group_filter_msg()
@ 2017-11-27 19:13 Jon Maloy
  2017-11-27 19:45 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Jon Maloy @ 2017-11-27 19:13 UTC (permalink / raw)
  To: davem, netdev
  Cc: mohan.krishna.ghanta.krishnamurthy, tung.q.nguyen, hoang.h.le,
	jon.maloy, canh.d.luu, ying.xue, tipc-discussion

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.

Signed-off-by: Jon Maloy <jon.maloy@ericsson.com>
---
 net/tipc/group.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/tipc/group.c b/net/tipc/group.c
index 12777ca..95fec2c 100644
--- a/net/tipc/group.c
+++ b/net/tipc/group.c
@@ -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;
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [net 1/1] tipc: eliminate access after delete in group_filter_msg()
  2017-11-27 19:13 [net 1/1] tipc: eliminate access after delete in group_filter_msg() Jon Maloy
@ 2017-11-27 19:45 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2017-11-27 19:45 UTC (permalink / raw)
  To: jon.maloy
  Cc: netdev, tipc-discussion, hoang.h.le, ying.xue,
	mohan.krishna.ghanta.krishnamurthy

From: Jon Maloy <jon.maloy@ericsson.com>
Date: Mon, 27 Nov 2017 20:13:39 +0100

> 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.
> 
> Signed-off-by: Jon Maloy <jon.maloy@ericsson.com>

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-11-27 19:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-27 19:13 [net 1/1] tipc: eliminate access after delete in group_filter_msg() Jon Maloy
2017-11-27 19:45 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.