[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20100920.085857.98907191.davem@davemloft.net>
Date: Mon, 20 Sep 2010 08:58:57 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: amit.salecha@...gic.com
Cc: eric.dumazet@...il.com, netdev@...r.kernel.org,
ameen.rahman@...gic.com, anirban.chakraborty@...gic.com
Subject: Re: [PATCH] qlcnic: dont assume NET_IP_ALIGN is 2
From: Amit Salecha <amit.salecha@...gic.com>
Date: Mon, 20 Sep 2010 06:16:31 -0500
> Though I have one doubt. We are allocating larger packets than the actual data used.
> Doesn't it will break accounting ?
No, it will "fix" accounting.
You must charge to the SKB all of the non-shared memory that was
allocated to the SKB.
This means even if the packet only uses 128 bytes of the SKB
data area, you must still account for the full blob of linear
memory that was allocated for the SKB data area in skb->truesize.
Otherwise remote attackers could consume enormous amounts of memory by
tricking our socket accounting via carefully sized packets.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists