Skip to content

Commit fcbd26d

Browse files
benzeajmberg-intel
authored andcommitted
um: virtio_uml: send SET_MEM_TABLE message with the exact size
The rust based userspace vhost devices are very strict and will not accept the message if it is longer than required. So, only include the data for the first memory region. Signed-off-by: Benjamin Berg <benjamin.berg@intel.com> Link: https://patch.msgid.link/20241103212854.1436046-2-benjamin@sipsolutions.net Signed-off-by: Johannes Berg <johannes.berg@intel.com>
1 parent ce6e85a commit fcbd26d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/um/drivers/virtio_uml.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,7 @@ static int vhost_user_set_mem_table(struct virtio_uml_device *vu_dev)
623623
{
624624
struct vhost_user_msg msg = {
625625
.header.request = VHOST_USER_SET_MEM_TABLE,
626-
.header.size = sizeof(msg.payload.mem_regions),
626+
.header.size = offsetof(typeof(msg.payload.mem_regions), regions[1]),
627627
.payload.mem_regions.num = 1,
628628
};
629629
unsigned long reserved = uml_reserved - uml_physmem;

0 commit comments

Comments
 (0)