News for hackers. Stuff that matters.
Re:x86 finds its way into the iPhone by mehrdadn on Friday September 14, 2018 @02:25PM (#17989570)
Is using an IOMMU with a USB peripheral really enough? If my PC satisfies those and I plug in a random USB device am I safe?
Re:x86 finds its way into the iPhone by monocasa on Friday September 14, 2018 @02:45PM (#17989752)
You don't need a IOMMU with USB. USB isn't an RDMA protocol like firewire and PCI-E, so an IOMMU doesn't really even make sense in that context.

But no, you're not safe because crappy USB drivers can probably be exploited if they're expecting the USB device to be playing nice.

Re:x86 finds its way into the iPhone by tptacek on Friday September 14, 2018 @03:03PM (#17989923)
You're not necessarily safe, but obviously no matter how isolated you make the cell baseband, you can't get past "crappy glue code can still bone you". The reality is that the HSIC interface between the AP and the baseband is --- conceptually, at least --- about the best you can possibly do.
Re:x86 finds its way into the iPhone by monocasa on Friday September 14, 2018 @03:10PM (#17989984)
Sure, I was mainly addressing "If my PC satisfies those and I plug in a random USB device am I safe?" rather than the constrained case of a known baseband and single driver.
Re:x86 finds its way into the iPhone by bri3d on Saturday September 15, 2018 @12:24AM (#17992979)
The basic USB protocol does not allow for direct peripheral mastering of DMA (unlike IEEE 1394 or PCIe for example). So, barring a protocol exploit in the USB host controller, which is certainly a theoretical possibility given the enormous size of the specification, fencing off the USB host controller using the IOMMU is just an additional layer of protection, rather than a necessary boundary like it is for a PCIe or 1394 device which has access to memory natively.

A USB-C/USB3 physical port makes things a bit more complicated, as it also could be attached to a controller supporting Thunderbolt, which is PCIe.

The unsafe part of plugging in a USB device is probably at the OS level rather than the protocol level - in my opinion you're much more likely to be owned by something like connecting a device with a buggy or compromised driver, mounting a filesystem containing an FS exploit, or reading a file containing an application exploit than by a USB-level protocol exploit.

Re:x86 finds its way into the iPhone by monocasa on Saturday September 15, 2018 @02:16AM (#17993243)
Right, that's why I said "but no, you're not safe because crappy USB drivers can probably be exploited if they're expecting the USB device to be playing nice."

Finding a USB protocol level exploit would be like finding an exploitable bug in how a NIC does scatter/gather of packets. Like, notings impossible, but damn.

You still shouldn't stick random unknown USB devices into your computer though.

Re:x86 finds its way into the iPhone by tzs on Friday September 14, 2018 @07:30PM (#17991932)
Also perhaps it should be noted that if it is a USB-C connector it may be a Thunderbolt 3 port in addition to being a USB port, which may support PCI-E and allow direct access to memory by a peripheral even if there is no driver installed for that peripheral.
Re:x86 finds its way into the iPhone by jrockway on Friday September 14, 2018 @02:43PM (#17989737)
The drivers on your PC are the issue. The USB controller isn't going to let a USB device directly access memory, at least from my understanding of the spec.
Re:x86 finds its way into the iPhone by _emacsomancer_ on Friday September 14, 2018 @05:56PM (#17991321)
I believe USB presents a much smaller attack surface since it has no direct memory access, apparently in contrast to SATA.
Re:x86 finds its way into the iPhone by monocasa on Friday September 14, 2018 @07:22PM (#17991891)
SATA doesn't allow for DMA from the target device. SATA controllers can DMA, but that's not different from how NICs and USB controllers typically typically DMA. The target addresses are ultimately controlled by the device on the host side. Like USB it feels more like a traditional network protocol than a traditional bus protocol.

PCI-E does DMA, and AFAIU was inspired by Infiniband (another RDMA protocol).

Re:x86 finds its way into the iPhone by _emacsomancer_ on Friday September 14, 2018 @08:07PM (#17992091)
My understanding is that it was easier for SATA controllers to do DMA than it was for USB controllers, but I have a fairly limited understanding.
Re:x86 finds its way into the iPhone by Buge on Saturday September 15, 2018 @01:20AM (#17993102)
You're not safe plugging a random USB into your computer. It can pretend to be a keyboard and install malware.