From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on0058.outbound.protection.outlook.com [104.47.1.58]) by dpdk.org (Postfix) with ESMTP id E18CF1B7BE; Mon, 9 Apr 2018 12:25:54 +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=hp+/hxuGPz7CptGzxCHgM/TDreOSOnKptDM4TUYoXzA=; b=M+CfCgOx+HnCcRuG7rKsv1Ks2XrkuKLoU52+DzZWcmfkGuOzELwDEAqL0hpl3QHG9IPJeCxbJpwlsH3tZGLyU3a1fximQyzR+F7c39ndM+4X+73t/99HJs6xzB+pzJ+1yXUvV6Gvmhz1+iZ8pTs/O6Ai4x9pu2Y7qG9PWHGgPFg= 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 AM2PR04MB0756.eurprd04.prod.outlook.com (2a01:111:e400:8411::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.653.12; Mon, 9 Apr 2018 10:25:52 +0000 From: Hemant Agrawal To: dev@dpdk.org Cc: ferruh.yigit@intel.com, stable@dpdk.org Date: Mon, 9 Apr 2018 15:52:47 +0530 Message-Id: <1523269371-28799-4-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1523269371-28799-1-git-send-email-hemant.agrawal@nxp.com> References: <1522918464-4586-1-git-send-email-hemant.agrawal@nxp.com> <1523269371-28799-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: PN1PR0101CA0067.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:d::29) To AM2PR04MB0756.eurprd04.prod.outlook.com (2a01:111:e400:8411::16) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: ed1bbc1f-a51b-42bf-77bc-08d59e0445ef X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:AM2PR04MB0756; X-Microsoft-Exchange-Diagnostics: 1; AM2PR04MB0756; 3:96kQWyYorHIX3m8gP6GfLU2FIUQ0gOVj8SSKvQor21aeZPK1z22x0GQm5r5ZhTAVkV5raGaFfzb5jEStrfggZK20+TK6lo9TARJrFhP8v+I4V+XPaR6/SNv2WNn2+JTaXtoGwy+C5esDQ2BLIyhVwZmUxrNvRK/3++kU9to2ecbkMYxLswDsiEmzAxtC9xJ1e5MsDNrLbnctPpH90M5vcQ3Zb2zuFzkkHmXQlabCcbRx/zkTp1IY/j11845YnCqb; 25:/nIMmPvB7fbx8D7wRkORcV2G4VnysSSnjdviyMzfoavfM+lj/9eKTz/+cSjTEHp8Qb83p+4sTp5B/aAJJ3uVeBnzYxJa047/ohFcQSZ3o+yqZIAnBUqkSumgVhUaTarKtl2TA82YtND1TWurwOVyIzx/6cFljXPbnXkJsLIaLlg+FHd20lX6Z4LJw4BvDDSB0tGpuWjMo0mOkq5oyCXkNavmscQRwv7z8bUGi1Q5QROGU1rMaAf9CUL9pmAQNfX9tE2ejHwBSQm00u6/+ggGrmo9pyO4mpIZtXEIBPqImMstC3lWKQU8h7RRpEPajs6Pt5bS/ExZe/cRxULzczac7A==; 31:gbAScsSAlFgfXk2eSCs4wzpOiGen4HiEXP/Kk0G6ao0ZnMBheGMd0DAUNDTjLMwo8IXe5X3ayVp+eyMIO6H5c7DnpSdwCGGwFI4o2G9PCpsSIhpXgKD34CTMx1Sk6v7Ha/V52WR+nCERFbAG7JaNfbeEaRHS+hu+5oYY6BSBYqiknfr/KCJj1Rz9xsduyFvN8RbJ9gYtAEXCyhWz+Wa0IuKNTe2s3eq2RdL0kp/LHdE= X-MS-TrafficTypeDiagnostic: AM2PR04MB0756: X-Microsoft-Exchange-Diagnostics: 1; AM2PR04MB0756; 20:7fUR54rXaAjS3tNvkivRuv2ktPud93pTIHko8OLq6ycPmE9v6o1th2Qrhd0aCzxh4rJEFCheDYjkEzJnz4QKYamragowmPACWLHAack0LJpv7xd01pM3SdY692b2WbO4Mma3eagVcoiJpput3sYHIP3I1tdDoL+WiZIYc0Hktj9M3Y+naM1nqkKzvltH95mtd7zgjWMvlW8b8QYcHY24YpC97bi+R1omfhdkKBXsvOphf8eP1WKtKUVBWSpt2iPpZtA5k+NPrJrYS4JUCAMqjWQO+hUTxJs4zreTKxfJgZzfo31jP2N8cGjUXpARRMtKyNEVD1nhAqqUDQPwEeCS6dbOupLhPNa6BjmzeiekIus4gTzJh6/mzGpls7ImOrV/2RWdxRc7JnG4OXbtpgcRH24TEwgUJtmWRV1+Y6JPnjRUm9IXBc8Bv64cF3vHRn9Cd3SEm4jk3LGpy+wyZjQgyXYGXse4TH/B2O9IU0ufg/jhhQP64kIBVeUZf2HYObGU; 4:3Ni4LA0vD8/IhZL+oBFhzevrGCWZs9EM3INDGwD3r1jOm5HJ7iDXMQ0j833gkxzcI4hMYRfWhDD+fHIdAsxxx3hVefHGkTLuomTrpuphvCbZbZYkL4PgC67Dn44i+3XgINTxe8IuBN6Xc4q4DboP6sxNVSkIc6oNCfsxDc+iUXm0bjRMRoPeCV3TcBsoULojeWjMtSi6DFJlyk0+Tcip+fZv0fN7H+M0wtn6JKjKY/63JU70at/ivnkCFQnyyECtwkwqM/eHm3GwO7nvBrSKETvF5BfBuCpdNUuldXb+OTJfRmhTfd/tEFkgfVJ9LaN8 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)(93006095)(93001095)(3002001)(10201501046)(3231221)(944501327)(52105095)(6055026)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123560045)(20161123558120)(20161123562045)(6072148)(201708071742011); SRVR:AM2PR04MB0756; BCL:0; PCL:0; RULEID:; SRVR:AM2PR04MB0756; X-Forefront-PRVS: 0637FCE711 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(376002)(346002)(39380400002)(39860400002)(396003)(366004)(199004)(189003)(36756003)(48376002)(50466002)(8936002)(6486002)(6916009)(81156014)(50226002)(6666003)(81166006)(8676002)(106356001)(68736007)(316002)(16526019)(3846002)(16586007)(2351001)(2361001)(47776003)(2616005)(26005)(6506007)(386003)(59450400001)(55236004)(66066001)(6116002)(305945005)(97736004)(76176011)(7736002)(956004)(52116002)(51416003)(476003)(486006)(53936002)(186003)(2906002)(86362001)(4326008)(6512007)(25786009)(446003)(5660300001)(478600001)(105586002)(5009440100003)(11346002)(110426004); DIR:OUT; SFP:1101; SCL:1; SRVR:AM2PR04MB0756; H:bf-netperf1.ap.freescale.net; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM2PR04MB0756; 23:mfVPc7khji7k4dmRP80fElqf8FYiI6s1Wv9i/kC7B?= =?us-ascii?Q?eJlKwK7DLOQpCT5SkXU9m3OGkAmd/s7IOw8BjFJp67/skM0tnTcHQQDrMqjF?= =?us-ascii?Q?hN7zO9NVnCoYK23Cw30heYSMHKY80g+AYI+EE++QkIbLTe83+p6EWXU7IwJC?= =?us-ascii?Q?6Td/1ScaIVggvvvRiAgHSCPeqt6144i/hgEPrOllmVlCxFORodQjw/2Yw6vU?= =?us-ascii?Q?v1eKfvdHWJsZuq0Pfs1aDXaw+CvvrCGG+pi1Fzna1psIi+V0B0NTUmcjEuxP?= =?us-ascii?Q?OT8/a7CN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vGGI61+N6SrSD4u9XEY=; 24:8Olrkt+fC4yeRTovU0X14RNiqTR2LD3tPsB2KfdIAmpKCCDB8Ts6qJ/OpaAkh+v+X0PEduqVe5+RUO0aPjlaqixvl7/TgtgziWHlWJc7aEc= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; AM2PR04MB0756; 7:cfd3DFuMeR4jFpIGRnqMMA+Of/gXOjzesJ3jrqikIF0C2rN+w/1q6sIvHNpJuu+vXeP6hc9qKdQ0DHqRXuJNFtgiGLna/8+1Tl62GLWLdwTzIPRHfvTzf9ydypwLBESeDhmouRhx0HsYY7rGh424+9qE2P4g9OrxJk4W4v8fiXnHy0KbZBAtsMH4BkG6JNBXJyjoFYgmOAoP+8NPxinbQ5rK4n0yXgxP4qTs/4SE8xTW9gMeci7W1B/T2xmSkViT X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Apr 2018 10:25:52.5360 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ed1bbc1f-a51b-42bf-77bc-08d59e0445ef X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM2PR04MB0756 Subject: [dpdk-stable] [PATCH v2 4/8] net/dpaa: fix the oob access 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: , X-List-Received-Date: Mon, 09 Apr 2018 10:25:55 -0000 Fixes: b21ed3e2a16d ("net/dpaa: support extended statistics") Coverity issue: 268318 Cc: stable@dpdk.org Signed-off-by: Hemant Agrawal Acked-By: Shreyansh Jain --- drivers/net/dpaa/dpaa_ethdev.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index 0aad111..581e3a0 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -335,10 +335,13 @@ dpaa_dev_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstat *xstats, static int dpaa_xstats_get_names(__rte_unused struct rte_eth_dev *dev, struct rte_eth_xstat_name *xstats_names, - __rte_unused unsigned int limit) + unsigned int limit) { 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