Skip to content

Commit cbb18b5

Browse files
gkennedy12SherryYang1
authored andcommitted
VMCI: check context->notify_page after call to get_user_pages_fast() to avoid GPF
[ Upstream commit 1a726cb ] The call to get_user_pages_fast() in vmci_host_setup_notify() can return NULL context->notify_page causing a GPF. To avoid GPF check if context->notify_page == NULL and return error if so. general protection fault, probably for non-canonical address 0xe0009d1000000060: 0000 [#1] PREEMPT SMP KASAN NOPTI KASAN: maybe wild-memory-access in range [0x0005088000000300- 0x0005088000000307] CPU: 2 PID: 26180 Comm: repro_34802241 Not tainted 6.1.0-rc4 #1 Hardware name: Red Hat KVM, BIOS 1.15.0-2.module+el8.6.0 04/01/2014 RIP: 0010:vmci_ctx_check_signal_notify+0x91/0xe0 Call Trace: <TASK> vmci_host_unlocked_ioctl+0x362/0x1f40 __x64_sys_ioctl+0x1a1/0x230 do_syscall_64+0x3a/0x90 entry_SYSCALL_64_after_hwframe+0x63/0xcd Fixes: a1d8843 ("VMCI: Fix two UVA mapping bugs") Reported-by: syzkaller <syzkaller@googlegroups.com> Signed-off-by: George Kennedy <george.kennedy@oracle.com> Reviewed-by: Vishnu Dasa <vdasa@vmware.com> Link: https://lore.kernel.org/r/1669666705-24012-1-git-send-email-george.kennedy@oracle.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Stable-dep-of: 1bd6406 ("VMCI: fix race between vmci_host_setup_notify and vmci_ctx_unset_notify") Signed-off-by: Sasha Levin <sashal@kernel.org> (cherry picked from commit b4239bfb260d1e6837766c41a0b241d7670f1402) Signed-off-by: Sherry Yang <sherry.yang@oracle.com>
1 parent 6ec43c9 commit cbb18b5

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/misc/vmw_vmci/vmci_host.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,8 @@ static int vmci_host_setup_notify(struct vmci_ctx *context,
245245
context->notify_page = NULL;
246246
return VMCI_ERROR_GENERIC;
247247
}
248+
if (context->notify_page == NULL)
249+
return VMCI_ERROR_UNAVAILABLE;
248250

249251
/*
250252
* Map the locked page and set up notify pointer.

0 commit comments

Comments
 (0)