Closed jbeich closed 7 years ago
I think some defines are missing in the compilation process to turn on 32-bit support.
linuxkpi never calls .compat_ioctl
This is fixable, just submitted 222504.
The harder problem is the usage of compat_alloc_user_space
in *_ioc32.c
files. I've tried to implement that function (which got a CVE back in the day, BTW :D) but failed. Well, that function "worked", the copyin
/copyout
(__put_user
, __get_user
) stuff didn't. I guess redefining compat_alloc_user_space
as a normal allocation and __put_user
/__get_user
as normal copies could work… but I can't think of a way to insert the free
s just by defining macros.
So I'm working on a terrible patch that replaces that allocation with just having the struct on the stack, just like this 2014 patch.
Already managed to run some GL applications on Wine :) Also Steam on Linuxulator now shows the login UI (but doesn't communicate with the network, net.cpp (1913) : Assertion Failed: Unable to set default socket options, error 22
) instead of, well, not showing it.
Also, the current version in linux doesn't use compat_alloc_user_space
anymore, it's actually kinda more similar to what I'm doing, but it has new weirdness: compat_ptr
.
32bit OpenGL/OpenCL apps (e.g., Wine) either crash, don't work or are very slow because device-specific DRI driver fails on DRM ioctls. Here's an example from Skylake GT2:
drivers/gpu/drm/drm_os_config.h doesn't include opt_compat.h, otherwise build would fail like the following:
which can be fixed by moving compat_ioctl out of
#if 0
in sys/compat/linuxkpi/common/include/linux/fs.h except linuxkpi never calls .compat_ioctl.