Skip to content

Commit 8f5d9be

Browse files
committed
Revert "vmci: Prevent the dispatching of uninitialized payloads"
This reverts commit bfb4cf9. While the code "looks" correct, the compiler has no way to know that doing "fun" pointer math like this really isn't a write off the end of the structure as there is no hint anywhere that the structure has data at the end of it. This causes the following build warning: In function 'fortify_memset_chk', inlined from 'ctx_fire_notification.isra' at drivers/misc/vmw_vmci/vmci_context.c:254:3: include/linux/fortify-string.h:480:25: error: call to '__write_overflow_field' declared with attribute warning: detected write beyond size of field (1st parameter); maybe use struct_group()? [-Werror=attribute-warning] 480 | __write_overflow_field(p_size_field, size); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ So revert it for now and it can come back in the future in a "sane" way that either correctly makes the structure know that there is trailing data, OR just the payload structure is properly referenced and zeroed out. Fixes: bfb4cf9 ("vmci: Prevent the dispatching of uninitialized payloads") Cc: Stephen Rothwell <[email protected]> Cc: Lizhi Xu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 626e894 commit 8f5d9be

1 file changed

Lines changed: 0 additions & 2 deletions

File tree

drivers/misc/vmw_vmci/vmci_context.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,6 @@ static int ctx_fire_notification(u32 context_id, u32 priv_flags)
251251
ev.msg.hdr.src = vmci_make_handle(VMCI_HYPERVISOR_CONTEXT_ID,
252252
VMCI_CONTEXT_RESOURCE_ID);
253253
ev.msg.hdr.payload_size = sizeof(ev) - sizeof(ev.msg.hdr);
254-
memset((char*)&ev.msg.hdr + sizeof(ev.msg.hdr), 0,
255-
ev.msg.hdr.payload_size);
256254
ev.msg.event_data.event = VMCI_EVENT_CTX_REMOVED;
257255
ev.payload.context_id = context_id;
258256

0 commit comments

Comments
 (0)