YASUOKA Masahiko <yasu...@openbsd.org> wrote:

> Currently the value on VMware may be truncated silently.  It's simply
> broken.  I think we should fix it by having a way to know if the value
> is reached the limit.
> 
> Also I think we should be able to pass larger size of data.  Since at
> least on VMware, people is useing for parameters when deployment
> through OVF tamplate.  Sometimes the parameter includes large data
> like X.509 certificate.
> 
> https://docs.vmware.com/en/VMware-vSphere/7.0/com.vmware.vsphere.vm_admin.doc/GUID-D0F9E3B9-B77B-4DEF-A982-49B9F6358FF3.html
> 
> What do you think?
> 
> > Prepare a variable like kern.maxpvbus and default it to
> > 4096.  Futhermore, how about free() after copyout() to user space?
> 
> I suppose we can use the space prepared by the userland directly.

An example of this mechanism is SIOCGIFCONF.  The ioctl passes a pointer
to a struct containing length & pointer to data.  See net/if.c ifconf()
There are other similar schemes, but they all come down to asking the
kernel for the size and then doing a 2nd ioctl.

Or a 3rd or more calls, in case the value has changed in the meantime and
grown even further, but userland can realloc() the storage until it wins.

Reply via email to