News for hackers. Stuff that matters.
Re:Linus Torvalds: “Do No Harm” by muppetman on Wednesday November 22, 2017 @03:43AM (#15755317)
Say there's a minor error in a network driver. Yes, it might be exploitable by a smart person. But the error only triggers once a day when a counter rolls over. Do you really want your box to lock up and panic when this error is encountered, or do you just want your box to keep working.

I'm firmly in the first camp (I'll take lock up and freeze thanks) but 99% of users don't care about a bug like that and just want the box to keep working.

Re:Linus Torvalds: “Do No Harm” by jbangert on Wednesday November 22, 2017 @03:57AM (#15755381)
But do you want your box to send silently corrupted data for the next two years? Or would you rather reboot every night, and maybe escalate to your red hat support contract, where someone will then fix the underlying bug (for which you now have crashdumps),
Re:Linus Torvalds: “Do No Harm” by AndrewDucker on Wednesday November 22, 2017 @04:06AM (#15755423)
I'd want it to log that it's going wrong, and report that so that it can be fixed.
Re:Linus Torvalds: “Do No Harm” by marcosdumay on Wednesday November 22, 2017 @08:51AM (#15756728)
What data exactly is being corrupted?

Fail fast is a great philosophy for end-user software. But it is not that strictly good for middleware, and is almost certainly wrong for a kernel.

Re:Linus Torvalds: “Do No Harm” by azernik on Wednesday November 22, 2017 @06:28AM (#15756002)
If you're a desktop user, or a sysadmin without said support contract, you want the former.
Re:Linus Torvalds: “Do No Harm” by jandrese on Wednesday November 22, 2017 @09:41AM (#15757065)
That Redhat support contract won't save you from a bug in a binary blob network driver.

Crashing the whole kernel at the drop of a hat seems like a pretty extreme stance to take as a general policy IMHO. Killing and restarting the driver will usually suffice, although some data may be lost and have to be retransmitted.

Re:Linus Torvalds: “Do No Harm” by holri on Wednesday November 22, 2017 @04:22AM (#15755485)
I want both. Panic in a test/development kernel, do not panic in a production environment.
Re:Linus Torvalds: “Do No Harm” by TickleSteve on Wednesday November 22, 2017 @07:34AM (#15756268)
It the opposite...

you should panic in a production environment and reset the state of the machine (which has become indeterminate).

The correctness and validity of the data >> uptime.

Re:Linus Torvalds: “Do No Harm” by pilif on Wednesday November 22, 2017 @08:57AM (#15756773)
As so often, it really depends. Let's say you've just detected that you're going to send incorrect data because you've ended up in an indeterminate state.

If the remote end is going to ignore that data anyways, would it really be such a bad idea to keep running? Do you really want to go down in order to ensure that a remote who's ignoring your data can get correct data to ignore?

Of course you never know what sort of effect the corrupt data is going to have, so it's always hard to make that decision.

Like that issue with libraries linking against objective-c frameworks that has crept up with High Sierra and broke most of the Ruby world: Yes. The usage was incorrect. Yes, forking after threads are launched leads to undefined behavior, yes, knowing about it is a good thing.

But: So far the crashes have been rare in the common use-cases (or they would have been fixed), so High Sierra's change to blow up loudly when it detects the misuse has actually caused a lot of trouble for people where things worked fine before.

To the point where many Ruby developers were complaining about High Sierra "breaking" their workflow and recommending against upgrading.

The new check is totally justified though. The existing forking behavior was wrong and it could have lead to crashes down the line. It didn't though. And now people are forced to fix something that was never an issue to begin with.

It's a fine line to walk and while I generally prefer things to blow up as they go wrong, sometimes I catch myself wishing for stuff to just continuing to work.

On some self-reflection, I come to the conclusion that I want my cake and eat it too.

Re:Linus Torvalds: “Do No Harm” by TickleSteve on Wednesday November 22, 2017 @11:31AM (#15758083)
There rule I work to when I design these type of systems is that if the source of the error is internal you should reset and avoid propagating the error. Conversely if you receive an error from an external source you should handle it gracefully and reject the bad message.
Re:Linus Torvalds: “Do No Harm” by __david__ on Wednesday November 22, 2017 @11:30AM (#15758079)
On the other hand, the mere act of panicking may corrupt data (by virtue of stopping processes). I learned this the hard way when my kernel panicked while I was shrinking a large ext4 volume (the panic was unrelated to the shrinking). It's not just a simple equation like you've claimed.
Re:Linus Torvalds: “Do No Harm” by TickleSteve on Wednesday November 22, 2017 @01:08PM (#15758967)
A panic should stop the processor dead, no data should be corrected as a result. Data in flight should not be used if you use transactional I/O and therefore will not be used if a write does not complete.
Re:Linus Torvalds: “Do No Harm” by __david__ on Wednesday November 22, 2017 @03:49PM (#15760491)
That's fine in theory, but it didn't stop my disk from being corrupted. If the computer hadn't panicked, my data would still be available.
Re:Linus Torvalds: “Do No Harm” by TickleSteve on Wednesday November 22, 2017 @07:01PM (#15761757)
its not theory... your system wasn't designed to be fault-tolerant in that manner.

Systems that matter, are.

Re:Linus Torvalds: “Do No Harm” by __david__ on Thursday November 23, 2017 @03:32AM (#15763719)
The linux kernel needs to work with both tolerant and non-tolerant systems. Saying it needs to work a specific way that completely breaks real world things is completely naive, and exactly what Linus was railing against.
Re:Linus Torvalds: “Do No Harm” by kiriakasis on Wednesday November 22, 2017 @10:02AM (#15757221)
i use linux mainly to write latex these days, i don't want my kernel to panic, I do want my machine to stay operative and not corrupt my work.

The kernel (for my intended usage) should intentionally panic only if there is a risk of corrupting my .tex files.

Re:Linus Torvalds: “Do No Harm” by snvzz on Wednesday November 22, 2017 @05:21AM (#15755736)
Absolutely panic in a production environment.

Potential data corruption is far worse, so is a potential security compromise.

Re:Linus Torvalds: “Do No Harm” by eeZah7Ux on Wednesday November 22, 2017 @09:42AM (#15757073)
It really depends on the use case!

E.g. performing industrial control automation or airplane rudder control in a completely segregated network.

You want control over these tradeoffs, not hardcoded behaviors.

Re:Linus Torvalds: “Do No Harm” by snvzz on Thursday November 23, 2017 @05:03AM (#15764072)
Linux is ill suited for that.

Look at seL4, minix3, eChronos instead.

Re:Linus Torvalds: “Do No Harm” by hutzlibu on Wednesday November 22, 2017 @05:03AM (#15755657)
Well, only that most devices never were tested over months in development kernel ... and it is not possible to do so, with all those million different devices around.