Cipso: cipso_v4_optptr enter infinite loop
authoryujuan.qi <yujuan.qi@mediatek.com>
Mon, 31 Jul 2017 03:23:01 +0000 (11:23 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 5 Sep 2018 07:20:05 +0000 (09:20 +0200)
commite8e519f8ec33ce670abef2cfc0613ec26319841e
treef1fef8bfede5a83e0870fe96d501842387fbb40e
parentfe0034a08b49a25ad91376e03045dc2e7bcf3647
Cipso: cipso_v4_optptr enter infinite loop

commit 40413955ee265a5e42f710940ec78f5450d49149 upstream.

in for(),if((optlen > 0) && (optptr[1] == 0)), enter infinite loop.

Test: receive a packet which the ip length > 20 and the first byte of ip option is 0, produce this issue

Signed-off-by: yujuan.qi <yujuan.qi@mediatek.com>
Acked-by: Paul Moore <paul@paul-moore.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/ipv4/cipso_ipv4.c