]> git.baikalelectronics.ru Git - kernel.git/commit
ipv6: avoid overflow of offset in ip6_find_1stfragopt
authorSabrina Dubroca <sd@queasysnail.net>
Wed, 19 Jul 2017 20:28:55 +0000 (22:28 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 20 Jul 2017 05:50:14 +0000 (22:50 -0700)
commit8c5875b238a0f6e16c857849639ac918882ed6d1
tree3bf30f18bbd1c9eb4b37786cba7fe73e70ea014b
parent7be800aaef0a033f32dc493215d22093e8751d3b
ipv6: avoid overflow of offset in ip6_find_1stfragopt

In some cases, offset can overflow and can cause an infinite loop in
ip6_find_1stfragopt(). Make it unsigned int to prevent the overflow, and
cap it at IPV6_MAXPLEN, since packets larger than that should be invalid.

This problem has been here since before the beginning of git history.

Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/output_core.c