From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 Content-Type: text/plain 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/mMRALf6XlDdlxG4LXCYH6O8omzfnRYObkV2pvnf3Deu4v1/krUGvG+xWex7KiIYbAgycFJ9j1XZ1okyrkPkTH6r17E8xSfooWM0Kw22QJAevw8y8V8opZDPn2MRF8gmZ5dwHRkwvBUsmDa2bWM+5eBzdYImtISOY+HmwpivzQocrRu/KLpkIrj025VBJ1rKivUrgUB36JX7eyGV94QZ1fF4j1LAhRzyJA0w; 25:icn7OPthb898/cTXQH726qxckrW2aODFzqJsaZuNEAlO5wgk7CxTJHCtGS/+Y/i1pugOJhdi6GK1zfGt9zV/DusRac530jDw0vCwDYwU5ffXY0b1Sb4Uswuvgxlk9kRjz4ISS+Emqrr1JebBtfoB5RNuD2shtUk4MOwYwujnpjmEAHaggoLEwdKJLSDlH0/Uh6ItmypppqC18/MU/W7n/pStliJJbvDN+Fty+o76OdzxWth0cMTct++WXkeThpHMHhZFlHhEoLZsnRQcpUZVkYC8LrKFoRZEh8Rw+jyBue4FuE0ATbCI+WrMeYGlrWF0QBIfSM+chWZdTsg/AnNZLA==; 31:voJUjSzlYS8yQsPYmGdHrgnorNTvL2qCQWGmwsZyWvWn3arOgeNI+ox/XpeUMnNwBraVOj2vlQS4rkYXYhcAwHCg7iyFeCX/XOGTfsXmHIjDibwJuSLETMV8cC8NBcxYxXUYJ1JHsWp7cSc1Ty6OwmX/h0/g/hE1A+e2ucPEPmk9O996V+ZQUA58N6bxafPl9a9cAIhKoQRx/CSnfqr6sDUjbNlZnttl04Vd1XM+zVY= X-MS-TrafficTypeDiagnostic: DB3PR04MB0762: X-Microsoft-Exchange-Diagnostics: 1; DB3PR04MB0762; 20:Gov39qFhLskd2ZsXJjaMU0gQhAmwDJnXN3ujxEejW8pN4Ss8cKDzdbwMLtrib4NQ9HK9gaEdt3u2m0XMUUg+mSFJEPvrKtvxUy8JkwDjT48dDi4S2jWX0NWyzOIQE9TAKxbziiaGqWwW8H/eUxMU51JPPOQUZrZtyi1ER6NMnw3Z5kxQ8dgALCxMQ4g78aW/7KsD1ynr5m+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?= =?us-ascii?Q?jRCvzCaZusdJECz1R0Y75BA3v4SPcL2a5vqn+g+5g5nw/wtMIkoeUfOFoAqF?= =?us-ascii?Q?IsrnCP3IBfKAvz2ZEkWWMH4prq/xFQVnqaqY7qfiYdHFW6tXh6MXOn/+Elrc?= =?us-ascii?Q?eIxb2VX/Epe8am5FeCOII6/DcTRc+RswGy86Rkt0Gx7GY5i9IU0bo6VEJv/r?= =?us-ascii?Q?j9l/uYMK6rEuK6vSc3d+Q8mgE9ouArX0tKwhNMHnWyEXywFfQ6DO8B3lHeiK?= =?us-ascii?Q?ZOxlI+tPUPCi4GjmAedV6hikh6ln8r5aKR00P61PT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VXWt2UuQze0EMXZed6TymwKIX0imzQlf6HNv19oV7Vho/G?= =?us-ascii?Q?mm+RRCoQECZlhXAoAJpd4hSXmUNrpU2RF8WBKRnBuObjfHpfqf89e23xI/S3?= =?us-ascii?B?QT09?= X-Microsoft-Antispam-Message-Info: Nqoox3+x02Un4tcog6JByF/3vqVGjXlEgcuf8XqeW15Av/MXjXUKsHewu1zyDNmErryCUy/8AMWrdftpDQtDiHC8YWpIxb1U8vHqUScTbDNmSvVJa2XdWn7CBKvdBxhhToXbXRT52Igimiwa89WpddvbLIdcqPMQ5xjrRzRSJInsjnKx3UG1DENBw6YJ8QR3 X-Microsoft-Exchange-Diagnostics: 1; DB3PR04MB0762; 6:kolJtz72RurdABYVCL8G/FNslFeb67DDtx2ZBRFQgT7uKjMsjxVjl5OyO/KY4gfQLbWGXGQtPs1eer1IveAuUqmSIa4ilTiFjf4fidhowRL0We679LNQx6Vz/mncGLtuOCihQDHwNhEAxwYcfKo5IdaUXNOWq10qmBczCMrCbtmzxNXtc9tUkVQrHKRoMGOf9EP2GmnL1NOJkQafWX3wPtd8lsRopKHP4Hm1AlS31GV88ri+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: , X-List-Received-Date: Thu, 05 Apr 2018 08:56:24 -0000 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(-) 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] = -- 2.7.4