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]
Date:	Mon, 21 Nov 2011 16:00:17 +0100
From:	Patrick McHardy <kaber@...sh.net>
To:	Eric Dumazet <eric.dumazet@...il.com>
CC:	netfilter-devel@...r.kernel.org, netdev@...r.kernel.org,
	ulrich.weber@...hos.com
Subject: Re: [PATCH 10/17] netfilter: ipv6: expand skb head in ip6_route_me_harder
 after oif change

On 11/21/2011 11:29 AM, Eric Dumazet wrote:
> Le lundi 21 novembre 2011 à 06:46 +0100, kaber@...sh.net a écrit :
>> From: Patrick McHardy<kaber@...sh.net>
>>
>> Expand the skb headroom if the oif changed due to rerouting similar to
>> how IPv4 packets are handled.
>>
>> Signed-off-by: Patrick McHardy<kaber@...sh.net>
>> ---
>>   net/ipv6/netfilter.c |    7 +++++++
>>   1 files changed, 7 insertions(+), 0 deletions(-)
>>
>> diff --git a/net/ipv6/netfilter.c b/net/ipv6/netfilter.c
>> index 30fcee4..d39e954 100644
>> --- a/net/ipv6/netfilter.c
>> +++ b/net/ipv6/netfilter.c
>> @@ -14,6 +14,7 @@ int ip6_route_me_harder(struct sk_buff *skb)
>>   {
>>   	struct net *net = dev_net(skb_dst(skb)->dev);
>>   	const struct ipv6hdr *iph = ipv6_hdr(skb);
>> +	unsigned int hh_len;
>>   	struct dst_entry *dst;
>>   	struct flowi6 fl6 = {
>>   		.flowi6_oif = skb->sk ? skb->sk->sk_bound_dev_if : 0,
>> @@ -46,6 +47,12 @@ int ip6_route_me_harder(struct sk_buff *skb)
>>   	}
>>   #endif
>>
>> +	/* Change in oif may mean change in hh_len. */
>> +	hh_len = skb_dst(skb)->dev->hard_header_len;
>> +	if (skb_headroom(skb)<  hh_len&&
>> +	    pskb_expand_head(skb, hh_len - skb_headroom(skb), 0, GFP_ATOMIC))
>> +		return -1;
>> +
> Hmm, We had a problem recently on Tile arches because of unaligned
> accesses.
>
> Had you seen the bug report and proposed patch ?
>
> Fix is to instead do :
>
> 	pskb_expand_head(skb,
> 			 HH_DATA_ALIGN(hh_len - skb_headroom(skb)),
> 			 0,
> 			 GFP_ATOMIC);

I'll have a look and will update the patch accordingly.

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