Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

hpa'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.




Agreed.

It's a shame the author (mjg59?) did not respond to hpa's comment - it seems the "obvious" solution.


Sorry 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.


1. 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.)


If 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.


Yes, 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.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: