path: root/sys/compat/linuxkpi/common/include/linux/sched.h
diff options
authorHans Petter Selasky <hselasky@FreeBSD.org>2016-05-12 11:38:28 +0000
committerHans Petter Selasky <hselasky@FreeBSD.org>2016-05-12 11:38:28 +0000
commit3a8bec33ef8c141bbed385909913b110c674f0e5 (patch)
tree04f7e04df6406ff7a834fe475d053f0db4925dfc /sys/compat/linuxkpi/common/include/linux/sched.h
parentcdf63a700c77204252e3c2e38d7106965559f3c6 (diff)
Fix handling of IOCTLs in the LinuxKPI.
Linux requires that all IOCTL data resides in userspace. FreeBSD always moves the main IOCTL structure into a kernel buffer before invoking the IOCTL handler and then copies it back into userspace, before returning. Hide this difference in the "linux_copyin()" and "linux_copyout()" functions by remapping userspace addresses in the range from 0x10000 to 0x20000, to the kernel IOCTL data buffer. It is assumed that the userspace code, data and stack segments starts no lower than memory address 0x400000, which is also stated by "man 1 ld", which means any valid userspace pointer can be passed to regular LinuxKPI handled IOCTLs. Bump the FreeBSD version to force recompilation of all kernel modules. Discussed with: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies
Notes: svn path=/head/; revision=299530
Diffstat (limited to 'sys/compat/linuxkpi/common/include/linux/sched.h')
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/compat/linuxkpi/common/include/linux/sched.h b/sys/compat/linuxkpi/common/include/linux/sched.h
index ca1effe88600..bdaf7ae070f3 100644
--- a/sys/compat/linuxkpi/common/include/linux/sched.h
+++ b/sys/compat/linuxkpi/common/include/linux/sched.h
@@ -66,6 +66,8 @@ struct task_struct {
int should_stop;
pid_t pid;
const char *comm;
+ void *bsd_ioctl_data;
+ unsigned bsd_ioctl_len;
#define current task_struct_get(curthread)