Windows applications making GRUB2 unbootable
chiark.greenend.org.uk
chiark.greenend.org.uk
This is a pretty nasty thing that's largely coming to light just now because GRUB2 uses a significantly larger portion of the space between the MBR and first partition ("embedding area," 24KB vs 10KB).
What we have is separate applications (GRUB2 and whatever Windows application) trying to use off-spec storage (the "embedding area") at the same time. Seems to be a bad idea on everyone's part, not just the GRUB or rogue Windows app developers.
The "embedding area" is not guaranteed to exist, be a certain size, or be unused: https://encrypted.google.com/search?q=embedding+area+is+unus...
Think about it, if an application can write to the boot area then you've got a giant hole in your security.
Hell, you can flash motherboards from an OS... writing to the boot area is just one example of many 'giant holes in your security'.
http://www.stoned-bootkit.info/
http://www.h-online.com/security/news/item/Bootkit-bypasses-...
http://www.anti-forensics.com/modify-truecrypt-encryption-bo...
That said, no application without a very high level of trust (perhaps above what an Administrator can do on Windows) should be able to write outside the filesystem. This should, at the very least, pop-up some "Program X is about to do something remarkably stupid. Allow or deny?" dialog.
We've solved the problem of data contention on a disk a long time ago...
Grub may not operating within an OS sandbox, but it is required to play nicely with the OSes it is booting. The way to do that is to wrap your data in a partition or a file.
grub-the-comman-line-utility writes to those sectors but it runs in linux userspace so it's really in the same position as the windows programs that also write to the reserved space...
Oh proprietary software vendors. Won't you ever learn that you can't stop "unauthorized use" on general-purpose hardware?
If it takes 3 months for a hot game to be cracked, you loose very few sales.
And yes, pirates will purchase the games if you make them difficult enough to crack.
Granted. One is for booting an operating system, the other for DRM purposes. But both are doing stuff they should not, so IMHO there's not much reason for complaints.
edit: I notice that I'm getting downvoted. Care to explain why? That embedding area isn't something you are supposed to write data to.
Now, some software out there still does it (grub2, truecrypt and various DRM solutions unser windows), but that doesn't give the maker of one software the right to blame the maker of another piece of software for writing there.
Both should find a better solution, but this certainly isn't a bug in either software - both work around the specification and are getting bitten.
In contrast, a bootloader like GRUB2 inherently works at a much lower level than user applications and is expected to modify certain things on the hard disk that would not belong to any operating system because it can assume (almost always) that it is the only bootloader on the disk.
This still does not make it right for GRUB et al. to call claim to that area of the hard disk. If anyone can write to it, for what ever their needs may be, then forethought should have said, "hey, this can potentially screw some stuff up. We should find a BETTER way". I use GRUB as my primary bootloader and I still cannot get on their side in this debate.
One that always works is to put all the grub stuff into its own primary partition and make that one bootable.
Of course that would greatly complicate the installation process, but maybe grub can reuse some of the work that was done for parted.
If grub was in its own partition, the likelihood of it being broken by third party software is much lower. What could happen is that some software resets the boot partition flag, but that's easily restored.
In case of EFI, if I understand correctly, you can even mark any file on any partition bootable (blessing the file is the term, I think), which makes it even easier.
I faced similar issues with Dell's backup/restore software for windows 7, which I multiboot with Ubuntu.Still others had this issue with HP backup and recovery manager
The relevant bug is here - https://bugs.launchpad.net/debian/+source/grub2/+bug/441941
What is interesting is that Grub apparently doesnt have a problem, but Grub2 does.
I got rid of it simply by uninstalling any bundled software (Dell, HP, Sony, Lenovo) BEFORE installing Linux.
http://www.geek.com/articles/news/turbotax-installer-destroy...
I'm kind of surprised there's software still doing this, and shouldn't Windows and its new and improved security have put an end to these kinds of shenanigans on its side?
Speaking for myself, I make a point of not running applications with administrator priveleges, except those which have a clear reason. My preferred virus scanner is one example. Installers are another, but Intuit's behavior leaves me much more reluctant to trust a vendor-supplied installer. Fortunately, I don't think those are so necessary, these days...?
I implemented a system for an OS bootstrap that uses a scheme similar to this, though I deliberately placed the boot partitions "underneath" (carefully double-mapped) files within the file system that were expressly created for the purpose of "protecting" the boot-level structures from the OS and its disk activities.
The files were located over specific ranges of disk blocks that were known to the console; so long as that mapping was maintained, everybody was happy.
That change would require changes to a few OS-level tools; to (for instance) a Linux partition or Windows. (I had that option.)
The other approach is to place the boot structures in a boot partition; to use one of the four slots available in MBR for a partition for the boot tools.
The consoles I was working with support EFI (and which has its areas of brain damage) and console makes allocating a GRUB2 boot partition trivial. That keeps the console and its tools from stomping on the partitions, and the applications from stomping the boot loader.
If you're stuck back in BIOS-land with MBR (and no easy way to launch into EFI), there's likely no good solution to these collisions other than grabbing an MBR slot, as there's almost certainly no general Windows coordination policy here other than "don't do that".
Microsoft Windows itself has occasionally and classically stomped on foreign-format disks; it had the galactic stupid of writing a "harmless" signature to disks it didn't find MBR structures on. If the console pilot allowed Windows to write that "harmless" signature and your foreign file system was corrupted.
The bootloader is a single point of failure -- for it to rely on unspecified behaviour is absurd.