From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40047.outbound.protection.outlook.com [40.107.4.47]) by dpdk.org (Postfix) with ESMTP id 3DB3B2C54 for ; Fri, 27 Jul 2018 04:31:39 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=IcRLaTpEU1AVrsEscnMbV4mTwT9mZehYJ2cR1i9HD+Q=; b=i7z3WEU/WtjvuUSurUTRKmaeYKFxM7Q+LuoDl7XQGu5+cLVMQ2tmv0YddCo6J6pOitmOPeu5/kdl1lOoOg6WTpHS/n5+swu7kvQRik9iIOmpqNNePv/ksSBSzl583ETfBvttyx8VY8ZVyveyRLqlFKx8ToOtSNokInnHR3+GJ0o= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=yskoh@mellanox.com; Received: from mellanox.com (209.116.155.178) by VI1PR0501MB2046.eurprd05.prod.outlook.com (2603:10a6:800:36::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.973.20; Fri, 27 Jul 2018 02:31:37 +0000 From: Yongseok Koh To: Remy Horton Cc: Ferruh Yigit , dpdk stable Date: Thu, 26 Jul 2018 19:31:08 -0700 Message-Id: <20180727023108.38699-10-yskoh@mellanox.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180727023108.38699-1-yskoh@mellanox.com> References: <20180727023108.38699-1-yskoh@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [209.116.155.178] X-ClientProxiedBy: BL0PR02CA0084.namprd02.prod.outlook.com (2603:10b6:208:51::25) To VI1PR0501MB2046.eurprd05.prod.outlook.com (2603:10a6:800:36::20) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 153c7517-dd6f-48b8-d8e5-08d5f3691468 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600074)(711020)(4618075)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060)(7193020); SRVR:VI1PR0501MB2046; X-Microsoft-Exchange-Diagnostics: 1; VI1PR0501MB2046; 3:3TzKfj/tG1WUWTvKX4WzITTRKgEmSYZN0m2VS4WZzrcByDmuoWjvJiMybhrE3yYOUGJzU+c5p0+JSoW4oGg86srwk12Ztmk8m96f84RVS6Oto/5lhNLSpCth5Pzf4cXZMylScg4LhZ0y5rhC3eY4jNo/+8Tgl+AuuZUuJh9JhUQ1FEDN0N0v5MLINfHVVNWUIMfuUKV/v0F4q7nNoa2VcBXXjJMUFt6b4W7FkymVNoNAAiMraAXI4lyD4kue6ERE; 25:9W5jUyFnCtD7FM0zLm8Cqsk5hRR9gDhXxDrIDkvnhtrZTsP1FUfLxmIubvP9rPztfy+Jaz+mx4A1k9B5UoZaLL5zC4E9MZCsg9/2gJgdbF597MQxbFZIYrQzrz7ECoRFznQj4HADxzWBA1MfVqcd4vrV+aNth0jOa/SPDqXSG251R6lzF1U26Ob9QPXPVY1EHWOD3z6vzHzpi+V45s79uBzlI1uD/TVb4fp5XCWK30aDWG59XPblY63HFV2ppu5Y3lK8kEJUTaYAgPyI4ckzuElX+ZV835ecRHWvlLA9y/v87BGVeMbm9VHUZf/AJXfT4rVlP0fl2+InjUEFXjTqcg==; 31:p+D4zaEYT9qRjSrRL86HFeexSjCYpVsODEQmTxAiZ2LETjY64rlectmHKcLTgKYtuveR15KmmUoYqMp2q4qhOSyyUxzV0ISSRonYOJRc42HxZ78QevNIGFS49NsFbbAkrN2494Gi1Xz7ikz+B0cIyy/99ck/+PhO1ypcJReKg0/fUI6MHwHCtL3hVG4lWbWp5sXjrsQBbqV+Q0lUs3VB+Gfbbc2s+bQJWpzHI0ModCc= X-MS-TrafficTypeDiagnostic: VI1PR0501MB2046: X-Microsoft-Exchange-Diagnostics: 1; VI1PR0501MB2046; 20:2a4ujXL8XcPV33dilTz0D3g3jzWQl1otsbxXjuTqCJu7zXsp7NRHttzCJxrkb8LiVZajlX4m64DILVTF7FHt58McEN4pUc8MvRa/xZV/G1DLLz3MGIkixHhNApLvxfcA3VWXbW4QOE/rVTNn4B4/k8eXyBlf0Pj8Y/hHsvJNvnr6dk4mfAOVv1QyjOnNl2ekX2W74LBSWOWejZGmASl7hpvAjxOst23oVZtU+ihRds2M1OC6EUFoT8c2qcTsG37LzlhOmICqDtyRfzsGeHNK5sQZOPGvIVDxyVZeD/pi0eyq+QFsfiuekBUc+bD/j1KGXVhuqmtckAQICw1vntv42PcMPU92wjUn5F06Fj3SuMtAKbSdUIY7/OBRez6eVkEHaej9GLp0t9oQ0/LX70WtAv2mJYhv3JGuwJ7wDDn4XqiBGL8++5d3QSe7Nl/fB5AxU3UfOoQgtf0yC6qOd19mpvW98LYFzfY3OsFYLgmFvAAzLEHynKa5n6te1I3zH1qS; 4:XysFj+geRTjPL7P5ldL5/ayTN012uPqJgawaMT3i/3zU/4vLqjYcxSCYnFtCTt3jQrACwIXKRabRz/Z9uzTHT45VL7UioyAOXbPlCXf2ehMfy+9W3ygpF9uRgUREPMhT30f8y19k4BEw/fKBsKhzXQaU843nPmQoc9AlPsjGkCgHucmQ/W/4MfPM93Nch2R4K4NwHVlTLtPB5ln6TOZ8WC5aAfXJkYLKsCbIWLjzwXIUa40CrOLV95TLb0s5FeWVZT8Kd7eaRrrlPsJ0ujdOpaJAYWw9q5cD5UBmZuNhI2uBTY1VQJoxVuDzrSEqX8s5 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(228905959029699); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3002001)(10201501046)(93006095)(93001095)(3231311)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016); SRVR:VI1PR0501MB2046; BCL:0; PCL:0; RULEID:; SRVR:VI1PR0501MB2046; X-Forefront-PRVS: 07467C4D33 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39860400002)(376002)(366004)(136003)(346002)(396003)(189003)(199004)(69234005)(28163001)(186003)(53546011)(26005)(86362001)(51416003)(16526019)(3846002)(11346002)(6666003)(8936002)(36756003)(386003)(76176011)(7696005)(25786009)(446003)(52116002)(575784001)(97736004)(486006)(53376002)(4326008)(6916009)(2616005)(476003)(5660300001)(69596002)(956004)(966005)(54906003)(81166006)(81156014)(55016002)(7736002)(16586007)(47776003)(106356001)(2906002)(305945005)(48376002)(66066001)(105586002)(53936002)(68736007)(6116002)(21086003)(1076002)(50226002)(6306002)(478600001)(50466002)(8676002)(316002)(1720100001); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0501MB2046; H:mellanox.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; VI1PR0501MB2046; 23:DKPMOSpeeicFxSD1DXyeU0x9WW+6IbN+r/hUmEX?= =?us-ascii?Q?CgnvPmZXR2DPDN/X5aNvhx6EoCk2P+CS2Ohp4Bk6CQQxcxGA+3UHvnpGe/mu?= =?us-ascii?Q?EvW9mYqo2F4gQD/Oj0G8yZo1xmoxwWlESPimEqcHBP0oRNQ2be7NcYcWuCTL?= =?us-ascii?Q?wu0hs4rCn+BIVgyM0WbySrJ7rRp5Md5a3POQLoGE8jNzShuulN83sSm16AbH?= =?us-ascii?Q?UQNS3HCH2mAOY01pzkYh+2qdpAhSaIF2gpF5CscMqCCiD0eF3Y8RKsAolMw2?= =?us-ascii?Q?v9ys8vX+V4HgvLmviaN8LsptgQst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2savUGrAQnt3+iHpxOfGYYk27i73ZzZsi2+33CM8vKgWUuOyoAMl/pzqXGmUJO4uDewLkcq7CcQw==; 5:K/CkyFld6yh+GTUS1hNEgzF1sNn/a1wef9zMGYl+UMgC5aT4mZ/yg2kNuBbyMHJ2yd6EsfGvEJMJk50GATnb2OPevI2ly6hkrFfPJgMTntltGCVdy0DHZcNYfOgTDfdfa7g7tM43VugJPLAaoKcmofpsexlK54dgNYIZbyyO7F4=; 7:b1GkuhZhFfpMDR6ew66rYVaisVyX8rBHewpSjjH6pLZbetYKPoRdjp0K6oc3DlfWjxW1i3KBpzaMb+rD5iNtWWnySYhc0qmR998A6NngDHgyROkWawfT7BUtptuAg+hv01GPHYMhOhYkvIfJIdCwC2WP4fjbnWQNltTA5yyCmpszaaeDzN8s9EpYymjV2Nx/g9Nfq4XGPfMxnwcnzXwKhcjCxVH6ZQhDn9FaC+pm38Xify2EhzS0f5T1ifWUkWAZ SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2018 02:31:37.2011 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 153c7517-dd6f-48b8-d8e5-08d5f3691468 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0501MB2046 Subject: [dpdk-stable] patch 'bitrate: add sanity check on parameters' has been queued to LTS release 17.11.4 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: Fri, 27 Jul 2018 02:31:39 -0000 Hi, FYI, your patch has been queued to LTS release 17.11.4 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 07/28/18. So please shout if anyone has objections. Thanks. Yongseok --- >>From 1c3504e59136e150e014a7cde1c31f2dbaeb7fa5 Mon Sep 17 00:00:00 2001 From: Remy Horton Date: Thu, 12 Jul 2018 11:49:48 +0100 Subject: [PATCH] bitrate: add sanity check on parameters [ upstream commit 90b0e5aaf4e3a56a4dac57aceb425930450cec85 ] If rte_stats_bitrate_reg() or rte_stats_bitrate_calc() are passed NULL as the parameter for the stats structure, the result is a crash. Fixed by adding a sanity check that makes sure the passed-in pointer is not NULL. Fixes: 2ad7ba9a6567 ("bitrate: add bitrate statistics library") Signed-off-by: Remy Horton Acked-by: Ferruh Yigit --- lib/librte_bitratestats/rte_bitrate.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/librte_bitratestats/rte_bitrate.c b/lib/librte_bitratestats/rte_bitrate.c index f373697a7..d39edbf62 100644 --- a/lib/librte_bitratestats/rte_bitrate.c +++ b/lib/librte_bitratestats/rte_bitrate.c @@ -76,6 +76,9 @@ rte_stats_bitrate_reg(struct rte_stats_bitrates *bitrate_data) }; int return_value; + if (bitrate_data == NULL) + return -EINVAL; + return_value = rte_metrics_reg_names(&names[0], ARRAY_SIZE(names)); if (return_value >= 0) bitrate_data->id_stats_set = return_value; @@ -94,6 +97,9 @@ rte_stats_bitrate_calc(struct rte_stats_bitrates *bitrate_data, const int64_t alpha_percent = 20; uint64_t values[6]; + if (bitrate_data == NULL) + return -EINVAL; + ret_code = rte_eth_stats_get(port_id, ð_stats); if (ret_code != 0) return ret_code; -- 2.11.0