This is a note to let you know that I've just added the patch titled cifs: Fix xid leak in cifs_get_file_info_unix() to the 6.0-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: cifs-fix-xid-leak-in-cifs_get_file_info_unix.patch and it can be found in the queue-6.0 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 10269f13257d4eb6061d09ccce61666316df9838 Mon Sep 17 00:00:00 2001 From: Zhang Xiaoxu <zhangxiaoxu5@xxxxxxxxxx> Date: Mon, 17 Oct 2022 22:45:25 +0800 Subject: cifs: Fix xid leak in cifs_get_file_info_unix() From: Zhang Xiaoxu <zhangxiaoxu5@xxxxxxxxxx> commit 10269f13257d4eb6061d09ccce61666316df9838 upstream. If stardup the symlink target failed, should free the xid, otherwise the xid will be leaked. Fixes: 76894f3e2f71 ("cifs: improve symlink handling for smb2+") Reviewed-by: Paulo Alcantara (SUSE) <pc@xxxxxx> Signed-off-by: Zhang Xiaoxu <zhangxiaoxu5@xxxxxxxxxx> Signed-off-by: Steve French <stfrench@xxxxxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- fs/cifs/inode.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c @@ -368,8 +368,10 @@ cifs_get_file_info_unix(struct file *fil if (cfile->symlink_target) { fattr.cf_symlink_target = kstrdup(cfile->symlink_target, GFP_KERNEL); - if (!fattr.cf_symlink_target) - return -ENOMEM; + if (!fattr.cf_symlink_target) { + rc = -ENOMEM; + goto cifs_gfiunix_out; + } } rc = CIFSSMBUnixQFileInfo(xid, tcon, cfile->fid.netfid, &find_data); Patches currently in stable-queue which might be from zhangxiaoxu5@xxxxxxxxxx are queue-6.0/mtd-fix-device-name-leak-when-register-device-failed.patch queue-6.0/f2fs-fix-the-race-condition-of-resize-flag-between-r.patch queue-6.0/orangefs-fix-kmemleak-in-orangefs_-kernel-client-_de.patch queue-6.0/orangefs-fix-kmemleak-in-orangefs_sysfs_init.patch queue-6.0/rdma-rxe-fix-null-ptr-deref-in-rxe_qp_do_cleanup-whe.patch queue-6.0/orangefs-fix-kmemleak-in-orangefs_prepare_debugfs_he.patch queue-6.0/cifs-fix-xid-leak-in-cifs_get_file_info_unix.patch queue-6.0/orangefs-fix-sysfs-not-cleanup-when-dev-init-failed.patch queue-6.0/xprtrdma-fix-regbuf-data-not-freed-in-rpcrdma_req_cr.patch