UEFI : More ways for firmware to screw you
mjg59.dreamwidth.org
mjg59.dreamwidth.org
Actual: a pretty interesting debugging story involving a misbehaving driver DMA'ing things into memory where it shouldn't.
There's not really a reason to have _any_ device bang on the memory before it's asked to by the current device manager (ie. BIOS or OS) and its drivers.
It's a shame the author (mjg59?) did not respond to hpa's comment - it seems the "obvious" solution.
2. Drivers that depend on this: which ones? Are they hard to fix?
Obligatory: I'm a kernel developer so I may be overly optimistic, but isn't this a security problem, at least in one sense? (That is, a malicious device may try to use bus mastering to attack a running kernel.)
However, what if the malicious device is actually a compromised but popular vendor who ships malicious firmware? That wouldn't be a stretch.
Resetting devices and fixing drivers isn't a huge win, but it's still an improvement. Like ASLR doesn't actively prevent buffer overflows - it just makes attacks more difficult.
Instead UEFI is a whole OS of its own.
Two words: EFI Shell.
I work regularly with servers that provide most or all of what EFI does, and within the console, though these servers provide it with considerably less confusion and hassle.
Having an embedded console can be very handy to have a functional operating system available in the firmware. Whether this is troubleshooting the server, or the boot process, or baseline server configuration without having to fire up an operating system or a diagnostic.
What's not so handy (with EFI) is the complete grab-bag user interfaces, nor the confusing array of consoles that can exist (the Shell, the menus, the BMC, and increasingly often a management widget), nor limitations around the callbacks. And the byte-code engine concept that was intended to avoid having to implement console (and boot) drivers for each new widget never really got traction.
Simply having boot drivers available as callbacks for the operating system would have been very handy for folks writing or porting an OS. Debugging in the bootstrap environment stinks.
IMHO, EFI just isn't a well-designed user interface. It seems to be a scatter-shot collection of pieces that were duct-taped together into a technology demonstration. And I'm not entirely certain the folks that originally built EFI ever intended the manufacturers present it to the end-users to use it as the primary console, either.
Does this article make UEFI sound more problematic than it actually is?
For more see this posts:
http://www.coreboot.org/pipermail/coreboot/2010-October/0608...
http://blogs.coreboot.org/blog/2010/06/03/one-week-plus/
Fun fact: Itanium systems were the first to ship with EFI.
I think it's funny that you compare testing of the Linux kernel where automated testing is an afterthought with project such as LTP. Most kernel devs I know basically test everything manually. Sure, there are lots of developers which look over the code and use builds from git so releases are stable.
On the other hand, UEFI is a specification which defines most interactions between different components and there is a comprehensive range of automated tests provided by UEFI SCT (Self Certification Test).
Full disclosure, I've worked on EDK2. Personally, I hate it when software is used to limit freedom. My contributions to EDK2 are BSD-licensed and upstreamed.
I've hit two real and severe bugs in EDK, one of which merely tended to crash any OS on boot and one of which allowed me to brick any hardware using the EDK BDS implementation to the point where recovery involved physical reflashing of the firmware.
Reality is that any codebase is, practically speaking, untested until it's been exposed to the real world. EDK, Tiano, and basically every real-world UEFI implementation haven't as yet. Putting them in the hands of people is going to find new bugs, and some of those are going to compromise operating systems. That's not a criticism of any part of the UEFI development process. It's a description of reality.
BIOS should have gotten smaller, not larger.