Clear all networking block flags in NIC frees
authorBarret Rhoden <brho@cs.berkeley.edu>
Fri, 19 Sep 2014 00:11:49 +0000 (17:11 -0700)
committerBarret Rhoden <brho@cs.berkeley.edu>
Fri, 19 Sep 2014 00:11:49 +0000 (17:11 -0700)
These two NICs use their own free method.  They clear the old checksum
flags, but not the TSO flag.  While the NICs don't use those flags yet,
there could be a potential taint issue where that flag gets carried
around the stack by accident.  Better to clear the flags aggressively.

kern/drivers/net/ether82563.c
kern/drivers/net/etherigbe.c

index 7517b7a..59d1da6 100644 (file)
@@ -868,7 +868,7 @@ static void rbfree(struct block *b, int t)
 
        p = rbtab + t;
        b->rp = b->wp = (uint8_t *) ROUNDUP((uintptr_t) b->base, Rbalign);
-       b->flag &= ~(Bipck | Budpck | Btcpck | Bpktck);
+       b->flag &= ~BCKSUM_FLAGS;
 
        spin_lock_irqsave(&p->lock);
        b->next = p->b;
index 071a773..4d409f7 100644 (file)
@@ -828,7 +828,7 @@ igberbfree(struct block* bp)
 {
        bp->rp = bp->lim - Rbsz;
        bp->wp = bp->rp;
-       bp->flag &= ~(Bipck | Budpck | Btcpck | Bpktck);
+       bp->flag &= ~BCKSUM_FLAGS;
 
        ilock(&igberblock);
        bp->next = igberbpool;