From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 77D7EA0A02; Tue, 4 May 2021 18:54:25 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id ED1974014D; Tue, 4 May 2021 18:54:24 +0200 (CEST) Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) by mails.dpdk.org (Postfix) with ESMTP id BA65E40147 for ; Tue, 4 May 2021 18:54:23 +0200 (CEST) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 0F43B1529; Tue, 4 May 2021 12:54:21 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Tue, 04 May 2021 12:54:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=fm1; bh= byD5mfJI0TqKJqQv4Z0Rb2MTNLnwo+xe/RF6cV4Ish4=; b=1esXewIMiBzG1pUa WV0QkEheyPmeJTaoRyvONhk2cQ9HqyoG7JPBTnsgEU8+TF2kEzv5m//jNhJHQ0Wb T13Rv64MnjQBpeSYPEY9YhBscQGI2BPS8vcaOnI5OPlsFw8O2ai+X3K3fOCn11WT 4jnYyIhzPYZl4X/T/CysvAXIxyc0t+64da3rPMYYdYuqgxIUzBp+gZWgsgEb+6TV 4cSj8CD0bQIw0Ee+d5OY8ShNCmcoXwihmpu6S68+86JAQRCR7+m6PN/7WFofxTJc rs3uHOhCo8qXGu9KKibagcIktGd3X6qS4jf+ZIcW/bF6DLmgR/QNSWl/7gQV+8ZL dCE9Aw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=byD5mfJI0TqKJqQv4Z0Rb2MTNLnwo+xe/RF6cV4Is h4=; b=LLDDYz3g4QnGlzQWmE51dGQ6ZJvjgXapTl9sIF4jxOz5qo6qzWroFPDU6 dRzhcIu3I+tSjwJRqeGK+FtA5FMgNjPBxfTsaFPlyRtmYeNoABehQrB0jblHUZfX lt+hLwgUHjWE/Uanx+GwZ8fcAnPm0R6LhN7ERp6InoFcMfib2BgsqSzaQa+REq9f AbXx0b2m553fmZ8YG0detAquObhR32VzA7XBFPsp4QkU/32R8eVg5YnFD6rednHc 4XXZ6RBanOI0AFFfTMgKTFb5HbGMGGQtIslVv0y0NzTqibODgW4o8Fr44R0h0VX8 ncTuiCD7jlzytzD+ndzvb4koPKZLQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvdefiedguddtlecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvffufffkjghfggfgtgesthfuredttddtvdenucfhrhhomhepvfhhohhm rghsucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenuc ggtffrrghtthgvrhhnpedugefgvdefudfftdefgeelgffhueekgfffhfeujedtteeutdej ueeiiedvffegheenucfkphepjeejrddufeegrddvtdefrddukeegnecuvehluhhsthgvrh fuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgr lhhonhdrnhgvth X-ME-Proxy: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 4 May 2021 12:54:19 -0400 (EDT) From: Thomas Monjalon To: "Min Hu (Connor)" Cc: dev@dpdk.org, ferruh.yigit@intel.com, jerinj@marvell.com, skori@marvell.com, stephen@networkplumber.org, harry.van.haaren@intel.com Date: Tue, 04 May 2021 18:54:18 +0200 Message-ID: <2108083.y1R0bUofmO@thomas> In-Reply-To: <1619663653-22771-3-git-send-email-humin29@huawei.com> References: <1618967837-2341-1-git-send-email-humin29@huawei.com> <1619663653-22771-1-git-send-email-humin29@huawei.com> <1619663653-22771-3-git-send-email-humin29@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v2 2/2] eal: fix service core index validity X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" +Cc Harry 29/04/2021 04:34, Min Hu (Connor): > This patch adds checking for service core index validity when parsing > service corelist. > > Fixes: 7dbd7a6413ef ("service: add -S corelist option") > Cc: stable@dpdk.org > > Signed-off-by: Chengwen Feng > Signed-off-by: Min Hu (Connor) > --- > lib/eal/common/eal_common_options.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/lib/eal/common/eal_common_options.c b/lib/eal/common/eal_common_options.c > index 66f9114..97ab6e0 100644 > --- a/lib/eal/common/eal_common_options.c > +++ b/lib/eal/common/eal_common_options.c > @@ -758,10 +758,10 @@ static int > eal_parse_service_corelist(const char *corelist) > { > struct rte_config *cfg = rte_eal_get_configuration(); > - int i, idx = 0; > + int i; > unsigned count = 0; > char *end = NULL; > - int min, max; > + uint32_t min, max, idx; > uint32_t taken_lcore_count = 0; > > if (corelist == NULL) > @@ -785,6 +785,8 @@ eal_parse_service_corelist(const char *corelist) > idx = strtoul(corelist, &end, 10); > if (errno || end == NULL) > return -1; > + if (idx >= RTE_MAX_LCORE) > + return -1; > while (isblank(*end)) > end++; > if (*end == '-') { >