From patchwork Thu Jan 25 06:00:16 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: 125771 Delivered-To: patch@linaro.org Received: by 10.46.66.141 with SMTP id h13csp891451ljf; Wed, 24 Jan 2018 22:02:27 -0800 (PST) X-Google-Smtp-Source: AH8x225ybpWx7vD2IovUzRFtgUDLMpYhvAZaKYfvT5pM1ALPS7buPMYLdYa5A3KQKdisVF2r5yXR X-Received: by 10.55.187.135 with SMTP id l129mr12665016qkf.322.1516860147157; Wed, 24 Jan 2018 22:02:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516860147; cv=none; d=google.com; s=arc-20160816; b=elik8g+QNV27gtpShxOwjNFv7xeK/u8jT5o3SoWAyyD6+2LoonAOXByFo79VTcSlWX pD9XT089/0w8G7vu91z8nSnzYYc4JxGYVGrhTo5Cf8Nu3oxmwIrE9nFKGEk7f6CgP6/E 3T7p2EYdRRnS5DUDueq+enMjAyYlNgIl53FKNaMGSlj8zd9xraHgjajMIDWJFeTImYcC KG4nmWm5s8iVvt8xZP1mweJRlsbDjXyiHEQafmnxPvk7CO2L4BQS8KAo1IudQ/jp8QdW stkEG7VLVFf1YzXBY5wMf/94RZKNxZwV2sLuhpux7Dj9jBzHzIhPt+4w+XeUyOVtYmMY UZ1g== 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=ac2SpztU4DnYYlkFqu4P1qX/ClE6y5SJ7BJBoqIKQp8=; b=TefhVn29AoDacXnhy7mcsYf1qnRDBWhdW/gyjNjOiIWzBSslHvh8nUYR3auOIgpWGW 5zFLsFOPbVw3mOf0ET1PuIn6fpCyWTbS1c1Xg7DtM6UqvFH7puFwFuKWhr/WIhsdkN9L iAWEuW1FievsDmemsLkcTOjPlXGw0hls96rCBm0zeN9qLp58W6z6EFR3tFNPFCiwSV6u ZdWYA+AcBKfwy7ePSs0Kx1ca09eIpc5AQaePD7IlApkwWcGbAPOfzucJPWzJACI2Higg H3okcwPdPRUa/aCqf7u/8TKed0LQlWhoKGaPGQfy/XBUO6AHrFmYdV2QKMAWVb+uE/r0 Xy9g== 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 s6si1811555qke.226.2018.01.24.22.02.26; Wed, 24 Jan 2018 22:02:27 -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 C1990617A5; Thu, 25 Jan 2018 06:02:26 +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 3BAC861728; Thu, 25 Jan 2018 06:01:29 +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 71BCC60974; Thu, 25 Jan 2018 06:01:23 +0000 (UTC) Received: from forward104o.mail.yandex.net (forward104o.mail.yandex.net [37.140.190.179]) by lists.linaro.org (Postfix) with ESMTPS id 5C05960974 for ; Thu, 25 Jan 2018 06:00:30 +0000 (UTC) Received: from mxback14g.mail.yandex.net (mxback14g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:93]) by forward104o.mail.yandex.net (Yandex) with ESMTP id 0D6FE703768 for ; Thu, 25 Jan 2018 09:00:18 +0300 (MSK) Received: from smtp3p.mail.yandex.net (smtp3p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:8]) by mxback14g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id fM8FLYYHpl-0H0SDPrh; Thu, 25 Jan 2018 09:00:18 +0300 Received: by smtp3p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id jjsvSVXJIR-0Hien8bH; Thu, 25 Jan 2018 09: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: Thu, 25 Jan 2018 09:00:16 +0300 Message-Id: <1516860016-16876-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516860016-16876-1-git-send-email-odpbot@yandex.ru> References: <1516860016-16876-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 407 Subject: [lng-odp] [PATCH v3 1/1] linux-gen: cls: fix: invalid queue handle check for hashing 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: Balasubramanian Manoharan invalid queue handle check should not be done for hash queues Fixes: https://bugs.linaro.org/show_bug.cgi?id=3577 Signed-off-by: Balasubramanian Manoharan --- /** Email created from pull request 407 (bala-manoharan:BUG3577) ** https://github.com/Linaro/odp/pull/407 ** Patch: https://github.com/Linaro/odp/pull/407.patch ** Base sha: 984686b0763495c6dd97d2094f292fc7e01937d0 ** Merge commit sha: 18b90b4441f835f917682914975ce35c8bf1affe **/ platform/linux-generic/odp_classification.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/platform/linux-generic/odp_classification.c b/platform/linux-generic/odp_classification.c index 668b41eb1..85353a12f 100644 --- a/platform/linux-generic/odp_classification.c +++ b/platform/linux-generic/odp_classification.c @@ -988,8 +988,10 @@ int cls_classify_packet(pktio_entry_t *entry, const uint8_t *base, if (cos == NULL) return -EINVAL; - if (cos->s.queue == ODP_QUEUE_INVALID || - cos->s.pool == ODP_POOL_INVALID) + if (cos->s.queue == ODP_QUEUE_INVALID && cos->s.num_queue == 1) + return -EFAULT; + + if (cos->s.pool == ODP_POOL_INVALID) return -EFAULT; *pool = cos->s.pool;