FAILED: patch "[PATCH] smb: client: fix file type corruption in" failed to apply to 6.1-stable tree
Subsystems (2)
[email protected]
maintainerThe patch below does not apply to the 6.1-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-6.1.y
git checkout FETCH_HEAD
git cherry-pick -x 6bd360447941357e959414a525aa62576a448116
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2026091631-outsider-blog-cbef@gregkh' --subject-prefix 'PATCH 6.1.y' 'HEAD^..'
Possible dependencies:
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 6bd360447941357e959414a525aa62576a448116 Mon Sep 17 00:00:00 2001
From: Paulo Alcantara <[email protected]>
Date: Sun, 6 Sep 2026 16:01:24 -0300
Subject: [PATCH] smb: client: fix file type corruption in
cifs_reparse_point_to_fattr()
Setting the file type in cf_mode without clearing the existing S_IFMT bits first is wrong as it corrupts the file type when cf_mode already has type bits set (e.g. S_IFREG | S_IFLNK == S_IFDIR | S_IFREG).
Clear S_IFMT before setting S_IFLNK for native and SMB1 symlinks.
fs/smb/client/reparse.c +1 -0
@@ -1280,6 +1280,7 @@ bool cifs_reparse_point_to_fattr(struct cifs_sb_info *cifs_sb,break ;case 0 :/* SMB1 symlink */ case IO_REPARSE_TAG_SYMLINK : + fattr->cf_mode &= ~S_IFMT ; fattr->cf_mode |=S_IFLNK ;break ;default :
Sasha Levin
maintainerPATCH 1/1 smb: client: fix file type corruption in cifs_reparse_point_to_fattr()
From: Paulo Alcantara <[email protected]>
[ Upstream commit 6bd360447941357e959414a525aa62576a448116 ]
Setting the file type in cf_mode without clearing the existing S_IFMT bits first is wrong as it corrupts the file type when cf_mode already has type bits set (e.g. S_IFREG | S_IFLNK == S_IFDIR | S_IFREG).
Clear S_IFMT before setting S_IFLNK for native and SMB1 symlinks.
--- fs/smb/client/inode.c | 1 + 1 file changed, 1 insertion(+)
fs/smb/client/inode.c +1 -0
@@ -672,6 +672,7 @@ static void smb311_posix_info_to_fattr(struct cifs_fattr *fattr, struct cifs_ope/* fattr->cf_rdev = le32_to_cpu(info->DeviceId); */ if (symlink) { + fattr->cf_mode &= ~S_IFMT ; fattr->cf_mode |=S_IFLNK ; fattr->cf_dtype =DT_LNK ; fattr->cf_symlink_target = data->symlink_target;
Signature · 1 line
2.53.0