On Mon, 2016-03-14 at 20:16 +0200, Saeed Mahameed wrote: > we can do special accounting for ooo like issues in the stack (maybe > count page references and sum up page sizes as you suggest), device > drivers shouldn't have special handling/accounting to protect against > such cases.
The existing skb->truesize is doing this already. The fact that some drivers use PAGE_SIZE/2 instead of PAGE_SIZE is an heuristic that is mostly okay, and we accept the risk : Even if a smart attack is happening, host will consume 200 XB instead of 100 XB. But pretending to use 128 bytes is simply a dangerous weapon over your head, since you end up consuming 1600 XB. With tcp_mem[2] being 18% of physical memory, you end up consuming all physical memory and crash. I can tell you that these kind of attacks are very real. I´ve seen them in action.