Skip to content

Commit fe64ed5

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 <[email protected]> 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 <[email protected]> Reviewed-by: Shyam Prasad N <[email protected]> Cc: [email protected] Signed-off-by: Steve French <[email protected]> (cherry picked from commit df9d70c) Signed-off-by: Brett Mastbergen <[email protected]>
1 parent 113ed70 commit fe64ed5

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)