aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSylvain Rochet <sylvain.rochet@finsecur.com>2015-04-26 14:40:53 -0400
committerDavid S. Miller <davem@davemloft.net>2015-04-26 23:25:13 -0400
commit03654763148f9a3878b8b70c30d1ffce2fca3dff (patch)
tree9bdcae74269b9fc448ca746aedf6b61cc6af3240
parent325301892a2d348323e09598ae108ba26889f7f9 (diff)
ppp: mppe: discard late packet in stateless mode
When PPP is used over a link which does not guarantee packet ordering, we might get late MPPE packets. This is a problem because MPPE must be kept synchronized and the current implementation does not drop them and rekey 4095 times instead of 0, which is wrong. In order to prevent rekeying about a whole count space times (~ 4095 times), drop packets which are not within the forward 4096/2 window and increase sanity error counter. Signed-off-by: Sylvain Rochet <sylvain.rochet@finsecur.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ppp/ppp_mppe.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/net/ppp/ppp_mppe.c b/drivers/net/ppp/ppp_mppe.c
index 692ee0ff0db1..05005c660d4d 100644
--- a/drivers/net/ppp/ppp_mppe.c
+++ b/drivers/net/ppp/ppp_mppe.c
@@ -533,6 +533,13 @@ mppe_decompress(void *arg, unsigned char *ibuf, int isize, unsigned char *obuf,
533 */ 533 */
534 534
535 if (!state->stateful) { 535 if (!state->stateful) {
536 /* Discard late packet */
537 if ((ccount - state->ccount) % MPPE_CCOUNT_SPACE
538 > MPPE_CCOUNT_SPACE / 2) {
539 state->sanity_errors++;
540 goto sanity_error;
541 }
542
536 /* RFC 3078, sec 8.1. Rekey for every packet. */ 543 /* RFC 3078, sec 8.1. Rekey for every packet. */
537 while (state->ccount != ccount) { 544 while (state->ccount != ccount) {
538 mppe_rekey(state, 0); 545 mppe_rekey(state, 0);