patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Yongseok Koh <yskoh@mellanox.com>
To: Remy Horton <remy.horton@intel.com>
Cc: Ferruh Yigit <ferruh.yigit@intel.com>, dpdk stable <stable@dpdk.org>
Subject: [dpdk-stable] patch 'bitrate: add sanity check on parameters' has been queued to LTS release 17.11.4
Date: Thu, 26 Jul 2018 19:31:08 -0700	[thread overview]
Message-ID: <20180727023108.38699-10-yskoh@mellanox.com> (raw)
In-Reply-To: <20180727023108.38699-1-yskoh@mellanox.com>

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 <remy.horton@intel.com>
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 <remy.horton@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
 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, &eth_stats);
 	if (ret_code != 0)
 		return ret_code;
-- 
2.11.0

      parent reply	other threads:[~2018-07-27  2:31 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-27  2:30 [dpdk-stable] patch 'net/cxgbe: fix init failure due to new flash parts' " Yongseok Koh
2018-07-27  2:31 ` [dpdk-stable] patch 'net/thunderx: avoid sq door bell write on zero packet' " Yongseok Koh
2018-07-27  2:31 ` [dpdk-stable] patch 'net/sfc: fix assert in set multicast address list' " Yongseok Koh
2018-07-27  2:31 ` [dpdk-stable] patch 'net/mlx5: fix TCI mask filter' " Yongseok Koh
2018-07-27  2:31 ` [dpdk-stable] patch 'ring: fix sign conversion warning' " Yongseok Koh
2018-07-27  2:31 ` [dpdk-stable] patch 'event/octeontx: remove unnecessary port start and stop' " Yongseok Koh
2018-07-27  2:31 ` [dpdk-stable] patch 'app/testpmd: fix buffer leak in TM command' " Yongseok Koh
2018-07-27  2:31 ` [dpdk-stable] patch 'examples/exception_path: fix out-of-bounds read' " Yongseok Koh
2018-07-27  2:31 ` [dpdk-stable] patch 'examples/l3fwd: remove useless include' " Yongseok Koh
2018-07-27  2:31 ` Yongseok Koh [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180727023108.38699-10-yskoh@mellanox.com \
    --to=yskoh@mellanox.com \
    --cc=ferruh.yigit@intel.com \
    --cc=remy.horton@intel.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).