VirtualBox

Ticket #8336: add-compat_ioctl-for-32bit-userland.patch

File add-compat_ioctl-for-32bit-userland.patch, 1.4 KB (added by Cédric Cabessa, 9 years ago)

add-compat_ioctl-for-32bit-userland

  • vboxguest/VBoxGuest-linux.c

    From 13c1157f59e397b1864c568377c6481ac647985a Mon Sep 17 00:00:00 2001
    From: =?UTF-8?q?C=C3=A9dric=20Cabessa?= <ccabessa@genymobile.com>
    Date: Mon, 2 Nov 2015 10:36:36 +0100
    Subject: [PATCH] add compat_ioctl for 32bit userland
    
    When a 32bit userland call ioctl on a 64bit kernel, the kernel will look for
    compat_ioctl (and not ioctl or unlocked_ioctl). If this function does not
    exists for the driver, ENOTTY is returned.
    
    Why the vbox dev didn't fix this? May be could expect strange bug with
    structure size, but I can successfuly use guestproperty and shared folder
    with this patch.
    ---
     vboxguest/VBoxGuest-linux.c | 6 ++++++
     1 file changed, 6 insertions(+)
    
    diff --git a/vboxguest/VBoxGuest-linux.c b/vboxguest/VBoxGuest-linux.c
    index a482489..f2ef2be 100755
    a b static struct file_operations g_FileOps =  
    157157#else
    158158    ioctl:          vboxguestLinuxIOCtl,
    159159#endif
     160#ifdef HAVE_COMPAT_IOCTL
     161    compat_ioctl:   vboxguestLinuxIOCtl,
     162#endif
    160163    fasync:         vboxguestFAsync,
    161164    read:           vboxguestRead,
    162165    poll:           vboxguestPoll,
    static struct file_operations g_FileOpsUser =  
    184187#else
    185188    ioctl:          vboxguestLinuxIOCtl,
    186189#endif
     190#ifdef HAVE_COMPAT_IOCTL
     191    compat_ioctl:   vboxguestLinuxIOCtl,
     192#endif
    187193};
    188194
    189195/** The miscdevice structure for the user device. */

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