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=1796385825; b=3LjY072dl7tL1OgouYZvKZyhXSI1vo88oB2HqWRbgmdA/TFCzopchTIR0OezeWWO9HFI GCkdn5etzwkEZ9elQFI0hJ4LDSbL54r5BNVhQh+X1qEqDfWDAoa/5V29swGFZ9P2cSRLj vUj9t3oaroSgozyrBziM3Gh6pr4bOSiF74Yiqeu3xduS5wTl3JP7b+4YkqaugPP8c4ee7 LlI/YmWz8bQRiEQTXP7n73flxF14I767ENM2wrdeacKJLpgRMP2dXwSv1syqqi7pk20HM nDxZqJARxvWMOXQA1Dg0mitDYAjhHWX/udV82yPlIBfiO5TOw+itrCn/WzJ5fW7UNlw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796385825; 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=1Z5iBY79ZyONIr2e1kC2/nyfFWqeugQLerwYtVTQwJE=; b=PMObDD64enzRa4mXm3uQ93dzRa8QiyoLXNN8Mr7AkXq7ncn9kWfcYDs3Jy/QWQdNxJtv 4ViP7ffZyX/aT0eaHfD+2wmXt5jpsQv1PorBVTxSMGXPZzPb/GAG/qUswjalPrGx8WJP2 Id80BpXn1GXtPni/rEllnIJSKR1qJfFKBETivYndtFuchy/the1QN3XybCUTDwfTDiYY1 5LrqkB0iEXphhOhnXkbvNK7H0vTYr+hFo2EYkP6hI2k+an2pKGe2SY+z0TnziJ0YWoBz4 MzZNq9XSLYTCaW0ZJc8GngqbOJwx3g7wHWxc6JCActvEfa/rT6U+updzFqjEGWA+Vrw== 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="qrM/WDm/"; 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 E4431606A33B; Fri, 4 Dec 2026 12:03:44 +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=qrM/WDm/ Received: by smtp.kernel.org (Postfix) with ESMTPSA id EC6251F00A07; Fri, 4 Dec 2026 12:03:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796385824; bh=1Z5iBY79ZyONIr2e1kC2/nyfFWqeugQLerwYtVTQwJE=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=qrM/WDm/TreytIeeLFI8iSuJk2wlfI5Z3yj6SmAl1K0CMP+Z3LQTBobMSqiW6CM4K xrFDmRRsedTNjHNoafvNH9e5kJBP0KwerQx1m5cXk7q14CIF+CYt4GUbMdw/GhMH57 CglUR+BLiM229F3+z8XcTOlW+UuT/cbymsIyR+78= 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.6 0706/1167] fs/stat.c: avoid harmless garbage value problem in vfs_statx_path() Date: Fri, 4 Dec 2026 19:02:13 +0900 Message-ID: <20261204100720.457394494@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100702.047403948@linuxfoundation.org> References: <20261204100702.047403948@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.6-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 @@ -250,6 +250,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; @@ -266,6 +268,7 @@ retry: bdev_statx_dioalign(inode, stat); } +out_path: path_put(&path); if (retry_estale(error, lookup_flags)) { lookup_flags |= LOOKUP_REVAL;