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 3A745A053D for ; Fri, 17 Jul 2020 18:32:47 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2A4361BED2; Fri, 17 Jul 2020 18:32:47 +0200 (CEST) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by dpdk.org (Postfix) with ESMTP id BCAC71BEB4 for ; Fri, 17 Jul 2020 18:32:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1595003565; 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=fZeBuaP2lanr6rG/WAz2o9N8tnKgONaZb94n+fsS9nE=; b=V0FH0ilEcB6TWXibXLTQMZCoNDNKF9opM7+vG858nXpSLEmw3+/raYRk7nOMvg8PLi5X4a KZzmtrZBk4pfT8R+VpycHT7Sh8bENrtlYGDblvP/SZWh/bsJuD7yzu00M3arVTyYCyEjV0 BdoEB97JkmOM3i+ubC3Sa16OBD9oanU= 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-509-JOF47XedOqeA2GmI56p3mw-1; Fri, 17 Jul 2020 12:32:36 -0400 X-MC-Unique: JOF47XedOqeA2GmI56p3mw-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2E44A1902EA8; Fri, 17 Jul 2020 16:32:35 +0000 (UTC) Received: from rh.redhat.com (unknown [10.33.36.168]) by smtp.corp.redhat.com (Postfix) with ESMTP id 776A47555D; Fri, 17 Jul 2020 16:32:34 +0000 (UTC) From: Kevin Traynor To: Konstantin Ananyev Cc: dpdk stable Date: Fri, 17 Jul 2020 17:31:55 +0100 Message-Id: <20200717163214.4839-7-ktraynor@redhat.com> In-Reply-To: <20200717163214.4839-1-ktraynor@redhat.com> References: <20200717163214.4839-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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 'bpf: fix add/sub min/max estimations' has been queued to LTS release 18.11.10 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.10 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/23/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/79ef320b85481100714bfe88fe6acf820d0e1253 Thanks. Kevin. --- >From 79ef320b85481100714bfe88fe6acf820d0e1253 Mon Sep 17 00:00:00 2001 From: Konstantin Ananyev Date: Wed, 27 May 2020 15:16:50 +0100 Subject: [PATCH] bpf: fix add/sub min/max estimations [ upstream commit 20c19d9df5f08840d96204dcc65437223c434325 ] eval_add()/eval_sub() not always correctly estimate minimum and maximum possible values of add/sub operations. Fixes: 8021917293d0 ("bpf: add extra validation for input BPF program") Signed-off-by: Konstantin Ananyev --- lib/librte_bpf/bpf_validate.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/librte_bpf/bpf_validate.c b/lib/librte_bpf/bpf_validate.c index 0cf41fa27c..f92c514614 100644 --- a/lib/librte_bpf/bpf_validate.c +++ b/lib/librte_bpf/bpf_validate.c @@ -225,5 +225,5 @@ eval_add(struct bpf_reg_val *rd, const struct bpf_reg_val *rs, uint64_t msk) rv.u.min = (rd->u.min + rs->u.min) & msk; - rv.u.max = (rd->u.min + rs->u.max) & msk; + rv.u.max = (rd->u.max + rs->u.max) & msk; rv.s.min = (rd->s.min + rs->s.min) & msk; rv.s.max = (rd->s.max + rs->s.max) & msk; @@ -253,8 +253,8 @@ eval_sub(struct bpf_reg_val *rd, const struct bpf_reg_val *rs, uint64_t msk) struct bpf_reg_val rv; - rv.u.min = (rd->u.min - rs->u.min) & msk; - rv.u.max = (rd->u.min - rs->u.max) & msk; - rv.s.min = (rd->s.min - rs->s.min) & msk; - rv.s.max = (rd->s.max - rs->s.max) & msk; + rv.u.min = (rd->u.min - rs->u.max) & msk; + rv.u.max = (rd->u.max - rs->u.min) & msk; + rv.s.min = (rd->s.min - rs->s.max) & msk; + rv.s.max = (rd->s.max - rs->s.min) & msk; /* -- 2.21.3 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-07-17 17:17:00.388237990 +0100 +++ 0007-bpf-fix-add-sub-min-max-estimations.patch 2020-07-17 17:16:59.963771790 +0100 @@ -1 +1 @@ -From 20c19d9df5f08840d96204dcc65437223c434325 Mon Sep 17 00:00:00 2001 +From 79ef320b85481100714bfe88fe6acf820d0e1253 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 20c19d9df5f08840d96204dcc65437223c434325 ] + @@ -10 +11,0 @@ -Cc: stable@dpdk.org @@ -18 +19 @@ -index 6bd6f78e9b..80d21fabbe 100644 +index 0cf41fa27c..f92c514614 100644 @@ -21 +22 @@ -@@ -227,5 +227,5 @@ eval_add(struct bpf_reg_val *rd, const struct bpf_reg_val *rs, uint64_t msk) +@@ -225,5 +225,5 @@ eval_add(struct bpf_reg_val *rd, const struct bpf_reg_val *rs, uint64_t msk) @@ -28 +29 @@ -@@ -255,8 +255,8 @@ eval_sub(struct bpf_reg_val *rd, const struct bpf_reg_val *rs, uint64_t msk) +@@ -253,8 +253,8 @@ eval_sub(struct bpf_reg_val *rd, const struct bpf_reg_val *rs, uint64_t msk)