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:   Tue, 06 Nov 2018 14:41:14 -0800 (PST)
From:   David Miller <davem@...emloft.net>
To:     edumazet@...gle.com
Cc:     netdev@...r.kernel.org, eric.dumazet@...il.com
Subject: Re: [PATCH net-next] ipv6: gro: do not use slow memcmp() in
 ipv6_gro_receive()

From: Eric Dumazet <edumazet@...gle.com>
Date: Tue,  6 Nov 2018 14:25:52 -0800

> +		if (unlikely(nlen > sizeof(struct ipv6hdr))) {
> +			if (memcmp(iph + 1, iph2 + 1,
> +				   nlen - sizeof(struct ipv6hdr)))
> +				goto not_same_flow;
> +		}

Is this even possible?

	off = skb_gro_offset(skb);
	hlen = off + sizeof(*iph);
	iph = skb_gro_header_fast(skb, off);

off is some offset to the ipv6hdr in skb.  This is GRO's CB data_offset.

	skb_set_network_header(skb, off);
	skb_gro_pull(skb, sizeof(*iph));
	skb_set_transport_header(skb, skb_gro_offset(skb));

Set network header to location of iph in SKB.

GRO pull causes an incremebt of data_offset by sizeof(*iph) bytes.

Set transport header to new data_offset value.

	nlen = skb_network_header_len(skb);

This is transport_header - network_header.

>From what I can see, it is impossible for this to take on any value
other than sizeof(*ipv6hdr).

If you agree, please let's get rid of nlen and this useless code, and
replace with sizeof(*ipv6hdr) as needed.

Thanks.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ