]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
tipc: eliminate access after delete in group_filter_msg()
authorJon Maloy <jon.maloy@ericsson.com>
Mon, 27 Nov 2017 19:13:39 +0000 (20:13 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 27 Nov 2017 19:44:45 +0000 (14:44 -0500)
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tipc/group.c

index 12777cac638a6918a626953647a1bf803ced89ad..95fec2c057d6ebdb223e19ef83bf9c383cb2156e 100644 (file)
@@ -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;