FAILED: patch "[PATCH] smb: client: fix potential NULL deref in" failed to apply to 4.19-stable tree
Subsystems (2)
[email protected]
maintainerThe patch below does not apply to the 4.19-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-4.19.y
git checkout FETCH_HEAD
git cherry-pick -x 92414333eb375ed64f4ae92d34d579e826936480
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2023121141-decoy-kennel-84d0@gregkh' --subject-prefix 'PATCH 4.19.y' HEAD^..
Possible dependencies:
92414333eb37 ("smb: client: fix potential NULL deref in parse_dfs_referrals()") 38c8a9a52082 ("smb: move client and server files to common directory fs/smb") abdb1742a312 ("cifs: get rid of mount options string parsing")9fd29a5bae6e ("cifs: use fs_context for automounts")5dd8ce24667a ("cifs: missing directory in MAINTAINERS file")332019e23a51 ("Merge tag '5.20-rc-smb3-client-fixes-part2' of git://git.samba.org/sfrench/cifs-2.6")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 92414333eb375ed64f4ae92d34d579e826936480 Mon Sep 17 00:00:00 2001
From: Paulo Alcantara <[email protected]>
Date: Tue, 5 Dec 2023 21:49:29 -0300
Subject: [PATCH] smb: client: fix potential NULL deref in
parse_dfs_referrals()
If server returned no data for FSCTL_DFS_GET_REFERRALS, @dfs_rsp will remain NULL and then parse_dfs_referrals() will dereference it.
Fix this by returning -EIO when no output data is returned.
Besides, we can't fix it in SMB2_ioctl() as some FSCTLs are allowed to return no data as per MS-SMB2 2.2.32.
fs/smb/client/smb2ops.c +2 -0
@@ -2836,6 +2836,8 @@ smb2_get_dfs_refer(const unsigned int xid, struct cifs_ses *ses,usleep_range (512 ,2048 ); }while (++retry_count <5 ); +if (!rc && !dfs_rsp) + rc = -EIO ;if (rc) {if (!is_retryable_error (rc) && rc != -ENOENT && rc != -EOPNOTSUPP )cifs_tcon_dbg (VFS ,"%s: ioctl error: rc=%d\n" , __func__, rc);