From patchwork Mon Jan 29 15:00:11 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: 126170 Delivered-To: patch@linaro.org Received: by 10.46.84.92 with SMTP id y28csp2513484ljd; Mon, 29 Jan 2018 07:06:34 -0800 (PST) X-Google-Smtp-Source: AH8x2246b2rz/GtI3U70bUDSKmmNt9kqmFcEj/wC1F7moCGV01zyqZUddo56WUQAvvqzoXwFIK6b X-Received: by 10.37.191.202 with SMTP id q10mr12181239ybm.63.1517238225592; Mon, 29 Jan 2018 07:03:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517238225; cv=none; d=google.com; s=arc-20160816; b=cb0CWiRzMMdTmZkirgSq80UQ0YCPlYImeCvZyv1/f/KnDGqbRcEGdKz4A797eeWIZt XI6iJjq5b6Nu2xa9jNgTf0MhU0MnRI6kbb3y4lmTPrVo5n0HnGGioEzeA82PIFcYGQp0 jphxAs9hHEABnR5WNoacuwea2BcowhTQmlwLVLviQ+TyW37m2CWW09eZw+IA7t+wyGmw fUFneqsBKIeC6sixcEJHgcKjrnk2DG4wf+QgZ6hrvBZ8bkld99ZUP9pb+90ZqjnU6Eio hNyEIT5/FIj7iIuFhCiZj1C3GSR/N+JnR51mYEL9gnRICmBNFQyjO6cTCOesr2SIAktI YdYQ== 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=i+YdgmxE0ws2CTHZs+/Et+Y/G8n5F0QBVgUXZEwasMg=; b=NcQfypDtPOLiFvJ9JY2tt/4SJ/JdAwgiEKsNYmvBIAPKb6DHlDXD5cc18HO2yxb9le lbF95G9TvE/QDfoQtSHJJBgLqNbYQb2/wHhXjbcUnFdfCt9KE1xdduumy7jm/kuaWP5x SDKG5duDW/H2QBcYhizgMPEbsH+gUQQKpGjQh9jNw1aY5hw8qQVobze4Ar9eo1wlxJXv 8b6FvgVSZ4OsUEry0KgM3jBlOdc1bESvTukOnrq5l3fqwUAvOfajS463dqbchVfmmpxD s8/c2s5JxWr1bRV3jp0qmZWzp/5MNtl4tk2sBHM/AmCrYWiMqxQFN4q4HBwGfID36/oT jEVw== 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 o50si675886qtb.313.2018.01.29.07.03.45; Mon, 29 Jan 2018 07:03:45 -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 3AAA56172B; Mon, 29 Jan 2018 15:03:45 +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 B0EE161739; Mon, 29 Jan 2018 15:00:46 +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 3ACAC60813; Mon, 29 Jan 2018 15:00:29 +0000 (UTC) Received: from forward100p.mail.yandex.net (forward100p.mail.yandex.net [77.88.28.100]) by lists.linaro.org (Postfix) with ESMTPS id 31DBD60834 for ; Mon, 29 Jan 2018 15:00:20 +0000 (UTC) Received: from mxback7g.mail.yandex.net (mxback7g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:168]) by forward100p.mail.yandex.net (Yandex) with ESMTP id 9982D510270A for ; Mon, 29 Jan 2018 18:00:18 +0300 (MSK) Received: from smtp1o.mail.yandex.net (smtp1o.mail.yandex.net [2a02:6b8:0:1a2d::25]) by mxback7g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id dkC1FYEfya-0IG4nn8H; Mon, 29 Jan 2018 18:00:18 +0300 Received: by smtp1o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id ZIlIkHp1bF-0HU4ofco; Mon, 29 Jan 2018 18:00:17 +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: Mon, 29 Jan 2018 18:00:11 +0300 Message-Id: <1517238014-22220-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1517238014-22220-1-git-send-email-odpbot@yandex.ru> References: <1517238014-22220-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 427 Subject: [lng-odp] [PATCH v2 2/5] 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: 67c9dbf28c41ea7a53782ba841276b03f154c4ef **/ 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 {