Page MenuHomeFreeBSD

vmm: Bump vmname buffer in struct vm to VM_MAX_NAMELEN + 1
ClosedPublic

Authored by khng on Aug 1 2021, 10:55 AM.
Tags
None
Referenced Files
F166652750: D31372.id93099.diff
Sat, Aug 15, 5:55 AM
Unknown Object (File)
Fri, Aug 14, 8:15 PM
Unknown Object (File)
Thu, Aug 13, 11:23 PM
Unknown Object (File)
Sat, Aug 8, 5:15 PM
Unknown Object (File)
Sat, Aug 8, 11:53 AM
Unknown Object (File)
Fri, Aug 7, 1:40 PM
Unknown Object (File)
Sun, Aug 2, 2:44 AM
Unknown Object (File)
Sun, Aug 2, 12:45 AM

Details

Summary

In hw.vmm.create sysctl handler the maximum length of vm name is
VM_MAX_NAMELEN. However in vm_create() the maximum length allowed is
only VM_MAX_NAMELEN - 1 chars. Bump the length of the internal buffer to
allow the length of VM_MAX_NAMELEN for vm name.

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

khng requested review of this revision.Aug 1 2021, 10:55 AM
This revision is now accepted and ready to land.Aug 2 2021, 6:49 AM
jhb added inline comments.
sys/amd64/vmm/vmm.c
177

I suspect this results in some padding now? Perhaps it would be best to move this field below the vcpu[] array at least?

sys/amd64/vmm/vmm.c
177

It does not create padding with default SPECNAMELEN on FreeBSD 12 and 13, but might be the case for other SPECNAMELEN values.