From patchwork Tue Apr 5 06:38:28 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Balakrishna Garapati X-Patchwork-Id: 65056 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp285468lbc; Mon, 4 Apr 2016 23:38:39 -0700 (PDT) X-Received: by 10.140.43.197 with SMTP id e63mr45938972qga.31.1459838319316; Mon, 04 Apr 2016 23:38:39 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id q16si25071980qkl.124.2016.04.04.23.38.39; Mon, 04 Apr 2016 23:38:39 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id E1BC861954; Tue, 5 Apr 2016 06:38:38 +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, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, URIBL_BLOCKED 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 38A02617FF; Tue, 5 Apr 2016 06:38:35 +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 9130861823; Tue, 5 Apr 2016 06:38:33 +0000 (UTC) Received: from mail-lb0-f178.google.com (mail-lb0-f178.google.com [209.85.217.178]) by lists.linaro.org (Postfix) with ESMTPS id 54F8C617F8 for ; Tue, 5 Apr 2016 06:38:32 +0000 (UTC) Received: by mail-lb0-f178.google.com with SMTP id qe11so2796584lbc.3 for ; Mon, 04 Apr 2016 23:38:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=9xHZvmAXbHtZGzYGf8xNKGPle2976OuBnomXjW7Lgp8=; b=dirtlSUA5vsq38fdJrZZ+A7AwtBvNmPJ7tHQUKGqvh8tuzbx8TgbNOeE0N3Taj6/1I kaTB39ux/xZ9Ww7zXTV5ZtIg6tAskri/fmvr6WF3jbGTZtvbVhRuOXD0u320tAt7sRvd LVlZVvHA0slN8XoH7h3z1o/zTdNiOWPF++QTPw+7pvZhm0s9nN+fQlCf6MttsaUoGadY Qs1ZLk9hzMQLwVzOLsIycnboifk5cAcXpAfsxbizLOMJ+uVRN7R2aMcRmW7+CSxvUrwh pn88KaQmumrFAAN4iZreSJN2W4Zse47/Cvj2TDc3Ph9tHtiBK/t5dJEpB9A7twsCV74x hf3Q== X-Gm-Message-State: AD7BkJK9NDIkABCzUiSlK10HrfaZgts8fsSea5LHasaOcTxBw+u/8z7BYdBasYjqSLP2q/nuw3o= X-Received: by 10.112.146.201 with SMTP id te9mr10187922lbb.9.1459838310609; Mon, 04 Apr 2016 23:38:30 -0700 (PDT) Received: from elxahtkds32.localdomain (host-95-192-225-247.mobileonline.telia.com. [95.192.225.247]) by smtp.gmail.com with ESMTPSA id 102sm5385341lfy.41.2016.04.04.23.38.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 04 Apr 2016 23:38:30 -0700 (PDT) From: Balakrishna Garapati To: bala.manoharan@linaro.org, maxim.uvarov@linaro.org Date: Tue, 5 Apr 2016 08:38:28 +0200 Message-Id: <1459838308-3866-1-git-send-email-balakrishna.garapati@linaro.org> X-Mailer: git-send-email 1.9.1 X-Topics: patch Cc: lng-odp@lists.linaro.org Subject: [lng-odp] [PATCHv2] test/performance:Avoid possible out-of-bounds memory access 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: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" Signed-off-by: Balakrishna Garapati --- v1: Fix for the https://bugs.linaro.org/show_bug.cgi?id=2136 v2: comments from v1 test/performance/odp_crypto.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) -- 1.9.1 diff --git a/test/performance/odp_crypto.c b/test/performance/odp_crypto.c index fe1c7b4..0ea0b1b 100644 --- a/test/performance/odp_crypto.c +++ b/test/performance/odp_crypto.c @@ -719,12 +719,12 @@ int main(int argc, char *argv[]) odp_pool_t pool; odp_queue_param_t qparam; odp_pool_param_t params; - odph_linux_pthread_t thr; odp_queue_t out_queue = ODP_QUEUE_INVALID; thr_arg_t thr_arg; - int num_workers = 1; odp_cpumask_t cpumask; char cpumaskstr[ODP_CPUMASK_STR_SIZE]; + int num_workers = 1; + odph_linux_pthread_t thr[num_workers]; memset(&cargs, 0, sizeof(cargs)); @@ -793,13 +793,15 @@ int main(int argc, char *argv[]) printf("Run in sync mode\n"); } + memset(thr, 0, sizeof(thr)); + if (cargs.alg_config) { if (cargs.schedule) { - odph_linux_pthread_create(&thr, &cpumask, + odph_linux_pthread_create(&thr[0], &cpumask, run_thr_func, &thr_arg, ODP_THREAD_WORKER); - odph_linux_pthread_join(&thr, num_workers); + odph_linux_pthread_join(&thr[0], num_workers); } else { run_measure_one_config(&cargs, cargs.alg_config); }