News for hackers. Stuff that matters.
Re:“Rust is safe” is not some kind of absolute guarantee of ... by ChrisSD on Sunday October 02, 2022 @11:26AM (#33056716)
What is better: continuing to "limp along" in some unknown corrupted state (aka undefined behaviour) or in a well defined (albeit invalid) state?
Re:“Rust is safe” is not some kind of absolute guarantee of ... by throw827474737 on Sunday October 02, 2022 @11:55AM (#33057031)
Had the same topic often on MCUs: limp along to hopefully get the error out somehow, otherwise it won't be noticed if not with JTAG debugger attached (default in field).

So I can understand where Linus comes from.

Re:“Rust is safe” is not some kind of absolute guarantee of ... by gmueckl on Sunday October 02, 2022 @01:10PM (#33057918)
Yes. You could still hard reset after the error is reported if you wanted to. And if system availability matters, a hardware watchdog would handle the case where the error handling doesn't finish.
Re:“Rust is safe” is not some kind of absolute guarantee of ... by mlindner on Sunday October 02, 2022 @01:11PM (#33057932)
Limping along is what the salesman and the business people want as failures look bad.

Engineers should want the immediate stop, because that's safer, especially in safety critical situations.

Re:“Rust is safe” is not some kind of absolute guarantee of ... by wtallis on Sunday October 02, 2022 @01:33PM (#33058186)
The kernel is not the whole system. The kernel needs to offer the "limping along" option so that the other parts of the system can implement whatever graceful failure method is appropriate for that system. There's no one size fits all solution for the kernel to pick.
Re:“Rust is safe” is not some kind of absolute guarantee of ... by niscocity35 on Monday October 03, 2022 @01:47AM (#33063850)
What are you talking about? Should planes stop flying when they encounter an error?

Safety critical systems will try to recover to a working state as much as possible. It is designed with redundancy that if one path fails, it can use path 2 or path 3 towards a safe usable state.

Re:“Rust is safe” is not some kind of absolute guarantee of ... by warinukraine on Sunday October 02, 2022 @06:43PM (#33061141)
You sound like you code websites or something.

Real engineers, like say the people who code the machines that fly in mars, don't want "oops that's unexpected, ruin the entire mission because that's safer". Same for the Linux kernel.

Re:“Rust is safe” is not some kind of absolute guarantee of ... by Someone1234 on Sunday October 02, 2022 @12:16PM (#33057271)
This question is answered in Linus' emails fully and better than I'm going to do.

But to restate briefly, the answer varies wildly between kernel and user programs, because a user program failing hard on corrupt state is still able to report that failure/bug, whereas a kernel panic is a difficult to report problem (and breaks a bunch of automated reporting tooling).

So in answer: Read the discussion.

Re:“Rust is safe” is not some kind of absolute guarantee of ... by ChrisSD on Sunday October 02, 2022 @12:34PM (#33057503)
You seem to have misunderstood me. The distinction I'm making is not between kernel panic or undefined behaviour. The distinction is between undefined behaviour and defined behaviour. That defined behaviour can be anything, even including "limping on" somehow.
Re:“Rust is safe” is not some kind of absolute guarantee of ... by yencabulator on Sunday October 02, 2022 @05:37PM (#33060552)
What is better for a desktop user:

1) needing to reload a wifi driver to reinitialize hardware (with a tiny probability of memory corruption) OR choosing to reboot as soon as convenient (with a tiny probability of corrupting the latest saved files)

2) to lose unsaved files for sure and not even know what caused the crash

Re:“Rust is safe” is not some kind of absolute guarantee of ... by notacoward on Monday October 03, 2022 @09:30AM (#33067239)
Why focus exclusively on the desktop, or over-generalize from it to other uses? What is appropriate for them is not necessarily so for the many millions of machines in server rooms and data centers. Also, you present a false dichotomy. "Lose unsaved files for sure" is not the case for many systems, and "not even know" is not necessarily the case. Logging during shutdown is a real thing, as is saving a crash dump for retrieval after reboot. Both have been standard at my last several projects and companies.

As I've said over and over, both approaches - "limp along" and "reboot before causing harm" - need to remain options, for different scenarios. Anyone who treats the one use case they're familiar with as the only one which should drive policy for everyone is doing the community a disservice.

Re:“Rust is safe” is not some kind of absolute guarantee of ... by yencabulator on Monday October 03, 2022 @10:02AM (#33067643)
Yes, both need to remain options. Rust-in-kernel needs to be able to support both. That's like half of Linus's ranting there.

The other half is that kernel has a lot of rules of what is safe to be done where, and Rust has to be able to follow those rules, or not be used in those contexts. This is the GFP_ATOMIC part.

Re:“Rust is safe” is not some kind of absolute guarantee of ... by Jweb_Guru on Sunday October 02, 2022 @05:55PM (#33060691)
The latter, because the "tiny probability of memory corruption" can easily become a CVE.
Re:“Rust is safe” is not some kind of absolute guarantee of ... by P5fRxh5kUvp2th on Sunday October 02, 2022 @07:02PM (#33061282)
We have a term for this.

FUD

Re:“Rust is safe” is not some kind of absolute guarantee of ... by Jweb_Guru on Sunday October 02, 2022 @07:31PM (#33061498)
Linux has numerous CVEs, and a large percentage stem from memory corruption. That's not FUD, I'm afraid.
Re:“Rust is safe” is not some kind of absolute guarantee of ... by scoutt on Monday October 03, 2022 @03:29AM (#33064502)
It's FUD. And not only that. The fear of constantly being attacked by an external entity is also paranoic.
Re:“Rust is safe” is not some kind of absolute guarantee of ... by Jweb_Guru on Sunday October 09, 2022 @12:13AM (#33138211)
Unfortunately, whether you personally care about this sort of thing isn't good enough anymore. Owned Linux boxes on IoT devices are now being marshaled into massive botnets used to perform denial of service attacks, while other vulnerabilities are exploited to enable ransomware. You having negligent security on your own unpatched box because you don't personally feel like it's a good tradeoff has many negative external consequences. Fortunately, the decision isn't actually up to you (and having fewer vulnerabilities won't influence you negatively anyway, so I'm not sure why you're so angry about it).
Re:“Rust is safe” is not some kind of absolute guarantee of ... by scoutt on Monday October 10, 2022 @08:31AM (#33150500)
> why you're so angry about it

Am I?

You suppose a lot of things about me from literaly a bunch of words.

"A 'tiny probability of memory corruption' can easily become a CVE" is still FUD, because is simply not true in most cases. The words "tiny" and "easily" show the bias here.

The rest of the conversation seems a symptom of Hypervigilance: Fixation on potential threats (dangerous people, animals, or situations).

Fortunately, the decision isn't up to you either.