[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1283367885.2484.16.camel@edumazet-laptop>
Date: Wed, 01 Sep 2010 21:04:45 +0200
From: Eric Dumazet <eric.dumazet@...il.com>
To: Aaron Williams <awilliams@...eros.com>
Cc: netdev@...r.kernel.org
Subject: Re: skb allocation size question
Le mercredi 01 septembre 2010 à 11:51 -0700, Aaron Williams a écrit :
> Hi,
>
> I have been trying to track down an issue in one of our drivers with SKB
> allocation and in my research I came across something that seems a bit
> strange. In __alloc_skb, a block for the data allocates size + sizeof(struct
> skb_shared_info) bytes, yet skb->truesize is set to size + sizeof(struct
> sk_buff). Is there a reason for this discrepancy?
Hi Aaron
Not really. We also could add in truesize the sizeof(struct
skb_shared_info).
Including sizeof(struct sk_buff) is enough to prevent a malicious user
filling kernel memory with skb of one byte of payload.
Problem is, adding this extra overhead could slowdown some applications,
using too small RCVBUF / SNDBUF settings.
--
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