This is a note to let you know that I've just added the patch titled VMCI: Fix possible memcpy() run-time warning in vmci_datagram_invoke_guest_handler() to the 5.10-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: vmci-fix-possible-memcpy-run-time-warning-in-vmci_datagram_invoke_guest_handler.patch and it can be found in the queue-5.10 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From e606e4b71798cc1df20e987dde2468e9527bd376 Mon Sep 17 00:00:00 2001 From: Vasiliy Kovalev <kovalev@xxxxxxxxxxxx> Date: Mon, 19 Feb 2024 13:53:15 +0300 Subject: VMCI: Fix possible memcpy() run-time warning in vmci_datagram_invoke_guest_handler() From: Vasiliy Kovalev <kovalev@xxxxxxxxxxxx> commit e606e4b71798cc1df20e987dde2468e9527bd376 upstream. The changes are similar to those given in the commit 19b070fefd0d ("VMCI: Fix memcpy() run-time warning in dg_dispatch_as_host()"). Fix filling of the msg and msg_payload in dg_info struct, which prevents a possible "detected field-spanning write" of memcpy warning that is issued by the tracking mechanism __fortify_memcpy_chk. Signed-off-by: Vasiliy Kovalev <kovalev@xxxxxxxxxxxx> Link: https://lore.kernel.org/r/20240219105315.76955-1-kovalev@xxxxxxxxxxxx Signed-off-by: Kees Cook <keescook@xxxxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/misc/vmw_vmci/vmci_datagram.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/misc/vmw_vmci/vmci_datagram.c +++ b/drivers/misc/vmw_vmci/vmci_datagram.c @@ -378,7 +378,8 @@ int vmci_datagram_invoke_guest_handler(s dg_info->in_dg_host_queue = false; dg_info->entry = dst_entry; - memcpy(&dg_info->msg, dg, VMCI_DG_SIZE(dg)); + dg_info->msg = *dg; + memcpy(&dg_info->msg_payload, dg + 1, dg->payload_size); INIT_WORK(&dg_info->work, dg_delayed_dispatch); schedule_work(&dg_info->work); Patches currently in stable-queue which might be from kovalev@xxxxxxxxxxxx are queue-5.10/vmci-fix-possible-memcpy-run-time-warning-in-vmci_datagram_invoke_guest_handler.patch