From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796388521; b=ClDFgWHWPA72Y0FoZZM3OQ3cVGY0Z84UGCAx1wcssqkextDwtpXNHF6BnYaC8q/ALqhn 27yjo2Sor+W84XxHS7eJCq+VUecY1yZP91hZ9zubR8iAqn5vWp2kTVpoIWjPYphWfpqcb vFkg6R0tYDeAgfUz89oQ9wQgI/eNvXEOuN03n9RqMTFlvinSj9QTF+uTKvysX10Mx9Kbr D0QeQgx0Y4HBaeF/Ihb6gxH/JKh2kcimFnKMZBf6fV+OzRaeVOBIkPfyFZxUxt6KFUoXy vaBPuYY5Vjvbw8dgQ3hO9Lqr1wmx+tBQVOnfR1bq2ZRfhA1jSNn04ogr74GDlJMk9Hg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796388521; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=eCI/pChXj1jF6btHtZLaBbKKxW0Cx3N0OvMFhhFpRX4=; b=yBwOHxNmZxUAohKRyvGa/7FZU8yczSdqNdjI9eibS/l/EbOIBg6ls2nHf10OnWGjKoWM nJDfNV4LpErwLmr5QbuNg8jpIh4PFAUj5ZpEwSAUs4kBakzyGM2+TShKN/yF0E5kwog7f sWbrrcxRCAvswf1ghXGUKWnJKi7Xj7Z4azInMsNk9aQ+GwS6mOGeC6CysiEy9y/AF7zHJ l8RlDur3gpWqLTB9R9uks3lXyCBUMGJ4VPHyhycNsVBlL4W/ayqu7PjSU7c7ylHhWjGCY duQNiOW8zQgH+zQnBLHpadFoncfhOcO04Zx2RJqrK2P6xN/PC289wqK/m0q6ZXlu/Tw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=sUrkfGfY; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A7D03606A322; Fri, 4 Dec 2026 12:48:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=sUrkfGfY Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2374D1F000CE; Fri, 4 Dec 2026 12:48:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796388521; bh=eCI/pChXj1jF6btHtZLaBbKKxW0Cx3N0OvMFhhFpRX4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=sUrkfGfYRgiTB/FbTme++0+aKRzNbrW8/FW9NsMA+R9oIPycZo/8weZv+ztOLXNYH HY2LZ3Mv1quEWF+vvxflcnyYQiTGOj+INc+nh0OOjZcDPJPo5+9zJU2wkeNTENSS1h x6NLqddE6jcAjZiZ+DKcfvP4d8cVoMbZW+AHsLxY= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Su Hui , Christian Brauner , Petr Vaganov Subject: [PATCH 6.1 0649/1059] fs/stat.c: avoid harmless garbage value problem in vfs_statx_path() Date: Fri, 4 Dec 2026 19:03:00 +0900 Message-ID: <20261204100700.875001200@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100643.980430235@linuxfoundation.org> References: <20261204100643.980430235@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Su Hui commit 0fac3ed473dd2955053be6671cdd747807f5e488 upstream. Clang static checker(scan-build) warning: fs/stat.c:287:21: warning: The left expression of the compound assignment is an uninitialized value. The computed value will also be garbage. 287 | stat->result_mask |= STATX_MNT_ID_UNIQUE; | ~~~~~~~~~~~~~~~~~ ^ fs/stat.c:290:21: warning: The left expression of the compound assignment is an uninitialized value. The computed value will also be garbage. 290 | stat->result_mask |= STATX_MNT_ID; When vfs_getattr() failed because of security_inode_getattr(), 'stat' is uninitialized. In this case, there is a harmless garbage problem in vfs_statx_path(). It's better to return error directly when vfs_getattr() failed, avoiding garbage value and more clearly. Signed-off-by: Su Hui Link: https://lore.kernel.org/r/20250119025946.1168957-1-suhui@nfschina.com Signed-off-by: Christian Brauner [ Petr: There is no vfs_statx_path() in this tree. The fix is applied directly in vfs_statx() by jumping to path_put() via a new out_path label, preserving the reference drop and the ESTALE retry. ] Fixes: fa2fcf4f1df1 ("statx: add mount ID") Signed-off-by: Petr Vaganov Signed-off-by: Greg Kroah-Hartman --- fs/stat.c | 3 +++ 1 file changed, 3 insertions(+) --- a/fs/stat.c +++ b/fs/stat.c @@ -235,6 +235,8 @@ retry: goto out; error = vfs_getattr(&path, stat, request_mask, flags); + if (error) + goto out_path; stat->mnt_id = real_mount(path.mnt)->mnt_id; stat->result_mask |= STATX_MNT_ID; @@ -251,6 +253,7 @@ retry: bdev_statx_dioalign(inode, stat); } +out_path: path_put(&path); if (retry_estale(error, lookup_flags)) { lookup_flags |= LOOKUP_REVAL;