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

binder: Check for underflow when subtracting from user-provided value. #375

Merged
merged 1 commit into from
Jun 11, 2021

Conversation

wedsonaf
Copy link

Fixes #365.

Signed-off-by: Wedson Almeida Filho [email protected]

@ksquirrel
Copy link
Member

Review of 483683d4d217:

  • ✔️ Commit 483683d: Looks fine!

Copy link
Collaborator

@TheSven73 TheSven73 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Immediate approval, LGTM, I don't want to hold off merging this.

Follow-up question: what causes ptr < mapping.address to be true ?

@wedsonaf
Copy link
Author

Follow-up question: what causes ptr < mapping.address to be true ?

In the first function, ptr is directly controlled by userspace via an ioctl. In the second one, it should be valid (i.e., >= mapping.address) when it starts off, but given that we release the mappings lock, it is possible for mapping.address to change to something < ptr.

None of these affect memory safety, but they may affect correctness.

@wedsonaf wedsonaf merged commit 62bc7aa into Rust-for-Linux:rust Jun 11, 2021
@wedsonaf wedsonaf deleted the underflow branch June 11, 2021 00:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

binder benchmark causes kernel BUG on Raspberry Pi
4 participants