Skip to content

Potential bindgen footguns or general security considerations #2810

Answered by pvdrz
droogie asked this question in Q&A
Discussion options

You must be logged in to vote

Hi 👋

I'd say the most general security considerations would be included in the rustonomicon as bindgen doesn't provide any extra security safeguards itself, just the convenience of not writing bindings by hand.

Regarding your questions:

Ensure Allowlisting/Blocklisting is used to only generate bindings for necessary / wanted types, functions, etc.

This is something that is very nice to have, but I'd say it is easier to avoid footguns if you keep all the generated bindings in a private module and only expose the parts you actually need. In that way, you only have to blocklist stuff you can't have (like code that can't be translated by bindgen)

Example provided are pthread mutexes, can y…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by droogie
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants