Skip to content
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

IOS/ES: Return IPC_EINVAL for unknown ioctlvs #5212

Merged
merged 1 commit into from Apr 8, 2017

Conversation

leoetlino
Copy link
Member

Instead of allowing unknown ioctlvs and faking success for both unknown and unimplemented ioctlvs, which can possibly result in nasty, hard to debug bugs (if the emulated software behaves unexpectedly), we should reject unknown ioctlvs and log known, but unimplemented ioctlvs.

Instead of allowing unknown ioctlvs and faking success for both unknown
and unimplemented ioctlvs, which can possibly result in nasty, hard to
debug bugs (if the emulated software behaves unexpectedly), we should
reject unknown ioctlvs and log known, but unimplemented ioctlvs.
@BhaaLseN
Copy link
Member

BhaaLseN commented Apr 6, 2017

Is there any particular reason why you didn't just change the default case to dump the values (other than some Clang warning about missing cases)? IMO the result should be the same, just to make sure we don't miss any ioctls that didn't show up in the enum to this point. If there were an ioctl 0x46 for example, it wouldn't log but just return EINVAL - I'd say it should still log it anyways.

@leoetlino
Copy link
Member Author

leoetlino commented Apr 6, 2017

I removed the logging for the default case because those are 100% known to be invalid requests. There are only 0x45 ES ioctlvs at most in all versions of IOS.

@BhaaLseN
Copy link
Member

BhaaLseN commented Apr 6, 2017

Are there really any games that spam invalid ioctls? Or is this mostly homebrew?
LGTM in that case.

@leoetlino
Copy link
Member Author

There was a bug in libogc where it would send invalid ioctlvs to /dev/es in some cases. I don't think there's any game that does this, since they are not supposed to know about ES :P

@lioncash lioncash merged commit d55d9f9 into dolphin-emu:master Apr 8, 2017
@leoetlino leoetlino deleted the es-unknown-ioctlvs branch June 3, 2017 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants