Re: mac80211 truesize bugs

Herbert Xu
2008-05-01T10:37:10Z

David Miller <davem@davemloft.net> wrote:
>
> diff --git a/net/mac80211/main.c b/net/mac80211/main.c
> index 9ad4e36..de2e904 100644
> --- a/net/mac80211/main.c
> +++ b/net/mac80211/main.c
> @@ -1485,6 +1485,9 @@ void ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb,
> rthdr = (struct ieee80211_tx_status_rtap_hdr*)
> skb_push(skb, sizeof(*rthdr));
> ^M
> + /* This is safe because the buffer has been orphaned. */
> + skb->truesize += sizeof(*rthdr);

skb->truesize should always account the skb->head area in its
entirety so we should never need to adjust it when pushing or
pulling. So I suggest we find the place that expanded the head
area and make the adjustment there. Alternative we could adjust
it right after the orphan call if the expansion occurs where we
can't adjust the truesize.

Cheers,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt