lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4BA4E000.1030206@iki.fi>
Date:	Sat, 20 Mar 2010 16:47:28 +0200
From:	Timo Teräs <timo.teras@....fi>
To:	Herbert Xu <herbert@...dor.apana.org.au>
CC:	netdev@...r.kernel.org
Subject: Re: [PATCH] ip_gre: include route header_len in max_headroom calculation

Timo Teräs wrote:
> Herbert Xu wrote:
>> On Sat, Mar 20, 2010 at 02:27:58PM +0200, Timo Teras wrote:
>>> diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
>>> index f47c9f7..f78402d 100644
>>> --- a/net/ipv4/ip_gre.c
>>> +++ b/net/ipv4/ip_gre.c
>>> @@ -810,11 +810,13 @@ static netdev_tx_t ipgre_tunnel_xmit(struct 
>>> sk_buff *skb, struct net_device *dev
>>>              tunnel->err_count = 0;
>>>      }
>>>  
>>> -    max_headroom = LL_RESERVED_SPACE(tdev) + gre_hlen;
>>> +    max_headroom = LL_RESERVED_SPACE(tdev) + gre_hlen + 
>>> rt->u.dst.header_len;
>>>  
>>>      if (skb_headroom(skb) < max_headroom || skb_shared(skb)||
>>>          (skb_cloned(skb) && !skb_clone_writable(skb, 0))) {
>>>          struct sk_buff *new_skb = skb_realloc_headroom(skb, 
>>> max_headroom);
>>> +        if (max_headroom > dev->needed_headroom)
>>> +            dev->needed_headroom = max_headroom;
>>
>> Are you sure about this? LL_RESERVED_SPACE already includes
>> dev->needed_headroom so won't this get bigger each time?
> 
> Whoops. Must've been after-midnight issue. And not noticed since the
> max_headroom won't change many times.
> 
> dev->needed_headroom should be compared against 
> gre_hlen+rt->u.dst.header_len.
> I'll send a fixed patch in a jiffy.

Actually, isn't the above right?

max_headroom is calculated with LL_RESERVED_SPACE of the tdev, which
is the interface to which the gre packet is being sent to, not the
gre interface. Thus, max_headroom won't include gre devices
previous needed_headroom.

- Timo
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ