News for hackers. Stuff that matters.
Re:sudo and su Being Rewritten in Rust for Memory Safety by anthk on Saturday April 29, 2023 @01:46PM (#35755251)
Find an error on the Rust runtime and then the whole security collapses down as a house of cards.

It's bad to think on security by just using a language.

Re:sudo and su Being Rewritten in Rust for Memory Safety by smt88 on Saturday April 29, 2023 @02:00PM (#35755386)
No one is saying they should switch languages and stop all other security work.
Re:sudo and su Being Rewritten in Rust for Memory Safety by hulitu on Saturday April 29, 2023 @02:01PM (#35755404)
No need for errors. Just a compromised package on crates.io.

It's funny how rust is praised as secure without any code audit.

Re:sudo and su Being Rewritten in Rust for Memory Safety by iknowstuff on Saturday April 29, 2023 @02:12PM (#35755514)
Yeah your single header libs from pastebin get so many audits by comparison.

https://github.com/RustSec/rustsec/tree/main/cargo-audit

https://mozilla.github.io/cargo-vet/

Besides, every dependency is locked.

Re:sudo and su Being Rewritten in Rust for Memory Safety by haswell on Saturday April 29, 2023 @02:21PM (#35755599)
Security means many things, and supply chain vulnerabilities are just one of many factors to evaluate when considering languages.

Rust improves or eliminates some issues, but that does not imply that other issues are magically solved.

Re:sudo and su Being Rewritten in Rust for Memory Safety by fnordpiglet on Saturday April 29, 2023 @02:37PM (#35755757)
I don’t think people generally say secure, they say safe. Safe is necessary but insufficient for secure. The existing implementations assume safety by diligence. Rust promises safety by construction. That’s useful. But, to your point, insufficient. People that say secure when they mean safe are just wrong.
Re:sudo and su Being Rewritten in Rust for Memory Safety by lalaithion on Saturday April 29, 2023 @01:56PM (#35755348)
I mean, the same is true with the C runtime.
Re:sudo and su Being Rewritten in Rust for Memory Safety by ittan on Saturday April 29, 2023 @02:03PM (#35755433)
Isn't "C Runtime" inaccurate?

Wouldn't it be the static or dynamic linked libraries for the particular program in question?

Re:sudo and su Being Rewritten in Rust for Memory Safety by pjmlp on Saturday April 29, 2023 @02:08PM (#35755483)
Nope, what do you think calls into main(), does floating point emulation, handles signals on non UNIX platforms, provides threading support?
Re:sudo and su Being Rewritten in Rust for Memory Safety by dahfizz on Saturday April 29, 2023 @03:01PM (#35755973)
The term "runtime" is overloaded here. The C runtime is not what people usually mean when they say a language has a runtime.

There is a crt.0 "C Runtime" object. This is code that is literally run "at runtime". When you execute a binary, the C runtime is the first thing executed to setup the stack and call main().

This is just a bit of assembly that runs before main(). It shares ~nothing in common with "runtime" languages like Python or Java where the runtime is alive during the whole program's execution.

The C run time does not handle floats or threads or anything like that. Software floats are dealt with by the compiler and threading is implemented as its own library (either in userspace or built into the kernel).

Re:sudo and su Being Rewritten in Rust for Memory Safety by pjmlp on Saturday April 29, 2023 @03:41PM (#35756375)
I guess you can educate Microsoft on that then.

https://learn.microsoft.com/en-us/cpp/c-runtime-library/c-ru...

It doesn't matter what people think, rather the CS point of view of a language runtime is.

That library is the runtime.

Re:sudo and su Being Rewritten in Rust for Memory Safety by lanstin on Saturday April 29, 2023 @04:39PM (#35756931)
Libraries and crt0.o and the like. Libgcc_s ; but it isn’t a runtime in the sense that some magic is doing GC or scheduling for routines. ABI that describes what the assembly should be doing, it isn’t a thing doing stuff.
Re:sudo and su Being Rewritten in Rust for Memory Safety by pjmlp on Saturday April 29, 2023 @05:10PM (#35757229)
Runtime is whatever a programming language needs to support its execution, as per CS compiler theory.
Re:sudo and su Being Rewritten in Rust for Memory Safety by dahfizz on Saturday April 29, 2023 @03:07PM (#35756051)
There is a code object called "C Runtime" (crt0.o)[1].

This was a good name at the time. Its a bit of code that gets executed literally "at runtime". When you run a program, this object gets invoked to setup the stack and call main(). Its just a bit of assembly.

Then, decades later, languages like Java overloaded the term "runtime" to refer to their interpreter / vm. This causes confusion to this day, evidently.

[1] https://en.wikipedia.org/wiki/Crt0

Re:sudo and su Being Rewritten in Rust for Memory Safety by hulitu on Saturday April 29, 2023 @02:02PM (#35755414)
> I mean, the same is true with the C runtime.

My c compiler does not connect to internet during compiling.

Re:sudo and su Being Rewritten in Rust for Memory Safety by overthrow on Saturday April 29, 2023 @02:31PM (#35755695)
Nor does the Rust compiler.

Rust's build system, Cargo, does however. And many C build systems do as well, e.g. https://cmake.org/cmake/help/latest/guide/using-dependencies...

Re:sudo and su Being Rewritten in Rust for Memory Safety by steveklabnik on Saturday April 29, 2023 @03:05PM (#35756025)
Optionally. Cargo doesn’t have to connect to the internet, and even has command line switches to fail if it tries to.
Re:sudo and su Being Rewritten in Rust for Memory Safety by hulitu on Saturday April 29, 2023 @04:39PM (#35756927)
Good to know.
Re:sudo and su Being Rewritten in Rust for Memory Safety by hulitu on Saturday April 29, 2023 @04:39PM (#35756924)
Thank you for the tip. I shall do

ifconfig eth0 down

before compiling to avoid such issues.

Re:sudo and su Being Rewritten in Rust for Memory Safety by some_furry on Saturday April 29, 2023 @02:07PM (#35755463)
What do you do if a dependent .so isn't found?

Do you not have to install said dependency from the Internet and start (at least part of) the compile over?

Re:sudo and su Being Rewritten in Rust for Memory Safety by MattPalmer1086 on Saturday April 29, 2023 @02:48PM (#35755849)
Rust doesn't have a runtime.

Nobody is suggesting that a language solves all security issues.

It does have much better memory safety than C, which is the cause of the majority of security issues.

Re:sudo and su Being Rewritten in Rust for Memory Safety by duped on Saturday April 29, 2023 @03:07PM (#35756048)
Rust has a minimal runtime (0), and links to libc by default which brings in the libc runtime (so it's not like C is any better). Except that the Rust runtime is written in Rust, which is nice for memory safety.

(0) https://prev.rust-lang.org/en-US/faq.html#does-rust-have-a-r...

Re:sudo and su Being Rewritten in Rust for Memory Safety by MattPalmer1086 on Saturday April 29, 2023 @03:12PM (#35756104)
Well, opinions in the Rust community clearly differ:

"Rust is blazingly fast and memory-efficient: with no runtime or garbage collector" [0]

I guess it depends on what you mean by a runtime. Panic handlers and initialisation code is a pretty small runtime.

[0] https://www.rust-lang.org/

Re:sudo and su Being Rewritten in Rust for Memory Safety by samus on Saturday April 29, 2023 @03:14PM (#35756121)
Even if there are error, the impact of each error would not be higher than if it occurred in libc or any other language runtime.