]> git.baikalelectronics.ru Git - kernel.git/commit
ipv6: accept 64k - 1 packet length in ip6_find_1stfragopt()
authorStefano Brivio <sbrivio@redhat.com>
Fri, 18 Aug 2017 12:40:53 +0000 (14:40 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 22 Aug 2017 17:23:26 +0000 (10:23 -0700)
commit60e9235f595ca8f598fa74489be21b0075bfa3bf
treeaf00b05e50a42005c9e5a43c0d19964f1e0ae55a
parentdf89aeb2990bcedfc33cd8d2b92a6529355c9a14
ipv6: accept 64k - 1 packet length in ip6_find_1stfragopt()

A packet length of exactly IPV6_MAXPLEN is allowed, we should
refuse parsing options only if the size is 64KiB or more.

While at it, remove one extra variable and one assignment which
were also introduced by the commit that introduced the size
check. Checking the sum 'offset + len' and only later adding
'len' to 'offset' doesn't provide any advantage over directly
summing to 'offset' and checking it.

Fixes: 662645537c05 ("ipv6: avoid overflow of offset in ip6_find_1stfragopt")
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/output_core.c