Skip to content

Commit

Permalink
ksmbd: fix uaf in smb20_oplock_break_ack
Browse files Browse the repository at this point in the history
drop reference after use opinfo.

Signed-off-by: luosili <rootlab@huawei.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
  • Loading branch information
luosili authored and Steve French committed Oct 5, 2023
1 parent 5a7ee91 commit c698134
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/smb/server/smb2pdu.c
Original file line number Diff line number Diff line change
Expand Up @@ -8038,10 +8038,10 @@ static void smb20_oplock_break_ack(struct ksmbd_work *work)
goto err_out;
}

opinfo_put(opinfo);
ksmbd_fd_put(work, fp);
opinfo->op_state = OPLOCK_STATE_NONE;
wake_up_interruptible_all(&opinfo->oplock_q);
opinfo_put(opinfo);
ksmbd_fd_put(work, fp);

rsp->StructureSize = cpu_to_le16(24);
rsp->OplockLevel = rsp_oplevel;
Expand Down

0 comments on commit c698134

Please sign in to comment.