Skip to content

Commit d8eb12b

Browse files
committed
cifs: if deferred close is disabled then close files immediately
jira VULN-131073 cve-pre CVE-2025-38527 commit-author Bharath SM <bharathsm@microsoft.com> commit df9d70c If defer close timeout value is set to 0, then there is no need to include files in the deferred close list and utilize the delayed worker for closing. Instead, we can close them immediately. Signed-off-by: Bharath SM <bharathsm@microsoft.com> Reviewed-by: Shyam Prasad N <sprasad@microsoft.com> Cc: stable@vger.kernel.org Signed-off-by: Steve French <stfrench@microsoft.com> (cherry picked from commit df9d70c) Signed-off-by: Brett Mastbergen <bmastbergen@ciq.com>
1 parent 831935f commit d8eb12b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fs/cifs/file.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -948,8 +948,8 @@ int cifs_close(struct inode *inode, struct file *file)
948948
cfile = file->private_data;
949949
file->private_data = NULL;
950950
dclose = kmalloc(sizeof(struct cifs_deferred_close), GFP_KERNEL);
951-
if ((cinode->oplock == CIFS_CACHE_RHW_FLG) &&
952-
cinode->lease_granted &&
951+
if ((cifs_sb->ctx->closetimeo && cinode->oplock == CIFS_CACHE_RHW_FLG)
952+
&& cinode->lease_granted &&
953953
!test_bit(CIFS_INO_CLOSE_ON_LOCK, &cinode->flags) &&
954954
dclose) {
955955
if (test_and_clear_bit(CIFS_INO_MODIFIED_ATTR, &cinode->flags)) {

0 commit comments

Comments
 (0)