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 24CC4A0093 for ; Tue, 19 May 2020 14:59:09 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1C0871D5E1; Tue, 19 May 2020 14:59:09 +0200 (CEST) Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by dpdk.org (Postfix) with ESMTP id B4F351C1E4 for ; Tue, 19 May 2020 14:59:07 +0200 (CEST) Received: by mail-wr1-f68.google.com with SMTP id k13so13716009wrx.3 for ; Tue, 19 May 2020 05:59:07 -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=Cz9NlSe+yQbdJlLUVmi5YluzAY+gSfjUuhbdYzQTCZE=; b=PXXdIGHrpZ5WgoxypZ2DwUVhZndwDm7FbADWGU/DJ+wLZwfe4vJ4lpfNdQWAtEYuo9 DCKqpkJ9amHzEHt1D8ZnxkHNoW8iRUhG4HdhQbFeEbd7Sop0DYeUofevHf/WA45N6Bfa 1he/VEUG4IgBpCP6DYiHhMrIgxBD6wPOccHWHkl/n5ZIOg1ONEY7fbOdtRKisWUw7e93 1rSLN2a2wySejMG6xat2tW1TYWmUpCqBKAjGRiwQtAQ0VpQkd8HjvPewNQPVK3UrSZDe nB5qHdN3404dtqoCaxiB9Fo6tENcL1fZnQeTaXOJKIH0O9OsDK6iLqJsDltteyFBPPaA Fedw== 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=Cz9NlSe+yQbdJlLUVmi5YluzAY+gSfjUuhbdYzQTCZE=; b=ZpEZPOHhhTDDIHr40i7uAEQCOIrLj8gKqTTUL0je68FKabEFBVM5ATl/R1caAhrcV3 soohM90ZHpISAIsKHZmepD9oYeJQOWSvmlvCtB7lmdHWv7WwsIE6ocXDTqs6qZ84EUsm ygJXtWjf4v72dyVmi8daJ4lcw6sPnf2TqdKCy7nkt9DyBzS3SqRY2aeBJZv5ESK87/fH D+C25091IOimELWuP17zrP/Za6vfGycH9KR0o1+bPYHu5zqoMWluejA0DomfvJd2N/X1 swAMEmUPUBqTfFCP3T7oqSGQg0PLb9mYXoDAQKPkp+wm3loL+Ggu68UGyEZxtP987526 blVg== X-Gm-Message-State: AOAM532rHc92Gd6IBqufP+I14cw6b9XJSiTuhWpIM9zx8HE9umeKJhxW 5Pt/Ai5LqsgKtFOjC7DzVGdRjCB7Xgmczh1y X-Google-Smtp-Source: ABdhPJxwK9LPU6b7ZFNRvbLfePwMvs/gj3UCVhsJHqPS41h60UXrZNeAqRzjeTaGm4cl+4b1Mm7GUw== X-Received: by 2002:a5d:6a01:: with SMTP id m1mr26945431wru.64.1589893147451; Tue, 19 May 2020 05:59:07 -0700 (PDT) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id t14sm16826796wrs.1.2020.05.19.05.59.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2020 05:59:06 -0700 (PDT) From: luca.boccassi@gmail.com To: Tao Zhu Cc: Xiaolong Ye , dpdk stable Date: Tue, 19 May 2020 13:53:32 +0100 Message-Id: <20200519125804.104349-22-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200519125804.104349-1-luca.boccassi@gmail.com> References: <20200519125804.104349-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/ice: fix hash flow crash' 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 aec781c6b1cb149b54ba4ca62420d0dbe1d9c68c Mon Sep 17 00:00:00 2001 From: Tao Zhu Date: Tue, 3 Mar 2020 13:38:46 +0800 Subject: [PATCH] net/ice: fix hash flow crash [ upstream commit f761def5125cf7dc23a15eb2bf57206f5930801e ] Commit 'dc36bd5dfdeb' mistakenly initializes ret as -rte_errno, then return ret if ice_search_pattern_match_item fails, if rte_errno happens to be 0 in this case, it would cause an unrecognized flow rule to be marked as recognition success. Later, when the code tries to parse the flow rule, a segmentation fault will occur due to null pointer reference. Fixes: dc36bd5dfdeb ("net/ice: fix flow FDIR/switch memory leak") Signed-off-by: Tao Zhu Reviewed-by: Xiaolong Ye --- drivers/net/ice/ice_hash.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/ice/ice_hash.c b/drivers/net/ice/ice_hash.c index d891538bd4..0e9c3c4e50 100644 --- a/drivers/net/ice/ice_hash.c +++ b/drivers/net/ice/ice_hash.c @@ -409,7 +409,7 @@ ice_hash_parse_pattern_action(__rte_unused struct ice_adapter *ad, void **meta, struct rte_flow_error *error) { - int ret = -rte_errno; + int ret = 0; struct ice_pattern_match_item *pattern_match_item; struct rss_meta *rss_meta_ptr; @@ -424,8 +424,10 @@ ice_hash_parse_pattern_action(__rte_unused struct ice_adapter *ad, /* Check rss supported pattern and find matched pattern. */ pattern_match_item = ice_search_pattern_match_item(pattern, array, array_len, error); - if (!pattern_match_item) + if (!pattern_match_item) { + ret = -rte_errno; goto error; + } ret = ice_hash_check_inset(pattern, error); if (ret) -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-05-19 13:56:19.717537222 +0100 +++ 0022-net-ice-fix-hash-flow-crash.patch 2020-05-19 13:56:18.203501531 +0100 @@ -1,8 +1,10 @@ -From f761def5125cf7dc23a15eb2bf57206f5930801e Mon Sep 17 00:00:00 2001 +From aec781c6b1cb149b54ba4ca62420d0dbe1d9c68c Mon Sep 17 00:00:00 2001 From: Tao Zhu Date: Tue, 3 Mar 2020 13:38:46 +0800 Subject: [PATCH] net/ice: fix hash flow crash +[ upstream commit f761def5125cf7dc23a15eb2bf57206f5930801e ] + Commit 'dc36bd5dfdeb' mistakenly initializes ret as -rte_errno, then return ret if ice_search_pattern_match_item fails, if rte_errno happens to be 0 in this case, it would cause an unrecognized flow rule to be @@ -11,7 +13,6 @@ reference. Fixes: dc36bd5dfdeb ("net/ice: fix flow FDIR/switch memory leak") -Cc: stable@dpdk.org Signed-off-by: Tao Zhu Reviewed-by: Xiaolong Ye