From patchwork Tue Jan 3 10:48:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 121525 X-Patchwork-Delegate: david.marchand@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 97A76A00C2; Tue, 3 Jan 2023 11:48:58 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7AF7340697; Tue, 3 Jan 2023 11:48:58 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id B471140689 for ; Tue, 3 Jan 2023 11:48:56 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672742936; 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; bh=BH5vc6ckU1AzYHKvD1y3Oh/0HYvpJ8Vx+nkFLHqQi5M=; b=L4VSyYwgZaZ4sBlfRIZJAx8IOrt2XZrYSjzB+mNTqb3FILPYUltcaULuJu3dWkZkmokGGx jYsZ+qOxYP8v18q0zV/jdJww/Dhp+c5J0YQxxrCJkA7W6bWLIh10WIFHd7v8dhvDeeZHKC VMFAiIBz/sh9GP/kAEPopacEhh0YlKs= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-394-BNt2zmZgM1qARa9WfwEQsA-1; Tue, 03 Jan 2023 05:48:54 -0500 X-MC-Unique: BNt2zmZgM1qARa9WfwEQsA-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5A5473806738; Tue, 3 Jan 2023 10:48:54 +0000 (UTC) Received: from dmarchan.redhat.com (ovpn-193-100.brq.redhat.com [10.40.193.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3ACE8492D8B; Tue, 3 Jan 2023 10:48:53 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: stable@dpdk.org, Anatoly Burakov Subject: [PATCH] fbarray: fix metadata dump Date: Tue, 3 Jan 2023 11:48:48 +0100 Message-Id: <20230103104848.616436-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org If the passed fbarray is invalid, its lock was not taken before releasing. Fixes: c44d09811b40 ("eal: add shared indexed file-backed array") Cc: stable@dpdk.org Signed-off-by: David Marchand --- lib/eal/common/eal_common_fbarray.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/eal/common/eal_common_fbarray.c b/lib/eal/common/eal_common_fbarray.c index f11f87979f..169e66e04b 100644 --- a/lib/eal/common/eal_common_fbarray.c +++ b/lib/eal/common/eal_common_fbarray.c @@ -1482,7 +1482,7 @@ rte_fbarray_dump_metadata(struct rte_fbarray *arr, FILE *f) if (fully_validate(arr->name, arr->elt_sz, arr->len)) { fprintf(f, "Invalid file-backed array\n"); - goto out; + return; } /* prevent array from changing under us */ @@ -1496,6 +1496,5 @@ rte_fbarray_dump_metadata(struct rte_fbarray *arr, FILE *f) for (i = 0; i < msk->n_masks; i++) fprintf(f, "msk idx %i: 0x%016" PRIx64 "\n", i, msk->data[i]); -out: rte_rwlock_read_unlock(&arr->rwlock); }