From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BC5A6306D3F; Tue, 26 Aug 2025 14:07:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756217276; cv=none; b=NbJn9FCllR01OQPTOe7efiR2RTyxmDqxp4XU4Ty++Y2xg88y3R5sdEosTxQ8V3E3w/lpwDRo0MoyySbGQMNFVC1KTPMFY9vHRgGI/IMvk5oNBdAtB5kk4OEUYRKDQxzocYHmvAbM7e6ppgOm3wF2EKiMhnwwbkot1dK2gZ4Papw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756217276; c=relaxed/simple; bh=Ei84zOudAJlk2yxA4KUArfKlIeQinhICnYKnpZH4zLM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=M0Unuiilmt3N0mQ4wZc7FhaDQHkB1iKA3NYzP7PUErA3WFXiEIbdeDgiA29ybD0BM13dAjG5CYR2TZ8Cxj/KkeUcGv48QDqKHPUDc0n5d5kXFQ9cB1Lr/FY14N15tv9m6seH1ERSJ+9HIFkCzt0jVu1aJZikwVkq/riB3t+z7W0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=WyUEkZCM; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="WyUEkZCM" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 46F90C4CEF1; Tue, 26 Aug 2025 14:07:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1756217276; bh=Ei84zOudAJlk2yxA4KUArfKlIeQinhICnYKnpZH4zLM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WyUEkZCMokcR07vwEEWAlhcsdNrufE0Mac24xPUZOL7EDSK7gVxfJ3yX/ND12WSkv LVzCmVntEfGpWg8XS1gO1owSdDTUMAfG+5GDX0pgONPX4CvqKas8eqJywBXIIbk6Ez XVV2iEIKczqIUzMRURLW/9idwKq64UBRoXK1sgN8= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, syzbot+9b9124ae9b12d5af5d95@syzkaller.appspotmail.com, Lizhi Xu , Sasha Levin Subject: [PATCH 5.10 083/523] vmci: Prevent the dispatching of uninitialized payloads Date: Tue, 26 Aug 2025 13:04:53 +0200 Message-ID: <20250826110926.607712980@linuxfoundation.org> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250826110924.562212281@linuxfoundation.org> References: <20250826110924.562212281@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.10-stable review patch. If anyone has any objections, please let me know. ------------------ From: Lizhi Xu [ Upstream commit bfb4cf9fb97e4063f0aa62e9e398025fb6625031 ] The reproducer executes the host's unlocked_ioctl call in two different tasks. When init_context fails, the struct vmci_event_ctx is not fully initialized when executing vmci_datagram_dispatch() to send events to all vm contexts. This affects the datagram taken from the datagram queue of its context by another task, because the datagram payload is not initialized according to the size payload_size, which causes the kernel data to leak to the user space. Before dispatching the datagram, and before setting the payload content, explicitly set the payload content to 0 to avoid data leakage caused by incomplete payload initialization. Fixes: 28d6692cd8fb ("VMCI: context implementation.") Reported-by: syzbot+9b9124ae9b12d5af5d95@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=9b9124ae9b12d5af5d95 Tested-by: syzbot+9b9124ae9b12d5af5d95@syzkaller.appspotmail.com Signed-off-by: Lizhi Xu Link: https://lore.kernel.org/r/20250627055214.2967129-1-lizhi.xu@windriver.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/misc/vmw_vmci/vmci_context.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/misc/vmw_vmci/vmci_context.c b/drivers/misc/vmw_vmci/vmci_context.c index 26ff49fdf0f7..ccadbc0d8f7d 100644 --- a/drivers/misc/vmw_vmci/vmci_context.c +++ b/drivers/misc/vmw_vmci/vmci_context.c @@ -251,6 +251,8 @@ static int ctx_fire_notification(u32 context_id, u32 priv_flags) ev.msg.hdr.src = vmci_make_handle(VMCI_HYPERVISOR_CONTEXT_ID, VMCI_CONTEXT_RESOURCE_ID); ev.msg.hdr.payload_size = sizeof(ev) - sizeof(ev.msg.hdr); + memset((char*)&ev.msg.hdr + sizeof(ev.msg.hdr), 0, + ev.msg.hdr.payload_size); ev.msg.event_data.event = VMCI_EVENT_CTX_REMOVED; ev.payload.context_id = context_id; -- 2.39.5