-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Switch to different locking crate (as reported by RUSTSEC-2019-0031) #737
Comments
Thanks a lot for the suggestions! I wasn't aware of these crates. I especially like the Lazy and Once types of conquer-once.
Could you clarify what you mean with this? That they can't be used together with the |
Sorry if that wasn't clear, I meant that I realized, when I made my
edit, that you couldn't use conquer-once and lock_api together -- it
would be redundant.
…On 2/5/20, Philipp Oppermann ***@***.***> wrote:
Thanks a lot for the suggestions! I wasn't aware of these crates. I
especially like the Lazy and Once types of conquer-once.
> Edit: just realized that you can't use both in something like this
> simultaneously. My bad! :)
Could you clarify what you mean with this? That they can't be used together
with the `spin` crate? That they don't work in `no_std` projects at all?
--
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub:
#737 (comment)
--
Signed,
Ethin D. Probst
|
Ah, thanks for clarifying! |
It's true that the |
It also seems like neither |
lock_api is a replacement of spin, from what I can see. Check out its documentation -- not the introduction page, but its mutex, reentrant mutex, and reader-writer lock APIs. Those are (full?) implementations, at least they appear to be, of the respective locks. You can implement your own, of course; for example see the MappedMutexGuard structure. |
The types are generic over an implementation of the |
Its worth a try in a test app, perhaps? I do't know -- I've never used lock_api. Wish parking_lot was available for no_std, but I doubt that'll happen -- we'll need to get threads working and then have to port it. |
The I understand that you want to get rid of cargo audit warnings, but hand-rolling your own solution that is never going to be audited only to silence warnings is not a good idea in my opinion. |
I just created a small |
@phil-opp Hey Phil, I was looking into once_cell as a potential replacement for lazy_static when I saw this issue. It turns out once_cell doesn't have I figured I'd play around with it a bit and see how it works out since it might be interesting to not need |
Thanks for the pointer! Have you tried the |
I actually wasn't aware of this crate. Seems pretty promising so far. I'll test it out along with |
As a point of interest, |
Great to hear that! Since (I will keep |
This is a pretty minor issue (compared to RUSTSEC-2019-0013, which I need to also go report to slab_allocator). However,this repository has no security policy (plus I'd report it here anyway just for public awareness).
As reported by the above-linked rust security advisory, the Spin crate is no longer being actively maintained. The advisory reports that conquer-once and lock_api are good alternatives to spin. I like both; however, the latter possesses reader-writer locks, something which I need in my own kernel. Both have good features though; e.g., the former has the spin module, which also encapsulates its lazy type, which appears to be a (possibly) excellent alternative to lazy_static.
As I said at the start of this issue, this is a relatively minor problem, and definitely not one to get worked up about. I just thought I'd let everyone know.
Edit: just realized that you can't use both in something like this simultaneously. My bad! :) Sorry about that! I'll keep the original here for historical purposes.
The text was updated successfully, but these errors were encountered: