Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4630257pxj; Wed, 12 May 2021 09:36:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzY+KteueRXuFq/IrJnHvTBP3IEwsuttuBuxytE00foLLZsbmukQyazdrMvXHduyB9KeN1h X-Received: by 2002:a2e:9f55:: with SMTP id v21mr25517893ljk.420.1620837394392; Wed, 12 May 2021 09:36:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620837394; cv=none; d=google.com; s=arc-20160816; b=g7OPtkNBz0KB82HIbzUNvxhTmgv+jyi1tmdEjHFLfVhU8879aXEajaOMrEH9tNpdqT TM8r8r7OVApfIdD9kQEdDjq3dwHBfEPnHk+kncIolCsP3jP2cJfkzBhG8Ehr970rWbNG zbRa6Q1U+vgOWYQiVKbA0u1f1VLfP6HD8ANOLzqZkXckTT7lLH1C5qL3MkvF4CaWmmr6 IUS26q6+0eFk8timJ3tqb4UEmq4A0PdUDzgfBAtiFi8erE7opFg/p9/4n3GKP0EUfsNp lMWMU0nV+eWQF0fxFryuZ1CZIuMGtAWfg8EfW+0+Us0rCa8xSuz0bKhu/7dmODTgKd55 oNIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=UJr67UMNYqwn6a+GeSikvOPTeIkSLdQ+6z7lX/b2KJs=; b=nwwJfmoixcwTgnz1Cet5m6WSiSaf5tgPlVpECXSGgVHhNy9uDCbhVw431iRwLx5jXF fBQeo/JsF6F6zWlenyoaVo8q4p2XYYyT+sv6S27Kio5MJaRSFOAR01bpsheGDLVCMHDe 7KXkYGSC1lQlP5Q82PVXDOyYHT2NUlXfiQ7RqJdL0OvOv7AizJ1sZzB5UFHOhmiwo/l8 fF8wXwV7ZVZCS6su0R9vX6jPvPXjZmdqeq+Q4JnEOh5tce19lJmhKz7Pqu+bpSRztOHa y1g8M9z8hP4H/G4IHy0+6ZeBopjlf3uTQnfmNhMuXGzXnW94wlZxlJF0TL2u7VKzLuTx ObRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=0mARaEOf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s18si45509ljg.574.2021.05.12.09.36.04; Wed, 12 May 2021 09:36:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=0mARaEOf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237377AbhELQaL (ORCPT + 99 others); Wed, 12 May 2021 12:30:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:58064 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234024AbhELPjK (ORCPT ); Wed, 12 May 2021 11:39:10 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7F6E761C72; Wed, 12 May 2021 15:20:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620832837; bh=8vmq9Puda2Dmx8qN1xYgteUcNEpTEsxOm+8xqqF05IQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0mARaEOf9fAi/5W1gGV7R5YkvOZqiXT9kaVbPewYTzwZE/vYj05k7HqEgmlgvqZyd FEGGKQNPR6CMzSHW1gTOHGZ5bjjycuHugmTNLoMxJvYQbEnHIJCh7XePERMKuSTA5+ ne0UsPY9QFheOmR+ZdPP1mMHGGvq7HdumPDeGM0g= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Colin Ian King , Brian Foster , "Darrick J. Wong" , Sasha Levin Subject: [PATCH 5.10 409/530] xfs: fix return of uninitialized value in variable error Date: Wed, 12 May 2021 16:48:39 +0200 Message-Id: <20210512144833.206660175@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210512144819.664462530@linuxfoundation.org> References: <20210512144819.664462530@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Colin Ian King [ Upstream commit 3b6dd9a9aeeada19d0c820ff68e979243a888bb6 ] A previous commit removed a call to xfs_attr3_leaf_read that assigned an error return code to variable error. We now have a few early error return paths to label 'out' that return error if error is set; however error now is uninitialized so potentially garbage is being returned. Fix this by setting error to zero to restore the original behaviour where error was zero at the label 'restart'. Addresses-Coverity: ("Uninitialized scalar variable") Fixes: 07120f1abdff ("xfs: Add xfs_has_attr and subroutines") Signed-off-by: Colin Ian King Reviewed-by: Brian Foster Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong Signed-off-by: Sasha Levin --- fs/xfs/libxfs/xfs_attr.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/xfs/libxfs/xfs_attr.c b/fs/xfs/libxfs/xfs_attr.c index fd8e6418a0d3..96ac7e562b87 100644 --- a/fs/xfs/libxfs/xfs_attr.c +++ b/fs/xfs/libxfs/xfs_attr.c @@ -928,6 +928,7 @@ restart: * Search to see if name already exists, and get back a pointer * to where it should go. */ + error = 0; retval = xfs_attr_node_hasname(args, &state); if (retval != -ENOATTR && retval != -EEXIST) goto out; -- 2.30.2