[vbox-dev] [PATCH 2nd resend] VBoxServiceAutoMount: Change Linux mount code to use

Hans de Goede hdegoede at redhat.com
Tue May 7 14:38:12 GMT 2019


On 04-05-19 16:44, Michael Thayer wrote:
> 03.05.19 23:40, Knut St. Osmundsen wrote:
> [...]
>> Finally, does the libc or kernel mount() implementation somehow invoke
>> the /sbin/mount.vboxsf helper tool?  Please point me to the code causing
>> this, because our vboxsf sources does not parse any parameter strings,
>> it is binary struct only.
> The mount(8) manual page reads to me that the mount utility calls the
> mount helper (or skips it if you pass "-i").  Our mount helper calls
> mount(2) to perform the actual mount.  Hans modified the shared folder
> kernel code to do the parsing.

Right, IIRC we agreed that you would make the same changes to the vboxsf
version included with vbox-guest-additions starting 6.0.0, so that
mount.vboxsf could be retired / not used for 6.0.x vms, but that clearly
did not happen.

I think the best way forward is for the automount code at least to
deal with both scenarios. If it tries the old method with the
custom vbox options struct which is also used by mount.vboxsf first,
then that will trigger:

	if (options[0] == VBSF_MOUNT_SIGNATURE_BYTE_0 &&
	    options[1] == VBSF_MOUNT_SIGNATURE_BYTE_1 &&
	    options[2] == VBSF_MOUNT_SIGNATURE_BYTE_2 &&
	    options[3] == VBSF_MOUNT_SIGNATURE_BYTE_3) {
		vbg_err("vboxsf: Old binary mount data not supported, remove obsolete mount.vboxsf and/or update your VBoxService.\n");
		return -EINVAL;

In my vboxsf code intended for use with the mainline kernel, I could
lower that to a warning and you could check to the -EINVAL, or we
could do things the other way around and first try the options as
simple string approach.

Note I'm not sure what the vboxsf version included with vbox-guest-additions
will do in this case. If it returns an error we can check for and it
is silent while doing that it might be better to try the options as
simple string approach first.

If we can figure out how we want to deal with this I can prepare a patch
for VBoxService to try both methods.



More information about the vbox-dev mailing list