CVSROOT:        /cvs
Module name:    src
Changes by:     d...@cvs.openbsd.org    2025/05/12 11:17:42

Modified files:
        usr.sbin/vmd   : config.c control.c priv.c proc.c proc.h 
                         vioblk.c vionet.c virtio.c virtio.h vm.c 
                         vm_agentx.c vmd.c vmd.h vmm.c 

Log message:
vmd(8): make imsg objects opaque and sanitize char[]s.

vmd directly manipulated the inner members of imsg's throughout the
codebase. Given a report of unchecked usage of some particular
structs passed via imsg, this commit cleans up the imsg usage as
well as santizes the embedded char[]'s in structs passed via imsg.

All imsg metadata and data access now go through the imsg api (e.g.
imsg_get_data(3)) and unmarshalling is handled in centralized
locations with size checking and insertion of NUL-terminators in
any char[]s.

The result is no functional or behavioral change to vmd, but now
all imsg's are treated opaquely and data santization is in a single
function per type.

NUL-termination issues reported by S. Ai, H. Lefeuvre, Systopia
team.

Review and guidance from claudio@.

ok claudio@

Reply via email to