Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752071AbbDZTBo (ORCPT ); Sun, 26 Apr 2015 15:01:44 -0400 Received: from mx-guillaumet.finsecur.com ([91.217.234.131]:46576 "EHLO guillaumet.finsecur.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751077AbbDZTBm (ORCPT ); Sun, 26 Apr 2015 15:01:42 -0400 X-Greylist: delayed 1244 seconds by postgrey-1.27 at vger.kernel.org; Sun, 26 Apr 2015 15:01:42 EDT From: Sylvain Rochet To: Paul Mackerras , linux-ppp@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, "David S. Miller" Cc: Sylvain Rochet Date: Sun, 26 Apr 2015 20:40:51 +0200 Message-Id: <1430073653-22131-1-git-send-email-sylvain.rochet@finsecur.com> X-Mailer: git-send-email 2.1.4 X-SA-Exim-Connect-IP: 172.16.8.13 X-SA-Exim-Mail-From: sylvain.rochet@finsecur.com Subject: [PATCH 0/2] ppp: mppe: fixes MPPE desync on links which don't guarantee packet ordering X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) X-SA-Exim-Scanned: Yes (on guillaumet.finsecur.com) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1653 Lines: 43 I am currently having an issue with PPP over L2TP (UDP) and MPPE in stateless mode (default mode), UDP does not guarantee packet ordering so we might get out of order packet. MPPE needs to be continuously synched so we should drop late UDP packet. I added a printk on the number of time we rekeyed in MPPE decompressor, this is what we currently have if we receive a slightly out of order UDP packet: [1731001.049206] mppe_decompress[1]: ccount 1559 [1731001.049216] mppe_decompress[1]: rekeyed 1 times [1731001.049228] mppe_decompress[1]: ccount 1560 [1731001.049232] mppe_decompress[1]: rekeyed 1 times [1731001.050170] mppe_decompress[1]: ccount 1562 [1731001.050182] mppe_decompress[1]: rekeyed 2 times [1731001.050191] mppe_decompress[1]: ccount 1561 [1731001.062576] mppe_decompress[1]: rekeyed 4095 times ^^^^ This is obviously wrong, we missed packet 1561 and we already rekeyed 2 times for 1562 we previously received, we can't recover the decryption key we need for 1561, we should drop it instead of rekeying 4095 times. This patch series drop any packet with are not within the 4096/2 forward window. Sylvain Rochet (2): ppp: mppe: sanity error path rework ppp: mppe: discard late packet in stateless mode drivers/net/ppp/ppp_mppe.c | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/