Skip to content

Commit

Permalink
ksmbd: smb1: add missing ksmbd_update_fstate calls
Browse files Browse the repository at this point in the history
fixes fd leaks which result in ksmbd not being able to accept
new clients.

Can be reproduced with repeatedly renaming a file on the share.

Signed-off-by: Marios Makassikis <[email protected]>
Signed-off-by: Namjae Jeon <[email protected]>
  • Loading branch information
Marios Makassikis authored and namjaejeon committed Dec 2, 2024
1 parent b8745fa commit 0e01afb
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions smb1pdu.c
Original file line number Diff line number Diff line change
Expand Up @@ -884,6 +884,7 @@ int smb_rename(struct ksmbd_work *work)
goto out;
}

ksmbd_update_fstate(&work->sess->file_table, fp, FP_INITED);
rc = ksmbd_vfs_fp_rename(work, fp, newname);
if (rc) {
rsp->hdr.Status.CifsError = STATUS_NO_MEMORY;
Expand Down Expand Up @@ -5190,6 +5191,7 @@ static int smb_posix_open(struct ksmbd_work *work)
out:
switch (err) {
case 0:
ksmbd_update_fstate(&work->sess->file_table, fp, FP_INITED);
break;
case -ENOSPC:
pSMB_rsp->hdr.Status.CifsError = STATUS_DISK_FULL;
Expand Down

0 comments on commit 0e01afb

Please sign in to comment.