From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2200EA04A3 for ; Fri, 5 Jun 2020 20:27:42 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 19CAD1D510; Fri, 5 Jun 2020 20:27:42 +0200 (CEST) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by dpdk.org (Postfix) with ESMTP id E2F751D525 for ; Fri, 5 Jun 2020 20:27:40 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1591381660; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Rm09ISo40bRZw9TYheyqCJp7ASFOgEIc/mvcIvERjR8=; b=b4vPyCPgYpvwkBaqxywaT84lyw39p0yXjdQcr6PYgLScV8SSppat1/0D/OLacPvV6tLEZU kIOqOB5Sj5s1VugJrOCfFf8DE8g0c6fHj8LukaBcgMskKeyGFjelJbr6UhdSfrByCVq+MA KBlK/xkp/Cx8zkC4SJMBkXv5stZxx38= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-262-lblUu1sYOs2vtMv6KKED2w-1; Fri, 05 Jun 2020 14:27:37 -0400 X-MC-Unique: lblUu1sYOs2vtMv6KKED2w-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5C6D8107ACF4; Fri, 5 Jun 2020 18:27:36 +0000 (UTC) Received: from rh.redhat.com (unknown [10.33.36.130]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7953060C47; Fri, 5 Jun 2020 18:27:35 +0000 (UTC) From: Kevin Traynor To: Gaetan Rivet Cc: Darek Stojaczyk , dpdk stable Date: Fri, 5 Jun 2020 19:25:04 +0100 Message-Id: <20200605182525.22483-67-ktraynor@redhat.com> In-Reply-To: <20200605182525.22483-1-ktraynor@redhat.com> References: <20200605182525.22483-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'pci: reject negative values in PCI id' has been queued to LTS release 18.11.9 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: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to LTS release 18.11.9 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 06/10/20. 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. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/kevintraynor/dpdk-stable-queue This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable-queue/commit/6c308ef1d740e4f5dae7f612b7ffbe50256b1ade Thanks. Kevin. --- >From 6c308ef1d740e4f5dae7f612b7ffbe50256b1ade Mon Sep 17 00:00:00 2001 From: Gaetan Rivet Date: Wed, 13 May 2020 12:47:50 +0200 Subject: [PATCH] pci: reject negative values in PCI id [ upstream commit 21a61fae51804cfdf7c6f7e6189c63f02025de89 ] The function strtoul will not return ERANGE if the input is negative, as one might expect. 0000:-FFFFFFFFFFFFFFFB:00.0 is not a better way to write 0000:05:00.0. To simplify checking for '-', forbid using spaces before the field value. 0000: 00: 2c.0 Should not be accepted. Fixes: af75078fece3 ("first public release") Signed-off-by: Gaetan Rivet Acked-by: Darek Stojaczyk --- lib/librte_pci/rte_pci.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/librte_pci/rte_pci.c b/lib/librte_pci/rte_pci.c index e35d64f99c..2c98c3efb5 100644 --- a/lib/librte_pci/rte_pci.c +++ b/lib/librte_pci/rte_pci.c @@ -36,4 +36,10 @@ get_u8_pciaddr_field(const char *in, void *_u8, char dlm) return NULL; + /* PCI field starting with spaces is forbidden. + * Negative wrap-around is not reported as an error by strtoul. + */ + if (*in == ' ' || *in == '-') + return NULL; + errno = 0; val = strtoul(in, &end, 16); @@ -71,4 +77,10 @@ pci_dbdf_parse(const char *input, struct rte_pci_addr *dev_addr) char *end; + /* PCI id starting with spaces is forbidden. + * Negative wrap-around is not reported as an error by strtoul. + */ + if (*in == ' ' || *in == '-') + return -EINVAL; + errno = 0; val = strtoul(in, &end, 16); -- 2.21.3 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-06-05 19:20:54.515505654 +0100 +++ 0067-pci-reject-negative-values-in-PCI-id.patch 2020-06-05 19:20:50.942037814 +0100 @@ -1 +1 @@ -From 21a61fae51804cfdf7c6f7e6189c63f02025de89 Mon Sep 17 00:00:00 2001 +From 6c308ef1d740e4f5dae7f612b7ffbe50256b1ade Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 21a61fae51804cfdf7c6f7e6189c63f02025de89 ] + @@ -19 +20,0 @@ -Cc: stable@dpdk.org @@ -28 +29 @@ -index ad2cdfebb2..5f7726fa89 100644 +index e35d64f99c..2c98c3efb5 100644