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 0447EA0093 for ; Tue, 19 May 2020 15:13:13 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EE7C21D702; Tue, 19 May 2020 15:13:12 +0200 (CEST) Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) by dpdk.org (Postfix) with ESMTP id EFCAE1D8E4 for ; Tue, 19 May 2020 15:13:10 +0200 (CEST) Received: by mail-wm1-f65.google.com with SMTP id h4so3000337wmb.4 for ; Tue, 19 May 2020 06:13:10 -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=QTR+CDhK5s77CxxcWd98bPYoTjnKOpnPkOt60mC9SOM=; b=ra86a+Qo109svjSvBVlitiAgmMqKkojSxI1/rty+sr3kznE82Q/KlC7s8Fad71bcgA MqRtrrlFnPE+/DUhdLL4VeLujOpsJddIA7eU8V9HsT+CNkZU4o+o1KI9dfvUkKdPhp25 ikQ8e1sfQQx2kP/fobR5/I/Urx73f3l1oA6L6Iv10/G7jZQMCuOwYlYMeWS8dcpCPDFk ezupUgjbT2+mDmg0l8DCRE3kcBvTrYvA5foB+DV1o1CdLN87f9e1YkIMpLqUw9TIJqOJ /gn77bYfYxQhc5jR3IrL8UKOeskJpAxG38WrfxnTav8fRABc65XiTsHNXcPr3tqK6XDT edVQ== 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=QTR+CDhK5s77CxxcWd98bPYoTjnKOpnPkOt60mC9SOM=; b=IDecP94XyQMdsk7rMd/yCnN6TDJ5a7CLzP2pLXziwbSsUQUPwm/c5aoKaZ6s1WvDF+ oIem+pIWECia+5U9gi6IBmLGl4vPDCBRerjyrwkPBuLePkH+gfNA6dTFWV9yoM4gQIUU Gd7vn0AOlIjNOA2eoJANkFNsKKPgLCVIjteC3S2/uIjT0E328DYEUhIkmqDbzhVu2zch si2eMLXctWRlxnrrY1DRjZfUIJ4wHPjsVcBXFpD0eRhARY/Q8wE/V7w5zaP9qjDpVvvs m4bZIatytthP5Ukn0FPghwVUhNFxq5HJTTEyAbSZe/BvwgjOpvQW2bL7OWpOYCviru1R 1zJQ== X-Gm-Message-State: AOAM5306+nCwS5jYF5wsqQABbVCuQki7AV2rZ5NTxD29/0/e1sX00jDZ jZgIVKC7F5Sav413ZOLMbhQ= X-Google-Smtp-Source: ABdhPJyrW0xYWCD/DpL5ggjLv01WZ+vWh1Ky9OUOa2+9/YpqKH4UXeyUxUkQdv9hGhkyLWRvMRlxPA== X-Received: by 2002:a05:600c:2257:: with SMTP id a23mr5801675wmm.13.1589893990682; Tue, 19 May 2020 06:13:10 -0700 (PDT) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id g184sm4134703wmg.1.2020.05.19.06.13.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2020 06:13:10 -0700 (PDT) From: luca.boccassi@gmail.com To: Asaf Penso Cc: Dekel Peled , Viacheslav Ovsiienko , dpdk stable Date: Tue, 19 May 2020 14:04:35 +0100 Message-Id: <20200519130549.112823-140-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200519130549.112823-1-luca.boccassi@gmail.com> References: <20200519125804.104349-1-luca.boccassi@gmail.com> <20200519130549.112823-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/mlx5: fix assert in doorbell lookup' has been queued to stable release 19.11.3 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 stable release 19.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 05/21/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. Thanks. Luca Boccassi --- >From fd7ba64cb44468d9c7d91aa60e710dbceb37c301 Mon Sep 17 00:00:00 2001 From: Asaf Penso Date: Thu, 16 Apr 2020 17:15:09 +0000 Subject: [PATCH] net/mlx5: fix assert in doorbell lookup [ upstream commit 9b080425e31297199dcbfa35d95d287d729c68a0 ] The asserts makes sure that 'i' doesn't exceed the expected value. This to prevent an out of bound access to dbr_bitmap. The current location of the assert protects the assignment of dbr_bitmap, but not the access to it. Moved the assert to the correct place, to protect both cases. Also, used an existing define for the assert. Fixes: 21cae8580fd0 ("net/mlx5: allocate door-bells via DevX") Signed-off-by: Asaf Penso Reviewed-by: Dekel Peled Acked-by: Viacheslav Ovsiienko --- drivers/net/mlx5/mlx5.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index 6ac387bd24..9ecf31da7c 100644 --- a/drivers/net/mlx5/mlx5.c +++ b/drivers/net/mlx5/mlx5.c @@ -1946,8 +1946,8 @@ mlx5_get_dbr(struct rte_eth_dev *dev, struct mlx5_devx_dbr_page **dbr_page) i++) ; /* Empty. */ /* Find the first clear bit. */ + assert(i < MLX5_DBR_BITMAP_SIZE); j = rte_bsf64(~page->dbr_bitmap[i]); - assert(i < (MLX5_DBR_PER_PAGE / 64)); page->dbr_bitmap[i] |= (1 << j); page->dbr_count++; *dbr_page = page; -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-05-19 14:04:50.132975267 +0100 +++ 0140-net-mlx5-fix-assert-in-doorbell-lookup.patch 2020-05-19 14:04:44.456652723 +0100 @@ -1,8 +1,10 @@ -From 9b080425e31297199dcbfa35d95d287d729c68a0 Mon Sep 17 00:00:00 2001 +From fd7ba64cb44468d9c7d91aa60e710dbceb37c301 Mon Sep 17 00:00:00 2001 From: Asaf Penso Date: Thu, 16 Apr 2020 17:15:09 +0000 Subject: [PATCH] net/mlx5: fix assert in doorbell lookup +[ upstream commit 9b080425e31297199dcbfa35d95d287d729c68a0 ] + The asserts makes sure that 'i' doesn't exceed the expected value. This to prevent an out of bound access to dbr_bitmap. @@ -13,7 +15,6 @@ Also, used an existing define for the assert. Fixes: 21cae8580fd0 ("net/mlx5: allocate door-bells via DevX") -Cc: stable@dpdk.org Signed-off-by: Asaf Penso Reviewed-by: Dekel Peled @@ -23,16 +24,16 @@ 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c -index cc13e447d6..75ada96cc5 100644 +index 6ac387bd24..9ecf31da7c 100644 --- a/drivers/net/mlx5/mlx5.c +++ b/drivers/net/mlx5/mlx5.c -@@ -2149,8 +2149,8 @@ mlx5_get_dbr(struct rte_eth_dev *dev, struct mlx5_devx_dbr_page **dbr_page) +@@ -1946,8 +1946,8 @@ mlx5_get_dbr(struct rte_eth_dev *dev, struct mlx5_devx_dbr_page **dbr_page) i++) ; /* Empty. */ /* Find the first clear bit. */ -+ MLX5_ASSERT(i < MLX5_DBR_BITMAP_SIZE); ++ assert(i < MLX5_DBR_BITMAP_SIZE); j = rte_bsf64(~page->dbr_bitmap[i]); -- MLX5_ASSERT(i < (MLX5_DBR_PER_PAGE / 64)); +- assert(i < (MLX5_DBR_PER_PAGE / 64)); page->dbr_bitmap[i] |= (1 << j); page->dbr_count++; *dbr_page = page;