Skip to content

Commit aa7b0df

Browse files
committed
cifs: fix leak of iface for primary channel
jira LE-4669 Rebuild_History Non-Buildable kernel-4.18.0-553.82.1.el8_10 commit-author Shyam Prasad N <sprasad@microsoft.com> commit 29954d5 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: fa1d050 ("cifs: account for primary channel in the interface list") Cc: stable@vger.kernel.org Reported-by: Paulo Alcantara <pc@manguebit.com> Signed-off-by: Shyam Prasad N <sprasad@microsoft.com> Signed-off-by: Steve French <stfrench@microsoft.com> (cherry picked from commit 29954d5) Signed-off-by: Jonathan Maple <jmaple@ciq.com>
1 parent 1112564 commit aa7b0df

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

fs/cifs/connect.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1851,6 +1851,12 @@ void cifs_put_smb_ses(struct cifs_ses *ses)
18511851
}
18521852
}
18531853

1854+
/* we now account for primary channel in iface->refcount */
1855+
if (ses->chans[0].iface) {
1856+
kref_put(&ses->chans[0].iface->refcount, release_iface);
1857+
ses->chans[0].server = NULL;
1858+
}
1859+
18541860
sesInfoFree(ses);
18551861
cifs_put_tcp_session(server, 0);
18561862
}

0 commit comments

Comments
 (0)