patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH] examples/exception_path: fix possible out-of-bounds read
@ 2018-07-16 16:03 Bruce Richardson
  2018-07-26 17:56 ` [dpdk-stable] [dpdk-dev] " Thomas Monjalon
  0 siblings, 1 reply; 2+ messages in thread
From: Bruce Richardson @ 2018-07-16 16:03 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson, stable

When printing out stats from the exception_path app, all possible
lcore_ids are iterated. However, the app only supports up to 64 cores.
To prevent possible errors, and to remove coverity warnings,
explicitly check for out-of-range lcore ids before printing.

Coverity issue: 268335
Fixes: af75078fece3 ("first public release")

Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 examples/exception_path/main.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/examples/exception_path/main.c b/examples/exception_path/main.c
index 0b59f6b3f..440422bc8 100644
--- a/examples/exception_path/main.c
+++ b/examples/exception_path/main.c
@@ -131,6 +131,9 @@ print_stats(void)
 	       " Lcore    Port            RX            TX    Dropped on TX\n"
 	       "-------  ------  ------------  ------------  ---------------\n");
 	RTE_LCORE_FOREACH(i) {
+		/* limit ourselves to application supported cores only */
+		if (i >= APP_MAX_LCORE)
+			break;
 		printf("%6u %7u %13"PRIu64" %13"PRIu64" %16"PRIu64"\n",
 		       i, (unsigned)port_ids[i],
 		       lcore_stats[i].rx, lcore_stats[i].tx,
-- 
2.17.1

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-stable] [dpdk-dev] [PATCH] examples/exception_path: fix possible out-of-bounds read
  2018-07-16 16:03 [dpdk-stable] [PATCH] examples/exception_path: fix possible out-of-bounds read Bruce Richardson
@ 2018-07-26 17:56 ` Thomas Monjalon
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Monjalon @ 2018-07-26 17:56 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: dev, stable

16/07/2018 18:03, Bruce Richardson:
> When printing out stats from the exception_path app, all possible
> lcore_ids are iterated. However, the app only supports up to 64 cores.
> To prevent possible errors, and to remove coverity warnings,
> explicitly check for out-of-range lcore ids before printing.
> 
> Coverity issue: 268335
> Fixes: af75078fece3 ("first public release")
> 
> Cc: stable@dpdk.org
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>

Applied, thanks

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-07-26 17:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-16 16:03 [dpdk-stable] [PATCH] examples/exception_path: fix possible out-of-bounds read Bruce Richardson
2018-07-26 17:56 ` [dpdk-stable] [dpdk-dev] " Thomas Monjalon

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).