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 B6C8E45BB6 for ; Wed, 23 Oct 2024 23:19:05 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B0E2240261; Wed, 23 Oct 2024 23:19:05 +0200 (CEST) Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) by mails.dpdk.org (Postfix) with ESMTP id AD60B432B4 for ; Wed, 23 Oct 2024 23:19:03 +0200 (CEST) Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-43159c9f617so2001425e9.2 for ; Wed, 23 Oct 2024 14:19:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729718343; x=1730323143; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=2ksQrvS86TKAVVicyd/DH6jYJ3vblmqi/KAwIOGOazQ=; b=X1LbZyL2TC5OpoWokcGXay4tvU8DyE1WV0P3kcyIfshQ2U8r4foOO6yM2ldiGTPZPA Ixg8ulwqgSUhN57O6ylyuShfUms7Mot/wOrJ3bI1yXVoKgCTKJlhd7rhaNHvTporPRFA y3tSz7qOs5nGbChuvXUp22o/dup579LDYR7/PTCRTWjtVBRGlxyt+D2s8zmebYxlOyGL AdFSIDiCEklyWsMu6T/HdYgiUpx5iDh+vtXSdVJ5qsxb2Euz5oVBljgqeJlQ2+sms5zd ECcN4eDrnhrdt3VwFQb0pqK04c0nWhlmeLpMndstxOTIpQ1gdfWVcSQmT1c11Iaj42gi 6bbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729718343; x=1730323143; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2ksQrvS86TKAVVicyd/DH6jYJ3vblmqi/KAwIOGOazQ=; b=K76eKTT2c4+McKMKiszhJiYQCGAOVRvWq2GmvKcqo3bKn7UPrJxlwvmprfI/lXXd2f 20MohRHgOO5VisINgoXqBtNd9LrYnGepuH6wgtqa5JgQupzF4H6OakUhyvSZAURq3iUS f3lRNqQf1849pVDe3/E31yQX64F0tKtimyauZkojL+rLM2Fpd/e4uzlkdXO+XWGZqrGp EU6XtSDvgO1mn9ZIyQM0LvhvvT+ZNHtRQZSHY4HEoRKy6C+uonVyc4ayFXVEa3mSIL67 CrT1dMr7v7ekfhAD6Y8pay17VhNttmb358JMdLxtWyesLRP4mQsfsQX8x1TjLj8WhlEu A+2A== X-Gm-Message-State: AOJu0YxWFJkSFLw8dp0EwApHSkU1MdKHeDsWALvjp1zSokVjZC8c4IWW ZzkBtD0lzAmy8Sr3dm2Yftz4gMR+mAdmK9Sy4/kspQEgrjfwY4iczbA9Ug== X-Google-Smtp-Source: AGHT+IFA69qozp655gZwCQKAw2n7Sz0nDZBL21dY978StkxB4F/nz5PccXsoYfn1zNlFetlYyu46OA== X-Received: by 2002:a05:600c:510f:b0:42f:310f:de9 with SMTP id 5b1f17b1804b1-4318414eccfmr31983755e9.15.1729718343230; Wed, 23 Oct 2024 14:19:03 -0700 (PDT) Received: from localhost ([2a01:4b00:d036:ae00:21cd:def0:a01d:d2aa]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37ee0b9413fsm9813900f8f.74.2024.10.23.14.19.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Oct 2024 14:19:02 -0700 (PDT) From: luca.boccassi@gmail.com To: Vladimir Medvedkin Cc: dpdk stable Subject: patch 'fib: fix AVX512 lookup' has been queued to stable release 22.11.7 Date: Wed, 23 Oct 2024 22:16:12 +0100 Message-ID: <20241023211704.1216956-32-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241023211704.1216956-1-luca.boccassi@gmail.com> References: <20241023211704.1216956-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Hi, FYI, your patch has been queued to stable release 22.11.7 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 10/25/24. 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/c0c610f426552e50c6628fcc100aa0391c91ab1e Thanks. Luca Boccassi --- >From c0c610f426552e50c6628fcc100aa0391c91ab1e Mon Sep 17 00:00:00 2001 From: Vladimir Medvedkin Date: Fri, 6 Sep 2024 17:04:36 +0000 Subject: [PATCH] fib: fix AVX512 lookup [ upstream commit 66ed1786ad067198814e9b2ab54f0cad68a58f1e ] Vector lookup uses gather instructions which loads data in 4byte chunks. This could lead to out of bounds access at the end of the tbl24 in case of 1 or 2 byte entries if e.g. lookup is attempted for 255.255.255.255 in IPv4 case. This patch fixes potential out of bound access by gather instruction allocating an extra 4 byte in the end of the tbl24. Fixes: b3509fa3653e ("fib: add AVX512 lookup") Fixes: 1e5630e40d95 ("fib6: add AVX512 lookup") Signed-off-by: Vladimir Medvedkin --- lib/fib/dir24_8.c | 4 ++-- lib/fib/trie.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/fib/dir24_8.c b/lib/fib/dir24_8.c index 5f73b8a7f0..ec7b9c4b5c 100644 --- a/lib/fib/dir24_8.c +++ b/lib/fib/dir24_8.c @@ -526,8 +526,8 @@ dir24_8_create(const char *name, int socket_id, struct rte_fib_conf *fib_conf) snprintf(mem_name, sizeof(mem_name), "DP_%s", name); dp = rte_zmalloc_socket(name, sizeof(struct dir24_8_tbl) + - DIR24_8_TBL24_NUM_ENT * (1 << nh_sz), RTE_CACHE_LINE_SIZE, - socket_id); + DIR24_8_TBL24_NUM_ENT * (1 << nh_sz) + sizeof(uint32_t), + RTE_CACHE_LINE_SIZE, socket_id); if (dp == NULL) { rte_errno = ENOMEM; return NULL; diff --git a/lib/fib/trie.c b/lib/fib/trie.c index 7b33cdaa7b..ca1c2fe3bc 100644 --- a/lib/fib/trie.c +++ b/lib/fib/trie.c @@ -647,8 +647,8 @@ trie_create(const char *name, int socket_id, snprintf(mem_name, sizeof(mem_name), "DP_%s", name); dp = rte_zmalloc_socket(name, sizeof(struct rte_trie_tbl) + - TRIE_TBL24_NUM_ENT * (1 << nh_sz), RTE_CACHE_LINE_SIZE, - socket_id); + TRIE_TBL24_NUM_ENT * (1 << nh_sz) + sizeof(uint32_t), + RTE_CACHE_LINE_SIZE, socket_id); if (dp == NULL) { rte_errno = ENOMEM; return dp; -- 2.45.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-10-23 22:16:41.736507844 +0100 +++ 0032-fib-fix-AVX512-lookup.patch 2024-10-23 22:16:40.467941496 +0100 @@ -1 +1 @@ -From 66ed1786ad067198814e9b2ab54f0cad68a58f1e Mon Sep 17 00:00:00 2001 +From c0c610f426552e50c6628fcc100aa0391c91ab1e Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 66ed1786ad067198814e9b2ab54f0cad68a58f1e ] + @@ -15 +16,0 @@ -Cc: stable@dpdk.org @@ -24 +25 @@ -index c739e92304..07c324743b 100644 +index 5f73b8a7f0..ec7b9c4b5c 100644