Patch "cifs: fix leak of iface for primary channel" has been added to the 6.6-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    cifs: fix leak of iface for primary channel

to the 6.6-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-leak-of-iface-for-primary-channel.patch
and it can be found in the queue-6.6 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 0192c8a0dba427258ee6128abffad105aa1a8d09
Author: Shyam Prasad N <sprasad@xxxxxxxxxxxxx>
Date:   Tue Nov 14 04:54:12 2023 +0000

    cifs: fix leak of iface for primary channel
    
    [ Upstream commit 29954d5b1e0d67a4cd61c30c2201030c97e94b1e ]
    
    My last change in this area introduced a change which
    accounted for primary channel in the interface ref count.
    However, it did not reduce this ref count on deallocation
    of the primary channel. i.e. during umount.
    
    Fixing this leak here, by dropping this ref count for
    primary channel while freeing up the session.
    
    Fixes: fa1d0508bdd4 ("cifs: account for primary channel in the interface list")
    Cc: stable@xxxxxxxxxxxxxxx
    Reported-by: Paulo Alcantara <pc@xxxxxxxxxxxxx>
    Signed-off-by: Shyam Prasad N <sprasad@xxxxxxxxxxxxx>
    Signed-off-by: Steve French <stfrench@xxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/fs/smb/client/connect.c b/fs/smb/client/connect.c
index a9632c060bceb..d517651d7bcea 100644
--- a/fs/smb/client/connect.c
+++ b/fs/smb/client/connect.c
@@ -2034,6 +2034,12 @@ void __cifs_put_smb_ses(struct cifs_ses *ses)
 		}
 	}
 
+	/* we now account for primary channel in iface->refcount */
+	if (ses->chans[0].iface) {
+		kref_put(&ses->chans[0].iface->refcount, release_iface);
+		ses->chans[0].server = NULL;
+	}
+
 	sesInfoFree(ses);
 	cifs_put_tcp_session(server, 0);
 }



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux