From: Markus Theil <markus.theil@tu-ilmenau.de>
To: dev@dpdk.org
Cc: Markus Theil <markus.theil@tu-ilmenau.de>
Subject: [PATCH 2/2] eal: prevent OOB read in rte_lcore_to_socket_id
Date: Fri, 14 Oct 2022 08:21:00 +0200 [thread overview]
Message-ID: <20221014062100.5761-2-markus.theil@tu-ilmenau.de> (raw)
In-Reply-To: <20221014062100.5761-1-markus.theil@tu-ilmenau.de>
Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
---
lib/eal/common/eal_common_lcore.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/lib/eal/common/eal_common_lcore.c b/lib/eal/common/eal_common_lcore.c
index 48c333cff1..94625c2ebc 100644
--- a/lib/eal/common/eal_common_lcore.c
+++ b/lib/eal/common/eal_common_lcore.c
@@ -111,6 +111,9 @@ unsigned int rte_get_next_lcore(unsigned int i, int skip_main, int wrap)
unsigned int
rte_lcore_to_socket_id(unsigned int lcore_id)
{
+ if (unlikely(lcore_id >= RTE_MAX_LCORE))
+ return -1;
+
return lcore_config[lcore_id].socket_id;
}
--
2.38.0
next prev parent reply other threads:[~2022-10-14 6:21 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-14 6:20 [PATCH 1/2] eal: expose lcore pthread id Markus Theil
2022-10-14 6:21 ` Markus Theil [this message]
2022-10-14 7:54 ` [PATCH v2 " Markus Theil
2022-10-14 7:54 ` [PATCH v2 2/2] eal: prevent OOB read in rte_lcore_to_socket_id Markus Theil
2022-10-20 11:20 ` [PATCH v2 1/2] eal: expose lcore pthread id David Marchand
2022-10-20 15:36 ` Stephen Hemminger
2022-10-20 20:03 ` Michael Pfeiffer
2022-11-29 22:04 ` Tyler Retzlaff
2023-07-06 2:57 ` Stephen Hemminger
2023-07-06 5:50 ` Michael Pfeiffer
2022-11-12 0:34 ` Tyler Retzlaff
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=20221014062100.5761-2-markus.theil@tu-ilmenau.de \
--to=markus.theil@tu-ilmenau.de \
--cc=dev@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).