From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 035431684BE; Fri, 13 Feb 2026 13:56:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770990989; cv=none; b=FeeceaE3J2SeLhAXYHIh2khaaFfu9a/klZr6WcL0ZBIRe+vGMHOFtYQC/5rIAnltEHnw9FDJmyluyw6wKsnYNdTiXi0LOoE9atL8+y1TbsCNCafye7Yk5hlQ/KEWQwGqIaiv/ITfLu7OkKBbi8SVT6QQ7/OqIibRMhYXIzgSmbE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770990989; c=relaxed/simple; bh=JnV4o7IHb8DA0S1Bhr5E0n46j/tcZxMlKS3Vxf3nLFA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=FYW+1DctDiUzJ2zLDlNT5OOylyK22FHw2Klak2o9d9PMIlWyTu7iRa4kqsxP/3KQp2QY4V/UrLAIH3+7XiLJUPfuw480feI5iZZOh2OXFdtOBZ93s+gunWonXBhY04er7X7z/745kcHwWhm3BZYCzYoJB3ILN88TTJa4pNt8GYE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=jbFaBFpa; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="jbFaBFpa" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 39BABC16AAE; Fri, 13 Feb 2026 13:56:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1770990988; bh=JnV4o7IHb8DA0S1Bhr5E0n46j/tcZxMlKS3Vxf3nLFA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jbFaBFpaM4o0+Z2AANqvdpcT354RbI26qL5xD2M//0x3dlTGYdxgq1Y6UJ+AK7xk8 6DGeVxItJrd9JR3Je/1yu3LSf1FkXKR/NieXbq7hZQLwVlbiKcYRP0U2kZ9scnXt4/ fcFpdM013XYN0oT/87hGkMS0lH4nRQiTY7SNYTpA= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Henrique Carvalho , Steve French Subject: [PATCH 6.6 01/25] smb: client: split cached_fid bitfields to avoid shared-byte RMW races Date: Fri, 13 Feb 2026 14:48:27 +0100 Message-ID: <20260213134703.939478994@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260213134703.882698935@linuxfoundation.org> References: <20260213134703.882698935@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Henrique Carvalho commit ec306600d5ba7148c9dbf8f5a8f1f5c1a044a241 upstream. is_open, has_lease and on_list are stored in the same bitfield byte in struct cached_fid but are updated in different code paths that may run concurrently. Bitfield assignments generate byte read–modify–write operations (e.g. `orb $mask, addr` on x86_64), so updating one flag can restore stale values of the others. A possible interleaving is: CPU1: load old byte (has_lease=1, on_list=1) CPU2: clear both flags (store 0) CPU1: RMW store (old | IS_OPEN) -> reintroduces cleared bits To avoid this class of races, convert these flags to separate bool fields. Cc: stable@vger.kernel.org Fixes: ebe98f1447bbc ("cifs: enable caching of directories for which a lease is held") Signed-off-by: Henrique Carvalho Signed-off-by: Steve French Signed-off-by: Greg Kroah-Hartman --- fs/smb/client/cached_dir.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) --- a/fs/smb/client/cached_dir.h +++ b/fs/smb/client/cached_dir.h @@ -34,10 +34,10 @@ struct cached_fid { struct list_head entry; struct cached_fids *cfids; const char *path; - bool has_lease:1; - bool is_open:1; - bool on_list:1; - bool file_all_info_is_valid:1; + bool has_lease; + bool is_open; + bool on_list; + bool file_all_info_is_valid; unsigned long time; /* jiffies of when lease was taken */ struct kref refcount; struct cifs_fid fid;