VirtualBox

Changeset 69149 in vbox for trunk/src/VBox/Additions/linux


Ignore:
Timestamp:
Oct 20, 2017 2:53:19 PM (7 years ago)
Author:
vboxsync
Message:

Additions/linux/shfl: stop supporting old host/mount.vboxsf versions.
bugref:4567: Linux kernel driver maintenance

Based on [PATCH] Remove support for old hosts and userspace mount.vboxsf
Signed-off-by: Hans de Goede <hdegoede@…>

Versions of VirtualBox many years ago used a different host/guest protocol
for accessing shared folders, as well as a different guest kernel to
user-space mount helper protocol. While we try to support old Additions
versions on the host side, we only aim to support old host versions in the
Additions to a limited extent, and the guest kernel interface is also only
fixed for a defined range of releases.

Location:
trunk/src/VBox/Additions/linux/sharedfolders
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/linux/sharedfolders/mount.vboxsf.c

    r69046 r69149  
    504504        err = mount(host_name, mount_point, "vboxsf", flags, &mntinf);
    505505    }
    506     if (err == -1 && errno == EPROTO)
    507     {
    508         /* New mount tool with old vboxsf module? Try again using the old
    509          * vbsf_mount_info_old structure. */
    510         struct vbsf_mount_info_old mntinf_old;
    511         memcpy(&mntinf_old.name, &mntinf.name, MAX_HOST_NAME);
    512         memcpy(&mntinf_old.nls_name, mntinf.nls_name, MAX_NLS_NAME);
    513         mntinf_old.uid = mntinf.uid;
    514         mntinf_old.gid = mntinf.gid;
    515         mntinf_old.ttl = mntinf.ttl;
    516         err = mount(host_name, mount_point, "vboxsf", flags, &mntinf_old);
    517     }
    518506    if (err)
    519507        panic_err("%s: mounting failed with the error", argv[0]);
  • trunk/src/VBox/Additions/linux/sharedfolders/vbsfmount.h

    r62527 r69149  
    1818#define VBFS_MOUNT_H
    1919
     20/* Linux constraints the size of data mount argument to PAGE_SIZE - 1. */
    2021#define MAX_HOST_NAME  256
    2122#define MAX_NLS_NAME    32
    22 
    23 /* Linux constraints the size of data mount argument to PAGE_SIZE - 1. */
    24 struct vbsf_mount_info_old
    25 {
    26     char name[MAX_HOST_NAME];
    27     char nls_name[MAX_NLS_NAME];
    28     int  uid;
    29     int  gid;
    30     int  ttl;
    31 };
    3223
    3324#define VBSF_MOUNT_SIGNATURE_BYTE_0 '\377'
     
    3728struct vbsf_mount_info_new
    3829{
    39     char nullchar;              /* name cannot be '\0' -- we use this field
    40                                    to distinguish between the old structure
    41                                    and the new structure */
     30    /*
     31     * The old version of the mount_info struct started with a
     32     * char name[MAX_HOST_NAME] field, where name cannot be '\0'.
     33     * So the new version of the mount_info struct starts with a
     34     * nullchar field which is always 0 so that we can detect and
     35     * reject the old structure being passed.
     36     */
     37    char nullchar;
    4238    char signature[3];          /* signature */
    4339    int  length;                /* length of the whole structure */
  • trunk/src/VBox/Additions/linux/sharedfolders/vfsmod.c

    r68646 r69149  
    7575        || info->signature[2] != VBSF_MOUNT_SIGNATURE_BYTE_2)
    7676    {
    77         /* An old version of mount.vboxsf made the syscall. Translate the
    78          * old parameters to the new structure. */
    79         struct vbsf_mount_info_old *info_old = (struct vbsf_mount_info_old *)info;
    80         static struct vbsf_mount_info_new info_compat;
    81 
    82         info = &info_compat;
    83         memset(info, 0, sizeof(*info));
    84         memcpy(&info->name, &info_old->name, MAX_HOST_NAME);
    85         memcpy(&info->nls_name, &info_old->nls_name, MAX_NLS_NAME);
    86         info->length = offsetof(struct vbsf_mount_info_new, dmode);
    87         info->uid    = info_old->uid;
    88         info->gid    = info_old->gid;
    89         info->ttl    = info_old->ttl;
     77        err = -EINVAL;
     78        goto fail1;
    9079    }
    9180
     
    9483
    9584    name_len = strlen(info->name);
    96     if (name_len > 0xfffe)
    97     {
    98         err = -ENAMETOOLONG;
    99         LogFunc(("map name too big\n"));
    100         goto fail1;
    101     }
    102 
    10385    str_len = offsetof(SHFLSTRING, String.utf8) + name_len + 1;
    10486    str_name = kmalloc(str_len, GFP_KERNEL);
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette