LWN: Comments on "Bounce buffers for untrusted devices" https://lwn.net/Articles/786558/ This is a special feed containing comments posted to the individual LWN article titled "Bounce buffers for untrusted devices". en-us Fri, 07 Nov 2025 11:39:56 +0000 Fri, 07 Nov 2025 11:39:56 +0000 https://www.rssboard.org/rss-specification lwn@lwn.net Bounce buffers for untrusted devices https://lwn.net/Articles/787203/ https://lwn.net/Articles/787203/ bobot <div class="FormattedComment"> It could be a first step which doesn't require any modifications of the user code. Later user code could be modified to avoid the need of bounce buffers.<br> </div> Wed, 01 May 2019 08:02:56 +0000 Bounce buffers for untrusted devices https://lwn.net/Articles/787164/ https://lwn.net/Articles/787164/ kevincox <div class="FormattedComment"> Why use a bounce-buffer instead of just ensuring that nothing shares the page of the regular buffer? It seems like you now have an "owned page" plus an additional copy.<br> </div> Tue, 30 Apr 2019 16:44:46 +0000 Bounce buffers for untrusted devices https://lwn.net/Articles/787124/ https://lwn.net/Articles/787124/ Trelane <div class="FormattedComment"> How does this work where peer-to-peer transfers are a feature, e.g. Nvidia gpudirect?<br> </div> Tue, 30 Apr 2019 12:30:03 +0000 Bounce buffers for untrusted devices https://lwn.net/Articles/787108/ https://lwn.net/Articles/787108/ jezuch <div class="FormattedComment"> ...To protect against regular incompetence in addition to malice.<br> </div> Tue, 30 Apr 2019 10:08:18 +0000 Bounce buffers for untrusted devices https://lwn.net/Articles/787001/ https://lwn.net/Articles/787001/ jic23 <div class="FormattedComment"> It's worth noting that the performance lost by not doing lazy invalidations of the TLBs may well be significant. Shall we say, that 'optimization' is there for a reason.<br> </div> Mon, 29 Apr 2019 07:45:04 +0000 Bounce buffers for untrusted devices https://lwn.net/Articles/786990/ https://lwn.net/Articles/786990/ remleduff <div class="FormattedComment"> I don't understand why the kernel doesn't allocate to the granularity of the IOMMU. There doesn't seem much harm in wasting part of a single 4k page if the device only wants part of it.<br> </div> Sun, 28 Apr 2019 21:13:51 +0000 Bounce buffers for untrusted devices https://lwn.net/Articles/786979/ https://lwn.net/Articles/786979/ mfuzzey <div class="FormattedComment"> There will be a performance hit certainly but I don't think it completely negates the advantages of DMA.<br> <p> As you say for large transfers the bounce buffer will only be used for the first and last partial pages.<br> But, even without that if you read directly from the device it has to be word by word to/from the peripheral by the processor.<br> Peripheral access is often slower than memory, due to wait states, uncached access, barriers etc.<br> Peripherals designed for DMA use may also have faster DMA access than CPU access (that all depends on the bus interconnects).<br> <p> Furthermore even if the DMA is done to a bounce buffer that can be done quickly, potentially freeing the FIFO registers in the peripheral device for the next transfer while the CPU copies the first one.<br> </div> Sun, 28 Apr 2019 17:03:04 +0000 Bounce buffers for untrusted devices https://lwn.net/Articles/786969/ https://lwn.net/Articles/786969/ alison <div class="FormattedComment"> Doesn't having a bounce buffer rather defeat the purpose of DMA? Is DMA via a bounce buffer faster than just plain copying the data in the processor's address space via normal mechanism? Perhaps the answer is that devices that perform small transfers that need sub-page allocations also perform many large transfers for which DMA makes sense.<br> </div> Sun, 28 Apr 2019 05:59:08 +0000 Bounce buffers for untrusted devices https://lwn.net/Articles/786964/ https://lwn.net/Articles/786964/ tau <div class="FormattedComment"> Not if the root disk is encrypted using a TPM-protected key<br> </div> Sat, 27 Apr 2019 19:25:40 +0000 Bounce buffers for untrusted devices https://lwn.net/Articles/786961/ https://lwn.net/Articles/786961/ hmh <div class="FormattedComment"> Do read their errata sheets/hardware defect lists... :(<br> </div> Sat, 27 Apr 2019 17:53:52 +0000 Bounce buffers for untrusted devices https://lwn.net/Articles/786948/ https://lwn.net/Articles/786948/ tao <div class="FormattedComment"> Wouldn't such a scenario be kind of bye-bye anyway? Remote the root disk, replace it with one that has a replaced kernel or /etc/shadow or /bin/login or /bin/ssh or /bin/gpg or a gazillion other neat little backdoors.<br> </div> Sat, 27 Apr 2019 11:58:37 +0000 Bounce buffers for untrusted devices https://lwn.net/Articles/786941/ https://lwn.net/Articles/786941/ pabs <div class="FormattedComment"> While researching the answer, I came across this question, which includes some links to research related to my question:<br> <p> <a href="https://security.stackexchange.com/questions/176503/dma-attacks-despite-iommu-isolation">https://security.stackexchange.com/questions/176503/dma-a...</a><br> </div> Sat, 27 Apr 2019 02:28:17 +0000 Bounce buffers for untrusted devices https://lwn.net/Articles/786940/ https://lwn.net/Articles/786940/ pabs <div class="FormattedComment"> Has there been any research into how trustworthy IOMMU devices are?<br> </div> Sat, 27 Apr 2019 02:16:55 +0000 Bounce buffers for untrusted devices https://lwn.net/Articles/786938/ https://lwn.net/Articles/786938/ flussence <div class="FormattedComment"> And not just network devices either; things like DVB decoders on TV cards would make for an interesting target.<br> </div> Fri, 26 Apr 2019 23:59:45 +0000 Bounce buffers for untrusted devices https://lwn.net/Articles/786935/ https://lwn.net/Articles/786935/ sbates <div class="FormattedComment"> <font class="QuotedText">&gt; A PCI device is marked untrusted if the firmware marks its root port as external (currently only if the ExternalFacingPort ACPI property is set); that should be the case for Thunderbolt devices.</font><br> <p> Is this setting also done for removable NVMe SSD slots in storage servers? If not then one could envision someone with physical access to the server could remove a trusted NVMe SSD and insert something more malicious. There are already several NVMe form-factors and servers that can support hot plugging of new PCIe devices and many more are coming....<br> </div> Fri, 26 Apr 2019 22:55:39 +0000 Bounce buffers for untrusted devices https://lwn.net/Articles/786926/ https://lwn.net/Articles/786926/ josh <div class="FormattedComment"> Yeah, at the end of the day *all* devices should be untrusted and use an IOMMU.<br> </div> Fri, 26 Apr 2019 20:10:21 +0000 Bounce buffers for untrusted devices https://lwn.net/Articles/786916/ https://lwn.net/Articles/786916/ cesarb <div class="FormattedComment"> <font class="QuotedText">&gt; A PCI device is marked untrusted if the firmware marks its root port as external (currently only if the ExternalFacingPort ACPI property is set); that should be the case for Thunderbolt devices.</font><br> <p> I won't be surprised when we find in the wild a computer where external Thunderbolt ports are not marked as ExternalFacingPort (or the opposite, a non-removable built-in device on the motherboard marked as ExternalFacingPort).<br> </div> Fri, 26 Apr 2019 18:24:54 +0000 Bounce buffers for untrusted devices https://lwn.net/Articles/786909/ https://lwn.net/Articles/786909/ hkario <div class="FormattedComment"> I'd say that as a defence in depth approach, this should be applied to all devices, not only ones that have non-free or known buggy firmware.<br> </div> Fri, 26 Apr 2019 17:25:37 +0000 Bounce buffers for untrusted devices https://lwn.net/Articles/786907/ https://lwn.net/Articles/786907/ lkundrak <div class="FormattedComment"> <font class="QuotedText">&gt; PCI devices are usually built into the system, there was not much concern about them going rogue</font><br> <p> There certainly are PCIe devices running firmware of very [1] questionable [2] quality that have network access. Can the MCUs generate arbitrary PCIe bus transactions? If so, I suppose they should also be marked untrusted? Is the untrusted property exposed in sysfs? Perhaps something like an udev rule that would mark net/wwan devices with non-free firmware (or at least known bad firmware) as untrusted would make sense?<br> <p> [1] <a href="https://googleprojectzero.blogspot.com/2017/04/over-air-exploiting-broadcoms-wi-fi_4.html">https://googleprojectzero.blogspot.com/2017/04/over-air-e...</a><br> [2] <a href="https://blog.quarkslab.com/reverse-engineering-broadcom-wireless-chipsets.html">https://blog.quarkslab.com/reverse-engineering-broadcom-w...</a><br> </div> Fri, 26 Apr 2019 17:15:09 +0000