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 =
|
| 157 | 157 | #else |
| 158 | 158 | ioctl: vboxguestLinuxIOCtl, |
| 159 | 159 | #endif |
| | 160 | #ifdef HAVE_COMPAT_IOCTL |
| | 161 | compat_ioctl: vboxguestLinuxIOCtl, |
| | 162 | #endif |
| 160 | 163 | fasync: vboxguestFAsync, |
| 161 | 164 | read: vboxguestRead, |
| 162 | 165 | poll: vboxguestPoll, |
| … |
… |
static struct file_operations g_FileOpsUser =
|
| 184 | 187 | #else |
| 185 | 188 | ioctl: vboxguestLinuxIOCtl, |
| 186 | 189 | #endif |
| | 190 | #ifdef HAVE_COMPAT_IOCTL |
| | 191 | compat_ioctl: vboxguestLinuxIOCtl, |
| | 192 | #endif |
| 187 | 193 | }; |
| 188 | 194 | |
| 189 | 195 | /** The miscdevice structure for the user device. */ |