From 2dc0dc4b24838ab4bf0619f2527c0377d1cc93a3 Mon Sep 17 00:00:00 2001 From: luosili Date: Mon, 2 Oct 2023 20:58:39 +0900 Subject: [PATCH] ksmbd: fix uaf in smb20_oplock_break_ack drop reference after use opinfo. Signed-off-by: luosili Signed-off-by: Namjae Jeon --- smb2pdu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/smb2pdu.c b/smb2pdu.c index a4f7266ea..de5de1062 100644 --- a/smb2pdu.c +++ b/smb2pdu.c @@ -8661,10 +8661,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;