Skip to content

Commit e2ff19f

Browse files
namjaejeonSteve French
authored andcommitted
ksmbd: fix type confusion via race condition when using ipc_msg_send_request
req->handle is allocated using ksmbd_acquire_id(&ipc_ida), based on ida_alloc. req->handle from ksmbd_ipc_login_request and FSCTL_PIPE_TRANSCEIVE ioctl can be same and it could lead to type confusion between messages, resulting in access to unexpected parts of memory after an incorrect delivery. ksmbd check type of ipc response but missing add continue to check next ipc reponse. Cc: [email protected] Reported-by: Norbert Szetei <[email protected]> Tested-by: Norbert Szetei <[email protected]> Signed-off-by: Namjae Jeon <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent d6e13e1 commit e2ff19f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

fs/smb/server/transport_ipc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,7 @@ static int handle_response(int type, void *payload, size_t sz)
281281
if (entry->type + 1 != type) {
282282
pr_err("Waiting for IPC type %d, got %d. Ignore.\n",
283283
entry->type + 1, type);
284+
continue;
284285
}
285286

286287
entry->response = kvzalloc(sz, KSMBD_DEFAULT_GFP);

0 commit comments

Comments
 (0)