From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id E9ACDA0093 for ; Tue, 19 May 2020 15:12:05 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id DFD731D702; Tue, 19 May 2020 15:12:05 +0200 (CEST) Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) by dpdk.org (Postfix) with ESMTP id A93B31D70D for ; Tue, 19 May 2020 15:12:04 +0200 (CEST) Received: by mail-wm1-f65.google.com with SMTP id t8so729908wmi.0 for ; Tue, 19 May 2020 06:12:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=SF01BsV9WvFylMCyXvhGIfDdfG6PHW2ZkjNqP8XqY4c=; b=A36Xn1EoEt3DKauv/T++pBAPloDeU6fnCM0qi2Jw5gkCuFFgr6M5t3jLByZ/oH1h5b riusiopy7AT5G3A7kGgm0Iv/Eku3Q9tzLUb7cOao3yvaWDX9S3aAKXwgk4EjFqAWUhNg RDRx+KXGAnIVCOZoLcBSi4nkOgJ9Ed2iWBEHzkuMR4LmDXFWsIu8JK/P4UjV6VFLsr6G UMJwvkNde1EIy4k6geIPon9w6iB+gXLYiZu3H1W43/C/3biGbtwBBd4frPex5TQ6EInj TDF0KwxG6Vo4XhGUsSOPY+n51dq9y1cBR8KFkA28ETHfceuvaO9kzvkxI3MjD2SMzqkH /rBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=SF01BsV9WvFylMCyXvhGIfDdfG6PHW2ZkjNqP8XqY4c=; b=fxHs7nY1YgzqdFmjDugZEqMTPL1q1mciYj/dm4UO0QgAggpClBxpCxquin4C4M6CSs gWSjh1ppq2QUDoUCZ0lp4rg+EJMFVz1S9NuORGJ7OvSpSAw9xxxDZ1nCV8EYQxg/jg+x udlnn/t8Ktqo7HqxJLWHlYXDY4BW2FkuwFjC03oGxEuik4SHF7wK+Jk6nVRKy6cb9uxn UfvHjrF1gWjJ4NHnkHK4aQxtgQNAOI5QrbhwMnf6Jtg9bWLLy1K+ehVwbSFXbpwBWOdj FKsurC8r+WCWZO2Q4d/Zeiah8dY9EzbpeKKX5THYMbUjLI17eBz0ySFxG0+vG1j5G8pC 5BPQ== X-Gm-Message-State: AOAM530XJXSWB6Df+AuDL1hLGSwWZqajcl6wnDbsz9eI6owhu7G5w5KI pFG2Wm2ZLBpAgtBKFbq9m7k= X-Google-Smtp-Source: ABdhPJxBu16SOVMpcWCa7BtFH1Do7iT5QBTsYBVoLzIWpaJhYxzAtEreFUHLv6B7WqtSmJFSni9Rlw== X-Received: by 2002:a1c:bcc4:: with SMTP id m187mr5323646wmf.161.1589893923518; Tue, 19 May 2020 06:12:03 -0700 (PDT) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id q17sm4086642wmk.36.2020.05.19.06.12.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2020 06:12:03 -0700 (PDT) From: luca.boccassi@gmail.com To: Konstantin Ananyev Cc: Akhil Goyal , dpdk stable Date: Tue, 19 May 2020 14:04:11 +0100 Message-Id: <20200519130549.112823-116-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200519130549.112823-1-luca.boccassi@gmail.com> References: <20200519125804.104349-1-luca.boccassi@gmail.com> <20200519130549.112823-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'security: fix crash at accessing non-implemented ops' has been queued to stable release 19.11.3 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to stable release 19.11.3 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 05/21/20. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Thanks. Luca Boccassi --- >From 632fec749fda933bc9b25817165ad1bde21800ae Mon Sep 17 00:00:00 2001 From: Konstantin Ananyev Date: Thu, 23 Apr 2020 16:10:42 +0100 Subject: [PATCH] security: fix crash at accessing non-implemented ops [ upstream commit 34dff8bacc7b95cc288c24894443bd356e453b64 ] Valid checks for optional function pointers inside dev-ops were disabled by undefined macro. Fixes: b6ee98547847 ("security: fix verification of parameters") Signed-off-by: Konstantin Ananyev Acked-by: Akhil Goyal --- lib/librte_security/rte_security.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/librte_security/rte_security.c b/lib/librte_security/rte_security.c index d475b09771..dc9a3e89cd 100644 --- a/lib/librte_security/rte_security.c +++ b/lib/librte_security/rte_security.c @@ -108,10 +108,11 @@ rte_security_set_pkt_metadata(struct rte_security_ctx *instance, struct rte_mbuf *m, void *params) { #ifdef RTE_DEBUG - RTE_PTR_CHAIN3_OR_ERR_RET(instance, ops, set_pkt_metadata, -EINVAL, - -ENOTSUP); RTE_PTR_OR_ERR_RET(sess, -EINVAL); + RTE_PTR_OR_ERR_RET(instance, -EINVAL); + RTE_PTR_OR_ERR_RET(instance->ops, -EINVAL); #endif + RTE_FUNC_PTR_OR_ERR_RET(*instance->ops->set_pkt_metadata, -ENOTSUP); return instance->ops->set_pkt_metadata(instance->device, sess, m, params); } @@ -122,8 +123,10 @@ rte_security_get_userdata(struct rte_security_ctx *instance, uint64_t md) void *userdata = NULL; #ifdef RTE_DEBUG - RTE_PTR_CHAIN3_OR_ERR_RET(instance, ops, get_userdata, NULL, NULL); + RTE_PTR_OR_ERR_RET(instance, NULL); + RTE_PTR_OR_ERR_RET(instance->ops, NULL); #endif + RTE_FUNC_PTR_OR_ERR_RET(*instance->ops->get_userdata, NULL); if (instance->ops->get_userdata(instance->device, md, &userdata)) return NULL; -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-05-19 14:04:49.215022709 +0100 +++ 0116-security-fix-crash-at-accessing-non-implemented-ops.patch 2020-05-19 14:04:44.384651418 +0100 @@ -1,13 +1,14 @@ -From 34dff8bacc7b95cc288c24894443bd356e453b64 Mon Sep 17 00:00:00 2001 +From 632fec749fda933bc9b25817165ad1bde21800ae Mon Sep 17 00:00:00 2001 From: Konstantin Ananyev Date: Thu, 23 Apr 2020 16:10:42 +0100 Subject: [PATCH] security: fix crash at accessing non-implemented ops +[ upstream commit 34dff8bacc7b95cc288c24894443bd356e453b64 ] + Valid checks for optional function pointers inside dev-ops were disabled by undefined macro. Fixes: b6ee98547847 ("security: fix verification of parameters") -Cc: stable@dpdk.org Signed-off-by: Konstantin Ananyev Acked-by: Akhil Goyal