Received: by 10.223.164.202 with SMTP id h10csp2825829wrb; Tue, 28 Nov 2017 01:50:57 -0800 (PST) X-Google-Smtp-Source: AGs4zMYJkfuS7akk4CWGmxLgSWsWmTCM1h0UasP3UKYYnYKXJkbpg6pnT1HAlGDBG1z1+pYOkR/Z X-Received: by 10.84.131.161 with SMTP id d30mr42105346pld.332.1511862657085; Tue, 28 Nov 2017 01:50:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511862657; cv=none; d=google.com; s=arc-20160816; b=C59mcAKlTsTa+GeBOrUkU0E4BVrC/K0nKoLV9E2J5ChBp97kRnLXV654X++JDBmj/B ZamWUZ2fyOi4I3fvG/a2A7JoiVSqCnwJuJW7kA+YMm1bxJeHIB6be73eS857VnYE2okY emikSLrYjOwnZi/wktDB/X4tNO1OdSfoZINTfCw9x/Gq3cT4TBaHCjv1uFKpFBXK/Wak lRkytIp/4tLuJElIVUsBcZp3wkJ8JicypRNCQTXVH+z3wz64sehw2oiRFgJ00UuhCHXs 0vdP00rZ6Hh9iferRQjQceMhJqAQd3EjUTC54eAbfZ4/y7K0/BiTf7p8QO9vSZNXuSqw 28jQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:message-id:date:subject:cc:to :from:dkim-signature:arc-authentication-results; bh=E+ShGah7mKEb82HDe9bX9fbFZ/6pJvRSnbOyDphHiaw=; b=DVbFjn36K9Y5+/HpHSs/4ZfyXggGUYs8+vy+K1ifa0bKtRjxmJW4CSfxa+gTeSm7K8 Lx+DOt2O7cDXkbwld9YrTKahNkpByGV4+1tF7YLwsbgQJrMQCUP17VNdFW5VZj69KkPi WYF+H7QDt8DIOq8n6tdfyDYgdnin9TvZKjETWEZHdkDVNlTHvHHc9p67ZawQuPHnKyKL +V97Nj9KM0JM6a+DuQvvXz90+i7JLR+M3unbN1Qzl8mXkbD3lKS7m6C7aA2lhVYrKkE7 Un1EaK0wvnqihUCcYmJvQWrmELkpLlcvNxPbAF9+VNBE7fkSe4GFGB1OymmP9t3giEgK aSLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@Mellanox.com header.s=selector1 header.b=UEt3dm8x; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=mellanox.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i185si24315655pgc.175.2017.11.28.01.50.45; Tue, 28 Nov 2017 01:50:57 -0800 (PST) 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; dkim=pass header.i=@Mellanox.com header.s=selector1 header.b=UEt3dm8x; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=mellanox.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752112AbdK1Jtt (ORCPT + 78 others); Tue, 28 Nov 2017 04:49:49 -0500 Received: from mail-ve1eur01on0075.outbound.protection.outlook.com ([104.47.1.75]:19136 "EHLO EUR01-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751130AbdK1Jtp (ORCPT ); Tue, 28 Nov 2017 04:49:45 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=E+ShGah7mKEb82HDe9bX9fbFZ/6pJvRSnbOyDphHiaw=; b=UEt3dm8xpZfrm103r21kGAYmrqyxgxi+McFnyuZxynIFiv60UTD8OAxSQVHfxxSCwFqweX3tjRQuh2e5jmubB7Qac8PNpNdxXFI8Z93sYe7OJiW9bjpQw67QZipDypLWLWXsrXpQ7fIJDtKGHTllCEUPS0RCxpwJ7Fq721sdpcA= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=yossefe@mellanox.com; Received: from dev-l-vrt-187.mtl.labs.mlnx (82.166.227.17) by AM0PR0502MB3745.eurprd05.prod.outlook.com (2603:10a6:208:1e::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.282.5; Tue, 28 Nov 2017 09:49:41 +0000 From: yossefe@mellanox.com To: "David S. Miller" , Steffen Klassert , Herbert Xu , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: borisp@mellanox.com, kliteyn@mellanox.com, yossiku@mellanox.com, Yossef Efraim Subject: [PATCH net-next 1/3] xfrm: Fix xfrm_replay_overflow_offload_esn Date: Tue, 28 Nov 2017 11:49:28 +0200 Message-Id: <1511862571-3494-1-git-send-email-yossefe@mellanox.com> X-Mailer: git-send-email 2.8.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [82.166.227.17] X-ClientProxiedBy: AM5PR0102CA0002.eurprd01.prod.exchangelabs.com (2603:10a6:206::15) To AM0PR0502MB3745.eurprd05.prod.outlook.com (2603:10a6:208:1e::14) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: c41260e3-9825-47ae-e5e1-08d536455943 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(48565401081)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603258);SRVR:AM0PR0502MB3745; X-Microsoft-Exchange-Diagnostics: 1;AM0PR0502MB3745;3:x1KDRltPzRSkQ3Kmhkh0WCRP3yDbBu48aE5n3GnH+6jmFQgdPsIRnOubf6czBrRFzGoCCFsegsbSNC1vw+BSk7NJ+8z27e0f04WXgZsjpaJ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TVB7pZFJ2GeOfcVB1J06vfpHH9YH3rraGFvqmydmIyacwDfkbMLQK2NBUpvYx8/OCqZKkRkOU9HAhnJFh3u49nOK++fS4axd/T0DD772TUTuSNGRemC0Jxwyt4qBe1P46+7Yk36TjII39F2P2VxnfYBfgEHHyvLgFkyKg/uVSSz3jQmZ35f4BSf72cPWvP3dZMjrzAosWuYEn43WHJbLSlRSLN6r/059drYowRp5mGyDX4;4:w/DbvAeuIsOYPzrG1EWgq5n/u1TtCE22KlEaBesjsNDmvz8hKuFDptqBsfTMeM1Nhoxosqu7/193TilO49MYiZyQf2XcayBOhWsj8qyu3tAhPS3KhvRNvok36q0vgQVJDMTgKhRnMcOzEDC6NaSugLNmUWRuLKKfmp7Xs8Xu9QdHnLIPsHy37OCM8zHNUD4Y6ULB+LtWK/fsW7HoYTZa/OC6fk8BaqRYCwZxtthPviAB863ed/+iekKZd5NlTxfSroTfpxMi3Q+QnQGwW8DR4g== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040450)(2401047)(5005006)(8121501046)(3002001)(3231022)(10201501046)(93006095)(93001095)(6055026)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123555025)(20161123564025)(20161123560025)(20161123558100)(6072148)(201708071742011);SRVR:AM0PR0502MB3745;BCL:0;PCL:0;RULEID:(100000803101)(100110400095);SRVR:AM0PR0502MB3745; X-Forefront-PRVS: 0505147DDB X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6009001)(39860400002)(366004)(376002)(346002)(199003)(189002)(66066001)(4326008)(68736007)(53936002)(6512007)(107886003)(9686003)(48376002)(50466002)(85782001)(6116002)(189998001)(86362001)(47776003)(3846002)(36756003)(52116002)(97736004)(51416003)(81166006)(81156014)(8676002)(8936002)(5660300001)(478600001)(316002)(33646002)(50226002)(7736002)(16526018)(6666003)(101416001)(110136005)(16586007)(106356001)(105586002)(2906002)(25786009)(50986999)(305945005)(6486002)(85772001);DIR:OUT;SFP:1101;SCL:1;SRVR:AM0PR0502MB3745;H:dev-l-vrt-187.mtl.labs.mlnx;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;AM0PR0502MB3745;23:oBL+xVxPR80vKO7Lk1FJC4f4IoURmc34QAWwelB?= =?us-ascii?Q?dxeg7ptm2O2mtaT0QrYwFYGvhE1NLmJ4JMwJJ+3MKRPs/uRDhrlZSgCpXs9i?= =?us-ascii?Q?KWO04MWLV7YEzV6HFTmgWJFlq7snAFuN92zajNytrz6w1ptKLl1lYUpM9LxB?= =?us-ascii?Q?NG428Od6LjxhLROD99r5fTcfLZewZsT6vCkRxg5znfwvSGNAVkK0uLIXuuqL?= =?us-ascii?Q?tJlY+of8EqSh4dIm0xO6bzckUtYyUfaDdKrV9HpFgc88Wxpmosp+UssB3N7T?= =?us-ascii?Q?jKZJ9JTT8nxoSpAX1HzuIRtQrhvMjUuuecovzL5Pyk635ZVe6uLED+q56Fe7?= =?us-ascii?Q?KoTT7d/ZmqxmgNe/r8M5a/+d2KpN7DngTxXSiTsferE56rOibLsw2AJQ+RoW?= =?us-ascii?Q?86u9XlNh4kI/CB7yTgE/YN1Ye3Yc4+PhFP7yv9GnrtTJGsbWFNbnn1m+tPkJ?= =?us-ascii?Q?3Cw80iok/Wakv1t+6nmJWI/CzW9wEY4Gs5FfK1xVQNNBHDl6yfMHc1rvFEB7?= =?us-ascii?Q?rmwkMCFKbfPzr8FPiaaLNuVjdqn2PITrswoR/YmBGmSA7ncogb0gAeHyc+L0?= =?us-ascii?Q?8BEFP5bDmu8hBZrEOJJ2rpkMUBp+/JbMd/nJY4zbHLTG8bRO1s/t265xppVk?= =?us-ascii?Q?3ODi+1QkyoYXIzKLM/r1Z58RbcyPvwW+tQKhPUGksbWuc60Fz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Cq5WbALqQDBcrkYEbzo738vos2ugjSLfIjW8SInV+zN6QDwyXozfTwnvVsUC75sdoh/SPb7R3ali6cHKK1JLE9c8=;24:W7jFHahMtm8Wg9JuWXpEClBGq4gmxA0K/7qEoNo9QJ8eRj7gMDPKoE1EjPy960E+nRp4z77dWem8yBWwnzGYxkEytCQ7kQn4JbwnuT02fiI=;7:XhaPx+vByvNjDd7Apm3goTOZxaEMULx+OZtvtFcgqcYPD75lEyJtnwlzQFnMHLIzxtMrP/2pVJIeV8xj05S6OFLffiu+3RTAynfX5ZpYiJMeErhIATIBAZ3z7N+jgfqcPUMyniIxkfdX3X7Zd7p8gAlbxpX7PnynHgaFeTBKZBMnF/AzxW13BG/ssKpqK6ffq9bjmRZcnh8pAw6kO4Qw4dVtfdJM734537DMPUiB3Yw5EaUt5CGfYMYcPoYUVGO3 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Nov 2017 09:49:41.2622 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c41260e3-9825-47ae-e5e1-08d536455943 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR0502MB3745 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yossef Efraim 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 --- net/xfrm/xfrm_replay.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/net/xfrm/xfrm_replay.c b/net/xfrm/xfrm_replay.c index 8b23c5b..0250181 100644 --- a/net/xfrm/xfrm_replay.c +++ b/net/xfrm/xfrm_replay.c @@ -666,7 +666,7 @@ static int xfrm_replay_overflow_offload_esn(struct xfrm_state *x, struct sk_buff 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_esn(struct xfrm_state *x, struct sk_buff } replay_esn->oseq = oseq; - replay_esn->oseq_hi = oseq_hi; if (xfrm_aevent_is_on(net)) x->repl->notify(x, XFRM_REPLAY_UPDATE); -- 2.8.1 From 1589374037213968239@xxx Fri Jan 12 08:19:58 +0000 2018 X-GM-THRID: 1585510570681691123 X-Gmail-Labels: Inbox,Category Forums,Downloaded_2018-01