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

Whether to validate flags/options? #121

Open
xxchan opened this issue Aug 1, 2020 · 3 comments
Open

Whether to validate flags/options? #121

xxchan opened this issue Aug 1, 2020 · 3 comments
Labels
bug Something isn't working

Comments

@xxchan
Copy link
Contributor

xxchan commented Aug 1, 2020

from_bits_truncate() is used in some syscalls in linux-syscall and zircon-syscall, so it is possible that the input flag has an invalid bit set. Should this return Err? I'm not sure of the behavior of linux and zircon when this situation happens.

@wangrunji0408
Copy link
Member

This should return Err(LxError::EINVAL) or Err(ZxError::INVALID_ARGS).
And make sure that the bitflags contains all valid bits.

@xxchan
Copy link
Contributor Author

xxchan commented Aug 3, 2020

This should return Err(LxError::EINVAL) or Err(ZxError::INVALID_ARGS).

OK, I can fix this.

bitflags contains all valid bits

What do you mean by this? Isn't that already ensured?

@wangrunji0408
Copy link
Member

I'm not sure. Maybe need to check again...

@wangrunji0408 wangrunji0408 added the bug Something isn't working label Aug 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants