From patchwork Wed Jan 24 16:00:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 125680 Delivered-To: patch@linaro.org Received: by 10.46.66.141 with SMTP id h13csp505762ljf; Wed, 24 Jan 2018 08:01:54 -0800 (PST) X-Google-Smtp-Source: AH8x225l+KT+IVdVGPpHDGAR+DHKvs5r3JR48UUmgja7UVjDZfFWkZjtWHKxyiii5X4tY+F8xIy2 X-Received: by 10.200.14.70 with SMTP id j6mr10648188qti.289.1516809714105; Wed, 24 Jan 2018 08:01:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516809714; cv=none; d=google.com; s=arc-20160816; b=Gl285+ho15ZuFXch1jnaXF3FQF5UPafxhvMdFFMdtSTGm0vLGQul73wBYs2TUF2rym A6me3kv1LKBg2CltfWWXdIqieUt8lGOOkQZ2gVH/0nlryt1oYo34LtWza9MWgPEhSpPs wD0mu1PEb0dcMm4rMCmgE6sq3lPC/xO+LFpCxA8jfM6lrC6H4sEKBskbgOtr+2xtYkS2 Fqk9flV0+LQznQk2V1Q4IIUOkLMDu92o+4jHb56A8RSOu3kzYksZ410907XqU80yYLrA 4aKhNURc/35sDtxCKyrK3OlalCdELOpyqSjV6DG+DMSQedrnLIKIKcmsdX58cuMdM21r ekUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=r9wao2uxHQHK8WObae6x6c1c596SfTkCGxpkWqMB4q0=; b=T9ELvv6U2ZUtBDs5n0/agV5JBbGnQVYSq+3OBkIjtwEO/AYFozl1TweEkHcjGhCQgE Fbaa+mq8B28oXHPTcgLjq0ri1f2X0/s1UguwdUVsAONmExg36iseoueaHLafSUv2ByAS 4B09JwRaLa5k26nLW/cF+QTvCRcpBj/y0WEdZihyzq8RdaDiY5rjTphdDGDByNCh2rPm 67qgrYHuyFteaulVsIt/AcXepIW1okoL32cBAVoOIvIWw3P7z1e8qWlrvR/KL5nqZkkc 553sB3hYoOk5vR//5vFVUtewDsk5T3R51PLp5IGJZ3rlHutsqnOtqyCUTzO+mW3LsCEN fG5g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id c72si474007qkb.394.2018.01.24.08.01.53; Wed, 24 Jan 2018 08:01:54 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id ACCBE6179C; Wed, 24 Jan 2018 16:01:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2 autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id E0D24617A5; Wed, 24 Jan 2018 16:00:31 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id DAEA261726; Wed, 24 Jan 2018 16:00:20 +0000 (UTC) Received: from forward102o.mail.yandex.net (forward102o.mail.yandex.net [37.140.190.182]) by lists.linaro.org (Postfix) with ESMTPS id 81111608A2 for ; Wed, 24 Jan 2018 16:00:12 +0000 (UTC) Received: from mxback8o.mail.yandex.net (mxback8o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::22]) by forward102o.mail.yandex.net (Yandex) with ESMTP id EF57C5A04877 for ; Wed, 24 Jan 2018 19:00:10 +0300 (MSK) Received: from smtp1j.mail.yandex.net (smtp1j.mail.yandex.net [2a02:6b8:0:801::ab]) by mxback8o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id wjvxyPljrj-0AaqK0Ji; Wed, 24 Jan 2018 19:00:10 +0300 Received: by smtp1j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id Q8SBLojAvI-0AsOdTds; Wed, 24 Jan 2018 19:00:10 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Wed, 24 Jan 2018 19:00:06 +0300 Message-Id: <1516809608-18061-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516809608-18061-1-git-send-email-odpbot@yandex.ru> References: <1516809608-18061-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 427 Subject: [lng-odp] [PATCH v1 2/4] linux-gen: ipsec: fix SA leak in odp_ipsec_sa_create X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" From: Dmitry Eremin-Solenikov It is possible to leave SA in reserved state while if antireplay options are unsupported. Free the SA in this case. Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 427 (lumag:ipsec-fix-sad) ** https://github.com/Linaro/odp/pull/427 ** Patch: https://github.com/Linaro/odp/pull/427.patch ** Base sha: 27480d82bd93a881ae683a3c314c11042a68ce29 ** Merge commit sha: 83482dc460d8a076de317029373e2c8bf3178974 **/ platform/linux-generic/odp_ipsec_sad.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/linux-generic/odp_ipsec_sad.c b/platform/linux-generic/odp_ipsec_sad.c index bb984db38..162626de0 100644 --- a/platform/linux-generic/odp_ipsec_sad.c +++ b/platform/linux-generic/odp_ipsec_sad.c @@ -289,7 +289,7 @@ odp_ipsec_sa_t odp_ipsec_sa_create(const odp_ipsec_sa_param_t *param) } if (param->inbound.antireplay_ws > IPSEC_ANTIREPLAY_WS) - return ODP_IPSEC_SA_INVALID; + goto error; ipsec_sa->antireplay = (param->inbound.antireplay_ws != 0); odp_atomic_init_u64(&ipsec_sa->in.antireplay, 0); } else {