From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id B22771B517 for ; Fri, 30 Nov 2018 00:13:05 +0100 (CET) Received: from Internal Mail-Server by MTLPINE1 (envelope-from yskoh@mellanox.com) with ESMTPS (AES256-SHA encrypted); 30 Nov 2018 01:18:57 +0200 Received: from scfae-sc-2.mti.labs.mlnx (scfae-sc-2.mti.labs.mlnx [10.101.0.96]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id wATNCW7I032075; Fri, 30 Nov 2018 01:13:02 +0200 From: Yongseok Koh To: Martin Harvey Cc: Andrew Rybchenko , dpdk stable Date: Thu, 29 Nov 2018 15:10:12 -0800 Message-Id: <20181129231202.30436-18-yskoh@mellanox.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20181129231202.30436-1-yskoh@mellanox.com> References: <20181129231202.30436-1-yskoh@mellanox.com> Subject: [dpdk-stable] patch 'net/sfc/base: check size of memory to read sensors data to' has been queued to LTS release 17.11.5 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: Thu, 29 Nov 2018 23:13:06 -0000 Hi, FYI, your patch has been queued to LTS release 17.11.5 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 12/01/18. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. If the code is different (ie: not only metadata diffs), due for example to a change in context or macro names, please double check it. Thanks. Yongseok --- >>From 6db57d4b336ba6bbb55529ad87f93c0510536fd7 Mon Sep 17 00:00:00 2001 From: Martin Harvey Date: Mon, 10 Sep 2018 10:33:15 +0100 Subject: [PATCH] net/sfc/base: check size of memory to read sensors data to [ upstream commit 252faf84f41e6d726d3ab0f9b7544723756afcca ] Size of provided memory should be consistent with specified size. Fixes: dfb3b1ce15f6 ("net/sfc/base: import monitors access via MCDI") Signed-off-by: Martin Harvey Signed-off-by: Andrew Rybchenko --- drivers/net/sfc/base/mcdi_mon.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/net/sfc/base/mcdi_mon.c b/drivers/net/sfc/base/mcdi_mon.c index 6fe6a22c4..50ade2002 100644 --- a/drivers/net/sfc/base/mcdi_mon.c +++ b/drivers/net/sfc/base/mcdi_mon.c @@ -318,6 +318,12 @@ efx_mcdi_read_sensors( uint8_t payload[MAX(MC_CMD_READ_SENSORS_EXT_IN_LEN, MC_CMD_READ_SENSORS_EXT_OUT_LEN)]; uint32_t addr_lo, addr_hi; + efx_rc_t rc; + + if (EFSYS_MEM_SIZE(esmp) < size) { + rc = EINVAL; + goto fail1; + } req.emr_cmd = MC_CMD_READ_SENSORS; req.emr_in_buf = payload; @@ -335,6 +341,11 @@ efx_mcdi_read_sensors( efx_mcdi_execute(enp, &req); return (req.emr_rc); + +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); } static __checkReturn efx_rc_t -- 2.11.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2018-11-29 15:01:46.086143930 -0800 +++ 0018-net-sfc-base-check-size-of-memory-to-read-sensors-da.patch 2018-11-29 15:01:44.999964000 -0800 @@ -1,12 +1,13 @@ -From 252faf84f41e6d726d3ab0f9b7544723756afcca Mon Sep 17 00:00:00 2001 +From 6db57d4b336ba6bbb55529ad87f93c0510536fd7 Mon Sep 17 00:00:00 2001 From: Martin Harvey Date: Mon, 10 Sep 2018 10:33:15 +0100 Subject: [PATCH] net/sfc/base: check size of memory to read sensors data to +[ upstream commit 252faf84f41e6d726d3ab0f9b7544723756afcca ] + Size of provided memory should be consistent with specified size. Fixes: dfb3b1ce15f6 ("net/sfc/base: import monitors access via MCDI") -Cc: stable@dpdk.org Signed-off-by: Martin Harvey Signed-off-by: Andrew Rybchenko @@ -15,10 +16,10 @@ 1 file changed, 11 insertions(+) diff --git a/drivers/net/sfc/base/mcdi_mon.c b/drivers/net/sfc/base/mcdi_mon.c -index 93e6b1e35..68bbc575d 100644 +index 6fe6a22c4..50ade2002 100644 --- a/drivers/net/sfc/base/mcdi_mon.c +++ b/drivers/net/sfc/base/mcdi_mon.c -@@ -194,6 +194,12 @@ efx_mcdi_read_sensors( +@@ -318,6 +318,12 @@ efx_mcdi_read_sensors( uint8_t payload[MAX(MC_CMD_READ_SENSORS_EXT_IN_LEN, MC_CMD_READ_SENSORS_EXT_OUT_LEN)]; uint32_t addr_lo, addr_hi; @@ -31,7 +32,7 @@ req.emr_cmd = MC_CMD_READ_SENSORS; req.emr_in_buf = payload; -@@ -211,6 +217,11 @@ efx_mcdi_read_sensors( +@@ -335,6 +341,11 @@ efx_mcdi_read_sensors( efx_mcdi_execute(enp, &req); return (req.emr_rc);