News for hackers. Stuff that matters.
Re:Booting Linux using UEFI can brick Samsung laptops by UnoriginalGuy on Wednesday January 30, 2013 @08:01AM (#5139250)
So random academic question - Should it be literally possible for an OS to "brick" hardware even if the OS was intentionally designed to do just that?

Now I know in this particular case Samsung wrote both the driver and the firmware, so it is easy to point blame here.

But more broadly, should hardware be built/designed so it has a "fail safe" mode where it just won't allow its self to be damaged by OS/software instruction?

PS - Let's just assume BIOS/uEFI firmware updates are off the table for this discussion. Since many modern uEFIs allow you to disable user updates entirely.

Re:Booting Linux using UEFI can brick Samsung laptops by xmodem on Wednesday January 30, 2013 @08:39AM (#5139380)
Yes - hardware should be designed to always provide a way to recover from any failure mode that can result from software that's running on that hardware. Even bad firmware updates should be recoverable - what happens if you lose power mid-update?
Re:Booting Linux using UEFI can brick Samsung laptops by cdawzrd on Wednesday January 30, 2013 @09:50AM (#5139678)
Bad firmware updates are (almost always) recoverable, just not always (easily) by the end user. What happens when you lose power is that you need to use the hardware-level debugging/testing functionality of whatever programmable device is in question--JTAG, for example--to load a running firmware image and then reprogram the half-programmed flash storage.
Re:Booting Linux using UEFI can brick Samsung laptops by Someone on Wednesday January 30, 2013 @05:09PM (#5142086)
I expect that you also would like "hardware should be designed to always provide a way to update all of its software" to be true.

I don't think you can expect both to be true nowadays. For example, chances are that your battery charging 'hardware' runs some software. That software, if replaced with faulty software, can destroy your batteries and with it, maybe even your motherboard (through fire, acid leaks, and the like)

This applies elsewhere, too. Historically, we had the 'killer poke' (http://www.6502.org/users/andre/petindex/poke/index.html; variants at http://en.wikipedia.org/wiki/Killer_poke).

Nowadays, it is rumored that buggy baseband firmware for mobile phones can fry the hardware.

I do not think it is feasible to prevent all of these in hardware. Because of that, you must accept "if you can update all software through software, you can brick your device through software".

So, to get to "provide a way to recover from any failure mode that can result from software", you will need to have some unmodifiable software on the device. You also will need that software to allow updating of some firmware and to be free of bugs. I think that is possible, but not economically feasible. Why would anyone spend even a week on bug-checking that earliest running code on a device that will be sold for only six months? That would be giving up the bestselling 4% of the sales cycle.

Re:Booting Linux using UEFI can brick Samsung laptops by xmodem on Thursday January 31, 2013 @11:36PM (#5149227)
> That software, if replaced with faulty software, can destroy your batteries and with it, maybe even your motherboard (through fire, acid leaks, and the like)

I'd put that in the same category as writing robot arm control software that throws the arm off the table, for instance.

Re:Booting Linux using UEFI can brick Samsung laptops by lmm on Wednesday January 30, 2013 @10:35AM (#5139877)
"Should"? In some academic sense, of course everything should be engineered perfectly. But in the real world there are tradeoffs, and people pay more for flexibility and functionality than for safety. I don't see that changing in the near term.
Re:Booting Linux using UEFI can brick Samsung laptops by keeperofdakeys on Wednesday January 30, 2013 @08:32AM (#5139353)
The word is bugs. It's very hard, and almost impossible to fix all bugs. Code with no bugs is really code with no known bugs. Especially when dealing with C and assembly, different parts of the code can effect other parts in ways a programmer may not anticipate. You really need to get a 'safer' language to prevent certain types of bugs, especially with the "data and code share the same segments" model of C.
Re:Booting Linux using UEFI can brick Samsung laptops by UnoriginalGuy on Wednesday January 30, 2013 @08:48AM (#5139421)
It isn't /just/ bugs. It is also the way we think about the relationship between the underlying hardware and the kernel/OS.

There is an inherent level of "trust" there. Which makes sense. But the question is: should that "trust" extend to permanent damage to the hardware/firmware?

For example, a lot of GPUs allow the OS to control fan speed. You can literally set the fan speed so low the GPU will over-heat and damage its self. That isn't a "bug" that is a "feature."

Again, we come back the expectations/relationship.

Re:Booting Linux using UEFI can brick Samsung laptops by keeperofdakeys on Wednesday January 30, 2013 @09:04AM (#5139474)
It's always said "hardware is expensive, software is cheap; so do as much as you can in software". When you also remember that we give an OS full control of all hardware, it's the natural conclusion that things like this can happen. Although, this is changing, subtly. Now you have harddrives and SSDs that run their own software that can't be controlled by the OS. The firmware may even lie to the OS, for example harddrives might tell the OS "I've written this data", when it might actually be caching it for more efficient writing. Unfortunately computes are nearly infinitely complex these days, with so many layers developed by many people.
Re:Booting Linux using UEFI can brick Samsung laptops by Hoff on Wednesday January 30, 2013 @10:14AM (#5139789)
Yes, bugs happen.

So what can be done?

There are systems with firmware that can automatically detect failed updates or corrupted firmware, or where a failsafe firmware loader can be triggered by a jumper or related request, and that can then perform a reset and (re)load of replacement firmware.

Without requiring a test harness or JTAG access or other equipment.

In various of these cases, there are two copies of the firmware, meaning the old firmware can be immediately accessed, or — pending successful completion — a second copy of working firmware can be generated.

In one case, a system had its firmware mostly in ROM, and had NVRAM that could hot-patch routines via an NVRAM-based vector table, and with space for replacement routines in the NVRAM. This meant that the box would always boot, and bad vectors could be detected by checksum, and firmware bugs could still be patched up to the limit of the available NVRAM.

Put another way, we know how to avoid this mess. It just costs some time and effort and money, and that can get this capability cut.

This stuff is not rocket science.

Re:Booting Linux using UEFI can brick Samsung laptops by simias on Wednesday January 30, 2013 @08:53AM (#5139437)
If you can brick the hardware with a bogus driver it looks more to me like a hardware bug rather than a software one.

Why exactly do you blame C's memory model for this issue? The article is not overly specific about the exact specifics of the problem. Do you have a more technical source? I'd be curious to learn how exactly this driver can completely brick the mobo.

Re:Booting Linux using UEFI can brick Samsung laptops by keeperofdakeys on Wednesday January 30, 2013 @08:58AM (#5139456)
I don't have any technical sources for this bug, but I'm quite certain it would be a bug in either the UEFI firmware or the kernel driver. Firmware can be quite complicated pieces of software, and if you accidentally change the wrong memory values, you might trigger a firmware update or change configurations of the hardware present in the firmware. All this stuff can be changed because it needs to be configurable, and doing it in software is much cheaper.

There will usually be some kind of firmware reset in the hardware, but it might involve processes that only the manufacturer can do.

I would say C's memory model can contribute towards this because if you have a buffer overflow, or change the wrong bits of memory, you might accidentally change the code, or execute data. Executing data is why buffer overflows are so serious, and allow malicious code to essentially do anything.

Re:Booting Linux using UEFI can brick Samsung laptops by bd_at_rivenhill on Wednesday January 30, 2013 @10:03AM (#5139741)
Seems like the best solution is that there should always be a way to reset the firmware to a hard-coded factory default which represents the state that existed when the machine came off the assembly line. In this way, a bad firmware update can always be rolled back.

EDIT: looks like somebody reporting the bug did this the old-fashioned way: "Just to add, on UEFI machines that got bricked like this I removed the battery and disconnected the CMOS NVRAM battery and this restored the machine to the factory default and fixed the issue for me."

Re:Booting Linux using UEFI can brick Samsung laptops by donrhummy on Thursday January 31, 2013 @11:37PM (#5149228)
It appears he didn't do that with a Samsung laptop but other machines in the past and someone replied saying it didn't fix it for them: https://bugs.launchpad.net/ubuntu-cdimage/+bug/1040557/comme...
Re:Booting Linux using UEFI can brick Samsung laptops by entropy_ on Wednesday January 30, 2013 @04:09PM (#5141769)
With various laptops I've owned over the years, this almost always fixes the problem when the laptop refuses to boot(except when there's actual hardware failure). It's usually pretty straightforward to do too.
Re:Booting Linux using UEFI can brick Samsung laptops by hexonexxon on Wednesday January 30, 2013 @02:00PM (#5141070)
Or just learn how to do it properly

Getting Code Right And Secure, The OpenBSD Way http://www.bsdcan.org/2010/schedule/events/172.en.html

Re:Booting Linux using UEFI can brick Samsung laptops by cube13 on Wednesday January 30, 2013 @04:02PM (#5141747)
It's worth pointing out that Samsung does have a history of issues with "secure" bootloaders.

https://plus.google.com/u/0/101093310520661581786/posts/Drq9...

Re:Booting Linux using UEFI can brick Samsung laptops by stephengillie on Wednesday January 30, 2013 @11:00AM (#5140010)
Are you describing a Denial of Service attack? One where the attacker would get the desktop or server to try to install and run Arch Linux, then let it brick itself? If a critical Windows server or workstation was hit, this could cause a project to grind to a halt.
Re:Booting Linux using UEFI can brick Samsung laptops by tarabukka on Wednesday January 30, 2013 @01:12PM (#5140823)
I think finding a kernel exploit in the server's OS that let you run the firmware-bricking code would probably be more viable than installing a new operating system.