From patchwork Thu Apr 5 08:54:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 132850 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp6031961ljb; Thu, 5 Apr 2018 01:56:52 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+Gsi2aShwmxUtsKYrN8MLhbtEU8L29SeuvJ8067cWPRPA3Gx3C9DgdiVKQdEykxuua+pSB X-Received: by 10.223.225.210 with SMTP id l18mr16722302wri.251.1522918612826; Thu, 05 Apr 2018 01:56:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522918612; cv=none; d=google.com; s=arc-20160816; b=q261YOkYhOV5q3ouCjJW9xiJkMp46iEchpoiNCAvnuBDFNOUbEXTEsZsb4VZ/1HFAf oc19DdaxmGDMHqNx5DcRYYR6e2l404y5214eQU8vhcerYtmQTnPrht+OzaKvce3Iv1xT EoliXjTmOKNceJkUoswQeIBWitaQ6uoF69hQbhIdr7Xq1xIJ7WiL3aSOd/ey9SH4yJCB FJ2c29f59Kq/vE51C6E66UwQnF8wD1ZvyyvVllPqta+GFuyGIvADDb6/O2NbGdakV1yK UV4w690NbVA5JyOjXC7RCrRUamrMExg43LdiM5lrct8yfECd8Fh/1cz5B8a8LyXBtH3J ClPg== 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:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:cc:to:from:dkim-signature:arc-authentication-results; bh=7KDABHzhsX4Qc0HuOwqMFzm9PmOgGQhJAGm/gEJWlaE=; b=LsR0S5eWwFv6yEQDD8X9/6SpS2EcHxFrT+4IbBIgkRWnINaLQovjlqTK9WqU97pqGs niuHS04+pWWKrSl2GoTzXHiSVb7a6vi83+/KCE1MZ+DFJx6ifGBdVTQCgrSDOAw3Hs6T y6QHFntYo3puv5i4QupYBN3eF6D5N+tcYA6B6Seq/yhzY92JnJ2ObdV9PTogRuSZclNB XQlDHMDhelYSup0IsZDoQAY/u5M/Nd9R6J6mM/t/KHVOe5sr5Os56NA73wdc9pJf+eCb 7fdrb+FyYqvL+aCcKxfBq8xn69pD2IcMO3bhSldmX4Q3xK1FqBeY/Un0780zaY+uzfoP cHNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=Yy6idkVG; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id i50si5260685wra.140.2018.04.05.01.56.52; Thu, 05 Apr 2018 01:56:52 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=Yy6idkVG; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 337FF1CA19; Thu, 5 Apr 2018 10:56:30 +0200 (CEST) Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0042.outbound.protection.outlook.com [104.47.0.42]) by dpdk.org (Postfix) with ESMTP id 1C6E81C9F6 for ; Thu, 5 Apr 2018 10:56:24 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=7KDABHzhsX4Qc0HuOwqMFzm9PmOgGQhJAGm/gEJWlaE=; b=Yy6idkVGbq2x95/mlx3nmrIynNYAk8DkEt90tIg9u7fkS8jldiSJ9f+TgUz99zK2EcBiWhpPsV+7PeNJcNMN6kyaMkY8KYZXRxw6WPyg+YC6njEtww98yx0cbk6iRYK/FLL64sjVCli7ZpZPeJXXWLbPc1W1EsH5D5VpXju1wf4= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=hemant.agrawal@nxp.com; Received: from bf-netperf1.ap.freescale.net (14.142.187.166) by DB3PR04MB0762.eurprd04.prod.outlook.com (2a01:111:e400:9440::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.631.10; Thu, 5 Apr 2018 08:56:21 +0000 From: Hemant Agrawal To: ferruh.yigit@intel.com Cc: dev@dpdk.org, shreyansh.jain@nxp.com Date: Thu, 5 Apr 2018 14:24:20 +0530 Message-Id: <1522918464-4586-4-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1522918464-4586-1-git-send-email-hemant.agrawal@nxp.com> References: <1522918464-4586-1-git-send-email-hemant.agrawal@nxp.com> MIME-Version: 1.0 X-Originating-IP: [14.142.187.166] X-ClientProxiedBy: MA1PR0101CA0043.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:22::29) To DB3PR04MB0762.eurprd04.prod.outlook.com (2a01:111:e400:9440::25) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: c61c0595-a5fc-456a-b2f8-08d59ad31b18 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:DB3PR04MB0762; X-Microsoft-Exchange-Diagnostics: 1; DB3PR04MB0762; 3:EqbQw6jp/AKBxH63D7uEQ0UQsTkv/mMRAL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ynr5m+CQ/X3sxG2QXjQU61Mwk9Fvej23x/Bn+nwgG8OMMpEsDKNtodXS70P2Z0DEvsa8vtD29asRemQ+mBx8UINXZpWCaEmoqlUddmzmvlMgnAINLJis1YThwqZlMGWdl33ag5F2Z6d7rvtTdpfFjELcvANs9DrohQ/rBFrQyRArVR0c02dVhXV41aUmBh+/cOKAt7aFHRKRcTUTB+U5Jgxu4cwDvgZoHedZ46uGxub75TCswVNmXsFKoXU0mik1QLahheLXdkPSU2VfTuCovvoqs85spJRpu1HRsvDt5TfqeEjVMJuPwBB3kXb; 4:gacCimG88YzpoFLuLJV75hK6qZqyA2Bte1O/sA7Vh232rs/4OZkPYY0mduIcEeaKdYDXZ9AaGwQB5G53Jdid6pPA+6Dx36rpLiFZYNALGzPyCMPae6wiQ0Dn9kgtzwzmljxOUNRXWKt00KcJy4DG6M4JveniaGdmUMLAOtQyDJ2A/flQqX6EC7/b1NvuA+Y521DV6oN2o0LaN6/UF4CV6IkysmECtmaBrC5TJCQKJJqj56meKuz03BlgO/T0Yvp8V9HgRoNjgo+XorqTU6VeD20xQfeRxpyeDmCYXjsG2/nbOcwREWmxOqmmhmrWyDfg X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3002001)(3231221)(944501327)(52105095)(93006095)(93001095)(10201501046)(6055026)(6041310)(20161123558120)(20161123564045)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:DB3PR04MB0762; BCL:0; PCL:0; RULEID:; SRVR:DB3PR04MB0762; X-Forefront-PRVS: 06339BAE63 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(396003)(366004)(376002)(346002)(39860400002)(39380400002)(189003)(199004)(76176011)(81166006)(53936002)(2361001)(2351001)(6916009)(25786009)(7736002)(476003)(50226002)(86362001)(81156014)(486006)(97736004)(105586002)(26005)(6512007)(52116002)(3846002)(11346002)(8936002)(446003)(16526019)(106356001)(51416003)(8676002)(386003)(48376002)(6486002)(47776003)(66066001)(68736007)(5660300001)(956004)(55236004)(478600001)(36756003)(6506007)(2906002)(2616005)(5009440100003)(59450400001)(305945005)(4326008)(6116002)(50466002)(186003)(316002)(16586007)(110426004); DIR:OUT; SFP:1101; SCL:1; SRVR:DB3PR04MB0762; H:bf-netperf1.ap.freescale.net; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DB3PR04MB0762; 23:9nTkQ90AKmFqm8qQ0GWdYk0J3Wn6l0LMT9rBnXRZq?= jRCvzCaZusdJECz1R0Y75BA3v4SPcL2a5vqn+g+5g5nw/wtMIkoeUfOFoAqFIsrnCP3IBfKAvz2ZEkWWMH4prq/xFQVnqaqY7qfiYdHFW6tXh6MXOn/+ElrceIxb2VX/Epe8am5FeCOII6/DcTRc+RswGy86Rkt0Gx7GY5i9IU0bo6VEJv/rj9l/uYMK6rEuK6vSc3d+Q8mgE9ouArX0tKwhNMHnWyEXywFfQ6DO8B3lHeiKZOxlI+tPUPCi4GjmAedV6hikh6ln8r5aKR00P61PTBF37mocAAKdk9tEu92drH1gQkjeiR0x5v5Xdkfo8MGkTtUwr5kUhau+5V/GI8bX3UbXm3FS9jkWtq2PqRXViEBqbtQlfCMoGMohwyY2IEdFnAUOZ5GHVQclfgfQeZl57feLTGA84aHgqdHl43U2Aj0pScZTDDokzDDa44Bps7bHkHLF013AJV5I63QKrDYhDs3XVNNWBLy7UPXOHti+Xak6Y9hRlmv6BWGNi1F1BI0Yl6DXkqC8wYwDFw4b2EAlywxKqWUqYjA43NG0J98KgDpPSCvleJocLS65YWn8Nf6v/qu+NqP0+PGkFPoTf9pDM6AmVl6orAgXaKtDo30KasnRE23jrbpZp4+0L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wPtd8lsRopKHP4Hm1AlS31GV88ri+C95KnKRlW2xCOqZR9QvgqYWukQaZHuYrNVXIRykrvrhLYae2Oj6Em+Ro2y1X4axNVYY9YESehNOdtQ5ZiPSGvDBD8BMhGcoQb33fq4dQDMV9wbzmQiZG+9CNAGAskjS7RC436UE0y7itYO7xDwxVKXCkmYYuFEnnXe6spjoeghnGAHEZ/SKz41WrGz1DQCyYYGab3mhRczbmJnNzymXl90uvTB3DE7CLJWQLyg==; 5:AXHm+xfLvhRPrN5V/YL4w+npyqwlC0maxCK/XDbTz/cnjHAXoJTEXfTkz6KOTyhyonr7tqNQ/txPa4RpxIAvTinX311nVhUNikdbqF6I9C1iDkLhAwZXynKWDOGxahTCqBcJYnqGQRJVyD4XWOZnluCVCxLkN23YH6HsuBFSOQ0=; 24:rLZaCL7BTUZAhz8h0V1cdQtvasRCEQNAAQ6uKR/UQen0mSdgoPHh++znN5PUrDyojNrPRri0zqC5vhBuLS4O8Kqj87fQvZ+S+WOITfod4Nw= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DB3PR04MB0762; 7:T946Dj2MPrBFKU6iotgPljbxwgpgULVef7D1fSa0xcw80nO8j1yg2erxCD43XwVm/zJ2gu/F1YD2lu/S+P03prKqj7q7Fm5cEDiGfYVf4qQAsrEHgw1K/gNQ6F4duLT8cKKMeBEml9hPtjLt4ixczPsfu3sOuSTBAjkM86YF6B06DZKfO047tUK/fDogwY3WFfNlvPTMSPcTXQ78tw5WGTwmUWciNkRCw/Rcq57O0w9CpHLLmJtnz1/Bz+yYMxje X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Apr 2018 08:56:21.6642 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c61c0595-a5fc-456a-b2f8-08d59ad31b18 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR04MB0762 Subject: [dpdk-dev] [PATCH 4/8] net/dpaa: fix the oob access X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Fixes: b21ed3e2a16d ("net/dpaa: support extended statistics") Coverity issue: 268318 Cc: stable@dpdk.org Signed-off-by: Hemant Agrawal --- drivers/net/dpaa/dpaa_ethdev.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) -- 2.7.4 Acked-By: Shreyansh Jain diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index 0aad111..cbdc4f2 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -339,6 +339,9 @@ dpaa_xstats_get_names(__rte_unused struct rte_eth_dev *dev, { unsigned int i, stat_cnt = RTE_DIM(dpaa_xstats_strings); + if (limit < stat_cnt) + return stat_cnt; + if (xstats_names != NULL) for (i = 0; i < stat_cnt; i++) snprintf(xstats_names[i].name, @@ -366,7 +369,7 @@ dpaa_xstats_get_by_id(struct rte_eth_dev *dev, const uint64_t *ids, return 0; fman_if_stats_get_all(dpaa_intf->fif, values_copy, - sizeof(struct dpaa_if_stats)); + sizeof(struct dpaa_if_stats) / 8); for (i = 0; i < stat_cnt; i++) values[i] =