From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Miller Subject: Re: [PATCH v2 net] net/ipv4: defensive cipso option parsing Date: Mon, 17 Sep 2018 19:38:48 -0700 (PDT) Message-ID: <20180917.193848.665124739870898989.davem@davemloft.net> References: <20180917174653.17046-1-snu@amazon.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, aams@amazon.de, dwmw@amazon.co.uk, yujuan.qi@mediatek.com, paul@paul-moore.com, sveith@amazon.de, stable@vger.kernel.org To: snu@amazon.com Return-path: In-Reply-To: <20180917174653.17046-1-snu@amazon.com> Sender: stable-owner@vger.kernel.org List-Id: netdev.vger.kernel.org From: Stefan Nuernberger Date: Mon, 17 Sep 2018 19:46:53 +0200 > commit 40413955ee26 ("Cipso: cipso_v4_optptr enter infinite loop") fixed > a possible infinite loop in the IP option parsing of CIPSO. The fix > assumes that ip_options_compile filtered out all zero length options and > that no other one-byte options beside IPOPT_END and IPOPT_NOOP exist. > While this assumption currently holds true, add explicit checks for zero > length and invalid length options to be safe for the future. Even though > ip_options_compile should have validated the options, the introduction of > new one-byte options can still confuse this code without the additional > checks. > > Signed-off-by: Stefan Nuernberger Applied to net-next. This is not 'net' nor -stable material. I'm hesitent about this change as-is, and ip_options_compile() is not changing semantics in -stable in the way that you say can cause problems.