Received: by 10.213.65.68 with SMTP id h4csp484217imn; Fri, 16 Mar 2018 09:08:11 -0700 (PDT) X-Google-Smtp-Source: AG47ELterR2oa9kSwb5J5hAXYNa4K86JedV3CS1mMU/jXInQzD7mKnag2HMPPt/OgXg0nfJJvmQB X-Received: by 10.99.158.9 with SMTP id s9mr1898161pgd.64.1521216491582; Fri, 16 Mar 2018 09:08:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521216491; cv=none; d=google.com; s=arc-20160816; b=DXq+J8CFpBYic7rnEw2m1WrldP/SzQiRm16v8OA/pC/ObFz8yQuwk8t+fgl+INGr8W L+0GRIuHH19yuKZauK+0VcmAEBj0ZMfmO9X9Xt7Ku+yUzblXRzUiL/HZ18ydE+FVJkv1 qE7ttE9mj/OeiODzBHk9utYMvKJgis5ux+uvKl2jsGFRHAZO3js3CEu+frWbS+UmNfS7 YD0xbk8SLm/XQQMGo3FzX80A7R1/G7osnxMowD0GK0s2kP7z3zICAGpxj0yr0m23+mOr kQK5eOTVR+tB8NhQ2yOZndlUW2itiLFg9WUVU6Ssv2DdJbynxvcltLzD9OKI+KDcuKSd Fb/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=AqSPoOyqjarANp6kXiJUSS2C+YetkSuHuxNODdzLCY0=; b=jt/1Z7WYmKMOWvmLZK0D6J2w8+hs11iAgfJFMf6u8dOVyB6Clz1Sc8PPJk9bG6avW5 oWsYXp1GKHlvdHsiKfu4uFGjVHqAjZrRig3ttd3e77kkj0c6rq7cr/ALcctuYoKMseYU +arK6svsp8CIGhPnLbk7NYiTezCHrfvB2r+4E1IuYIu9lub8zXK3mF69eMpsG3f5N/6R 72NIm4cjSN+J40bAHvMYKm3lg9uv3lTK2kwyh0tNhrNDvCtPUUIEBfB1reCR61zEed7K GlgetUfAM9wpqc1mRCJrb8sCy4TS1aNhChLltCNhtU0JYBomUxqORksnyJiz0y4ipblU W9AA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u21si5684503pfl.176.2018.03.16.09.07.56; Fri, 16 Mar 2018 09:08:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933513AbeCPQE4 (ORCPT + 99 others); Fri, 16 Mar 2018 12:04:56 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:44348 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754820AbeCPPmD (ORCPT ); Fri, 16 Mar 2018 11:42:03 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id C2E92E98; Fri, 16 Mar 2018 15:42:02 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yossef Efraim , Steffen Klassert , Sasha Levin Subject: [PATCH 4.15 065/128] xfrm: Fix xfrm_replay_overflow_offload_esn Date: Fri, 16 Mar 2018 16:23:26 +0100 Message-Id: <20180316152340.008611247@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180316152336.199007505@linuxfoundation.org> References: <20180316152336.199007505@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Yossef Efraim [ Upstream commit 0ba23a211360af7b6658e4fcfc571970bbbacc55 ] In case of wrap around, replay_esn->oseq_hi is not updated before it is tested for it's actual value, leading function to fail with overflow indication and packets being dropped. This patch updates replay_esn->oseq_hi in the right place. Fixes: d7dbefc45cf5 ("xfrm: Add xfrm_replay_overflow functions for offloading") Signed-off-by: Yossef Efraim Signed-off-by: Steffen Klassert Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- net/xfrm/xfrm_replay.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/net/xfrm/xfrm_replay.c +++ b/net/xfrm/xfrm_replay.c @@ -666,7 +666,7 @@ static int xfrm_replay_overflow_offload_ if (unlikely(oseq < replay_esn->oseq)) { XFRM_SKB_CB(skb)->seq.output.hi = ++oseq_hi; xo->seq.hi = oseq_hi; - + replay_esn->oseq_hi = oseq_hi; if (replay_esn->oseq_hi == 0) { replay_esn->oseq--; replay_esn->oseq_hi--; @@ -678,7 +678,6 @@ static int xfrm_replay_overflow_offload_ } replay_esn->oseq = oseq; - replay_esn->oseq_hi = oseq_hi; if (xfrm_aevent_is_on(net)) x->repl->notify(x, XFRM_REPLAY_UPDATE);