4 ms·
Expected: stories about vendors doing nefarious underhanded things. Actual: a pretty interesting debugging story involving a misbehaving driver DMA'ing things
by endgame 15y ago
Expected: stories about vendors doing nefarious underhanded things.
Actual: a pretty interesting debugging story involving a misbehaving driver DMA'ing things into memory where it shouldn't.
- pgeorgi 15y agohpa's proposal is a good one: Just disable busmaster for all devices on entry and let drivers sort it out in their initialization routines again. 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.
- drucken 15y agoAgreed. It's a shame the author (mjg59?) did not respond to hpa's comment - it seems the "obvious" solution.
- mjg59 15y agoSorry about that. It may work, but some hardware batches dmaand replays it when enabled. I want to check whether that solved the problem before really commenting on it. The other risk is that there are some drivers that (brokenly) depend on the current behaviour. It may be easier to fix it in the boot loader.
- sounds 15y ago1. Hardware that batches DMA and replays it: a full device reset when the driver first initializes (before enabling bus mastering) should fix this, right? 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.)
- kelnos 15y agoIf someone has the ability to get a malicious device into your system, likely they have the ability to screw you over in more reliable ways too.
- sounds 15y agoYes, physical access is game-over. 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.