-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lib/9pfs: Stub uk_9pfs_ioctl #928
Conversation
Change `uk_9pfs_ioctl` from `vfscore_vop_einval` to `vfscore_vop_nullop`, effectively stubbing it. This means a call to `uk_9pfs_ioctl` will no longer return `-EINVAL`, but it will return `0`, tricking the caller into thinking `ioctl()` functionality is available. This is useful in binary-compatibility mode, where certain `ioctl()` calls may cause the application to end, if an error code (such as `-EINVAL` is returned). This is the case of Ruby interpreter running in binary-compatibility mode. Signed-off-by: Razvan Deaconescu <razvand@unikraft.io>
✅ Checkpatch passed Beep boop! I ran Unikraft's
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All good, thanks.
Reviewed-by: Stefan Jumarea stefanjumarea02@gmail.com
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@razvand This could also create problems if the application depends on the correct behavior of ioctl
and we stub the call. I assume for Ruby this is not the case. By any chance, do you remember what ioctl
ruby attempts to perform?
@marcrittinghaus it calls |
Ok, does Ruby work at all then? For |
Yes, |
Indeed, the proper solution would be to have a full implementation of
The value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
openat(AT_FDCWD, "/usr/lib/ruby/2.5.0/rubygems.rb", O_RDONLY|O_CLOEXEC|O_NONBLOCK) = fd:7 fcntl(0x7, 0x4, ...) = Invalid argument (-22) close(fd:7) = OK ioctl(0x2, 0x5401, ...) = 0x0
This is interesting. This is another bug in vfscore
. The O_NONBLOCK
in the openat
call should already cause the problem, because it supplies the O_NONBLOCK
flag. However, in contrast to fcntl
, we don't call vfs_ioctl
on the fd when applying the open flags. So depending on the FS this is already broken.
Regarding this PR. For now, it is fine to use vfscore_vop_nullop
.
Approved-by: Marc Rittinghaus marc.rittinghaus@unikraft.io
Change `uk_9pfs_ioctl` from `vfscore_vop_einval` to `vfscore_vop_nullop`, effectively stubbing it. This means a call to `uk_9pfs_ioctl` will no longer return `-EINVAL`, but it will return `0`, tricking the caller into thinking `ioctl()` functionality is available. This is useful in binary-compatibility mode, where certain `ioctl()` calls may cause the application to end, if an error code (such as `-EINVAL` is returned). This is the case of Ruby interpreter running in binary-compatibility mode. Signed-off-by: Razvan Deaconescu <razvand@unikraft.io> Reviewed-by: Stefan Jumarea <stefanjumarea02@gmail.com> Approved-by: Marc Rittinghaus <marc.rittinghaus@unikraft.io> Tested-by: Unikraft CI <monkey@unikraft.io> GitHub-Closes: unikraft#928
Change `uk_9pfs_ioctl` from `vfscore_vop_einval` to `vfscore_vop_nullop`, effectively stubbing it. This means a call to `uk_9pfs_ioctl` will no longer return `-EINVAL`, but it will return `0`, tricking the caller into thinking `ioctl()` functionality is available. This is useful in binary-compatibility mode, where certain `ioctl()` calls may cause the application to end, if an error code (such as `-EINVAL` is returned). This is the case of Ruby interpreter running in binary-compatibility mode. Signed-off-by: Razvan Deaconescu <razvand@unikraft.io> Reviewed-by: Stefan Jumarea <stefanjumarea02@gmail.com> Approved-by: Marc Rittinghaus <marc.rittinghaus@unikraft.io> Tested-by: Unikraft CI <monkey@unikraft.io> GitHub-Closes: unikraft#928
Change
uk_9pfs_ioctl
fromvfscore_vop_einval
tovfscore_vop_nullop
, effectively stubbing it. This means a call touk_9pfs_ioctl
will no longer return-EINVAL
, but it will return0
, tricking the caller into thinkingioctl()
functionality is available.This is useful in binary-compatibility mode, where certain
ioctl()
calls may cause the application to end, if an error code (such as-EINVAL
is returned). This is the case of Ruby interpreter running in binary-compatibility mode.Prerequisite checklist
checkpatch.uk
on your commit series before opening this PR;Base target
x86_64
]kvm
]app-elfloader
, Ruby in binary-compatibility mode]