ksmbd: fix uaf in smb20_oplock_break_ack
authorluosili <rootlab@huawei.com>
Wed, 4 Oct 2023 09:29:36 +0000 (18:29 +0900)
committerSteve French <stfrench@microsoft.com>
Thu, 5 Oct 2023 01:21:48 +0000 (20:21 -0500)
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>
fs/smb/server/smb2pdu.c

index 420e7691c8cfc92f19725a95ba3f1933fbc8dca5..b9d6e8e451ba215b6bb9c4692fd59f2714954e44 100644 (file)
@@ -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;