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 43D8EA0C4C for ; Mon, 12 Jul 2021 15:07:16 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3225E4119D; Mon, 12 Jul 2021 15:07:16 +0200 (CEST) Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) by mails.dpdk.org (Postfix) with ESMTP id 053814119D for ; Mon, 12 Jul 2021 15:07:14 +0200 (CEST) Received: by mail-wr1-f53.google.com with SMTP id t5so11673103wrw.12 for ; Mon, 12 Jul 2021 06:07:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=hqe6qRvK4aYPUOfnaNeo1tWmJ4KxpIvk9Ubjyhr4EEY=; b=KsuLpuPNPViMA/Mc97l222r2h5EmZIKWJDKgSkU0MLVB2PJbMMS9MYiLQ/bsxQfdxe fV6Fo/cW2LvJIvmh3iogXRzYoFTu0WkpIwozcZdmUkiaOluNNcuYN8GzbQrFgD+zEh9H ilC3NfptRbmAczA71fjxowRUYo2jge613duIKX7vOwBdj+5fz6BNvgLXSRs1NCfcuvbd awIKjOExlVqelyv/9+4jR76/GDjDm7sU4ApjOZY3StM4tt0usY7lKub4SVeIa5J2M137 BSQhLgIrpfIo9D2lLLnVnvUOutqlRNlJDnaitN2L4UacEWoatWFvQSdawAD2y4aG6Bpk 6CBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=hqe6qRvK4aYPUOfnaNeo1tWmJ4KxpIvk9Ubjyhr4EEY=; b=C31meetlVc5RU04rLbeXhpE9Xi2d83P+rHcm0ALXTnJC4sMbXuXO/BfXgTIMCDDsf0 RUEt4mQxTltk3VHrBp8hKGkr4Ob4yHB8dC4ePrHljE6d8TSCVRuaT9Z6QOZhsfXzhirL F7CSXnMZg8M4RmbMVmt6HpWYso7abzwXdc2o8tPeViadnBWNVOkIIo09Xh275j7avCkl ORCO4RV1fA7gMeTdrcs+d+IuTNn4EQwrywhWn71eTSsKRnebtADSHZKRplrvTe+3i/Bw DvbG+F2ItYXpkwY0IwyEar63vnh9ddrE/LJC9Hpb5y5JZN+LUmkP/WH6nJ43/ZGVMBo3 f/Ng== X-Gm-Message-State: AOAM531MvRYW2kNZ9OMF/LsE+Oclik/+ly3qq1DT732yUbinZ0cEJsud RNBiQ6fhif0u9mUKV+l9Ma4= X-Google-Smtp-Source: ABdhPJyWXkgI3DXerKxgI1KxldqDhZB9+XDnMbOXrLMlLzLxgJb5LfWZZvGC1wunExgB7/s2rsWZSQ== X-Received: by 2002:a5d:6984:: with SMTP id g4mr27885622wru.381.1626095233745; Mon, 12 Jul 2021 06:07:13 -0700 (PDT) Received: from localhost ([137.220.125.106]) by smtp.gmail.com with ESMTPSA id e15sm14292487wrp.29.2021.07.12.06.06.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jul 2021 06:06:59 -0700 (PDT) From: luca.boccassi@gmail.com To: Ivan Ilchenko Cc: Andy Moreton , Andrew Rybchenko , Cristian Dumitrescu , dpdk stable Date: Mon, 12 Jul 2021 14:03:58 +0100 Message-Id: <20210712130551.2462159-3-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210712130551.2462159-1-luca.boccassi@gmail.com> References: <20210712130551.2462159-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 20.11.3 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 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 stable release 20.11.3 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/14/21. 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/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/cd12bf5357831e4e9c196c2b624c382492f26db8 Thanks. Luca Boccassi --- >From cd12bf5357831e4e9c196c2b624c382492f26db8 Mon Sep 17 00:00:00 2001 From: Ivan Ilchenko Date: Wed, 2 Jun 2021 12:49:22 +0300 Subject: [PATCH] bitmap: fix buffer overrun in bitmap init [ upstream commit 1ffd3bc1252ee871398dad227cd651658dc76939 ] Bitmap initialization function is allowed to memset() caller-provided buffer with number of bytes exceeded this buffer size. This happens due to wrong comparison sign between buffer size and number of bytes required to initialize bitmap. Fixes: 602c9ca33a4 ("sched: bitmap is now dynamically allocated") Reported-by: Andy Moreton Signed-off-by: Ivan Ilchenko Reviewed-by: Andy Moreton Signed-off-by: Andrew Rybchenko Acked-by: Cristian Dumitrescu --- lib/librte_eal/include/rte_bitmap.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/librte_eal/include/rte_bitmap.h b/lib/librte_eal/include/rte_bitmap.h index 7c90ef333f..b38d9ac2ba 100644 --- a/lib/librte_eal/include/rte_bitmap.h +++ b/lib/librte_eal/include/rte_bitmap.h @@ -185,9 +185,8 @@ rte_bitmap_init(uint32_t n_bits, uint8_t *mem, uint32_t mem_size) size = __rte_bitmap_get_memory_footprint(n_bits, &array1_byte_offset, &array1_slabs, &array2_byte_offset, &array2_slabs); - if (size < mem_size) { + if (size > mem_size) return NULL; - } /* Setup bitmap */ memset(mem, 0, size); -- 2.30.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-07-12 13:41:37.065884267 +0100 +++ 0003-bitmap-fix-buffer-overrun-in-bitmap-init.patch 2021-07-12 13:41:36.150115528 +0100 @@ -1 +1 @@ -From 1ffd3bc1252ee871398dad227cd651658dc76939 Mon Sep 17 00:00:00 2001 +From cd12bf5357831e4e9c196c2b624c382492f26db8 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 1ffd3bc1252ee871398dad227cd651658dc76939 ] + @@ -13 +14,0 @@ -Cc: stable@dpdk.org @@ -21 +22 @@ - lib/eal/include/rte_bitmap.h | 3 +-- + lib/librte_eal/include/rte_bitmap.h | 3 +-- @@ -24,4 +25,4 @@ -diff --git a/lib/eal/include/rte_bitmap.h b/lib/eal/include/rte_bitmap.h -index 9e2b8f2cbf..e4623bb176 100644 ---- a/lib/eal/include/rte_bitmap.h -+++ b/lib/eal/include/rte_bitmap.h +diff --git a/lib/librte_eal/include/rte_bitmap.h b/lib/librte_eal/include/rte_bitmap.h +index 7c90ef333f..b38d9ac2ba 100644 +--- a/lib/librte_eal/include/rte_bitmap.h ++++ b/lib/librte_eal/include/rte_bitmap.h