FAILED: patch "[PATCH] smb: client: split cifsFileInfo bitfields to avoid" failed to apply to 5.10-stable tree
Subsystems (2)
[email protected]
maintainerThe patch below does not apply to the 5.10-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.10.y
git checkout FETCH_HEAD
git cherry-pick -x 19465a9aeb664f1d710d0d22c07c31bfb7c85446
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2026100538-barber-dazzling-d7df@gregkh' --subject-prefix 'PATCH 5.10.y' 'HEAD^..'
Possible dependencies:
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 19465a9aeb664f1d710d0d22c07c31bfb7c85446 Mon Sep 17 00:00:00 2001
From: Frank Sorenson <[email protected]>
Date: Wed, 30 Sep 2026 15:47:15 -0500
Subject: [PATCH] smb: client: split cifsFileInfo bitfields to avoid
shared-byte RMW races
The invalidHandle, swapfile, oplock_break_cancelled, offload, and status_file_deleted fields are stored in the same bitfield byte in struct cifsFileInfo, but are updated in different code paths that may run simultaneously, and are protected by different locks. Since bitfield assignments generate byte-level read-modify-write operations, a modification to one flag can overwrite a concurrent modification to another flag.
To avoid these races, convert these flags from a bitfield to separate bool fields.
fs/smb/client/cifsglob.h +5 -5
@@ -1450,11 +1450,11 @@ struct cifsFileInfo {struct dentry *dentry;struct tcon_link *tlink;unsigned int f_flags; - bool invalidHandle:1; /* file closed via session abend */ - bool swapfile:1; - bool oplock_break_cancelled:1; - bool status_file_deleted:1; /* file has been deleted */ - bool offload:1; /* offload final part of _put to a wq */ +bool invalidHandle;/* file closed via session abend */ +bool swapfile; +bool oplock_break_cancelled; +bool status_file_deleted;/* file has been deleted */ +bool offload;/* offload final part of _put to a wq */ __u16 oplock_epoch;/* epoch from the lease break */ __u32 oplock_level;/* oplock/lease level from the lease break */ int count;
PATCH 1/1 smb: client: split cifsFileInfo bitfields to avoid shared-byte RMW races
[ Upstream commit 19465a9aeb664f1d710d0d22c07c31bfb7c85446 ]
The invalidHandle, swapfile, oplock_break_cancelled, offload, and status_file_deleted fields are stored in the same bitfield byte in struct cifsFileInfo, but are updated in different code paths that may run simultaneously, and are protected by different locks. Since bitfield assignments generate byte-level read-modify-write operations, a modification to one flag can overwrite a concurrent modification to another flag.
To avoid these races, convert these flags from a bitfield to separate bool fields.
--- fs/cifs/cifsglob.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
fs/cifs/cifsglob.h +3 -3
@@ -1322,9 +1322,9 @@ struct cifsFileInfo {struct dentry *dentry;struct tcon_link *tlink;unsigned int f_flags; - bool invalidHandle:1; /* file closed via session abend */ - bool swapfile:1; - bool oplock_break_cancelled:1; +bool invalidHandle;/* file closed via session abend */ +bool swapfile; +bool oplock_break_cancelled;unsigned int oplock_epoch;/* epoch from the lease break */ __u32 oplock_level;/* oplock/lease level from the lease break */ int count;
Signature · 1 line
2.55.0
Re: [PATCH 5.10.y] smb: client: split cifsFileInfo bitfields to avoid shared-byte RMW races
Quoted 1 line
[ Upstream commit
19465a9aeb664f1d710d0d22c07c31bfb7c85446]
Queued for 5.10, thanks.
Signature · 2 lines
Thanks, Sasha