-
Notifications
You must be signed in to change notification settings - Fork 291
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
Document and test the use of unsafe #412
Comments
Thanks for what you're proposing here, it's really valuable. I agree that the article is mostly FUD, and just ignored it, but there's never a problem with making code even clearer to understand. ❤️ |
I think the usage of Does |
When It appears that |
I am part way through the review of the use of In the 6 files reviewed so far the use of In the files I have reviews far, there are two structs that contain an internal field that is The internal In my original issue description I had indicated that I was investigating one possible exception to my initial conclusion that the use of I will be continuing this review with the three files in the header module as time allows. |
In #419 there is one use of The specific change that I am considering in #419 concerns the What I wanted to do in this comment was to invite some feedback on the general issue of Marking a function or method
My own view is that It would assist me in finishing #419, though, to have some feedback on this general issue. |
A recent Medium article criticized 3 of the 7 rust http clients it reviewed because of their dependency on this crate and because of this crate's use of
unsafe
. The criticism does not appear to be founded (i.e. it claims thatHeaderMap
is a reimplementation ofHashMap
without explaining how to useHashMap
as a multimap) and the author's tests of these 3 http clients did not show any exploitable problems related to this crate. The article appears to an example of withoutboats' post about allegations of vulnerabilities in Rust libraries.Despite the limitations of the Medium article,
http
is (and is designed to be) a high-level dependency of many network exposed crates so the sound use ofunsafe
is important. The use ofunsafe
has already been audited (see for example rust-secure-code/safety-dance#37). In my preliminary review of the use ofunsafe
I found that they were sound (with one possible exception I am still investigating). The soundness, though, relies on implicit invariants that, in some instance, are not local to the use ofunsafe
.I propose to try to increase the robustness (in the sense described here) of the use of
unsafe
inhttp
by:unsafe
code pathsunsafe
into smaller leaf modules that present a safe wrapper around the unsafe code (without introducing performance regressions)unsafe
sound (making explicit what is implicit)HeaderMap
(such as multimap) so that the performance trade-offs of the current implantation are more easily apparentThe goal isn't to reduce or eliminate the use of
unsafe
(though a reduction in in the number of uses ofunsafe
may be a by-product). It is rather to make the soundness of the use ofunsafe
easier for someone else to audit.I plan to review the use of
unsafe
file by file as follows (the number in parenthesis is the number of occurrences ofunsafe
in the file):I have already completed the work for the first two files in #408 and #410. I am planning to continue with the three uri/* files and then the header/* files as time allows. If the maintainers of the project don't think this is worthwhile please let me know so I can move on to something else.
The text was updated successfully, but these errors were encountered: