-
Notifications
You must be signed in to change notification settings - Fork 2
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
Hardened C #1
Hardened C #1
Conversation
I'm surprised this function builds:
signature seems different in caller and implementation. |
Ah it's because when you use () without void, the compiler doesn't do strict signature checking. We could catch this with compiler warnings. Anyway details, I understand you are just getting started on something exciting :) |
194b804
to
6041952
Compare
I've been thinking of trying out something like this on a new project:
with close to maximum gcc/clang warnings turned on. This could be a fun project to try it on |
It's not Rust, but. We can maximize our compiler warnings I guess. Signed-off-by: Eric Curtin <[email protected]>
Would there be any interest to rewrite this project in Rust while it's still very young? I'd surely like to contribute to that. |
@ericcurtin As you correctly guessed, I put this code together by borrowing from |
Most of the code I write these days is in Rust, so this is tempting. But, with a cold head, most of what The threat model for this project is also relatively low risk. It's never intended to be run as root, it doesn't gain privileges in any way, and doesn't operate as a service either. All in all, I think we should keep it as simple as possible, at least for the time being. |
I think for a greenfield project, there is value in writing it in Rust from the beginning, especially with Rust's move to I/O safety. There's also the point of just avoiding creating more C code that will need to be maintained into the future. Not to mention that libkrun is already written in Rust, so there's continuity in that sense that would encourage contribution.
It is simple, until it is not anymore. I'd like to volunteer to do the work. |
SGTM. I would be more than happy to delegate this work to someone else so I can focus on libkrun :-) Once you have an initial implementation, please let us know so we can evaluate pros and cons and switch to it if it's worth it. |
It's not Rust, but. We can maximize our compiler warnings I guess.