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

StivaleTerminalTag::write is unsound #9

Open
chorman0773 opened this issue Mar 20, 2022 · 1 comment
Open

StivaleTerminalTag::write is unsound #9

chorman0773 opened this issue Mar 20, 2022 · 1 comment

Comments

@chorman0773
Copy link

https://github.com/Andy-Python-Programmer/stivale/blob/master/src/v2/tag.rs#L88 indicates a safety comment of

This function is not thread safe

but it's applied to a safe by-shared-reference reciever method of a Sync type, making this unsound.

@chorman0773
Copy link
Author

Also, as all of the fields of StivaleTerminalTag::write are public, a user could create such a tag with a 0 in the term_write_addr slot, and call term_write on it, causing immediate undefined behaviour by violating the validity invariant of extern"C" fn(*mut u8,u64) (null function pointer).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant