News for hackers. Stuff that matters.
Re:x86 finds its way into the iPhone by monocasa on Friday September 14, 2018 @01:07PM (#17988929)
There isn't a big deal. Hell, AArch32 has something like 1400 instructions, it's just as complicated as an embedded x86. And as someone who's ported a kernel to both, it has just as many weird parts of the architecture built up over decades (ARM is about as old as 32 bit x86).

The motivation for the change is that Intel's making the baseband instead of Qualcomm now, so it's not an ARM/Hexagon like it once was.

The author is just bent around a decade plus out of date view of chip architecture.

Re:x86 finds its way into the iPhone by xoa on Friday September 14, 2018 @02:05PM (#17989399)
Yeah, this is at most just kind of geeky interesting. But otherwise it has no particular meaning whatsoever, particularly in an iPhone. Apple is one the few/only (I think Pixel too maybe? tptacek or other security folks would be up to date) phones to totally isolate the baseband, essentially treating it like a USB peripheral. Whether it uses USB or SDIO or PCIe it has no DMA to the application processor (Apple uses an IOMMU, all discusses in their iOS Security Guide) so while a hack of it I guess could still be irritating purely in terms of messing with cellular access, simple location privacy, or the wider network perhaps, it's not going to inherently leverage into access to the system. Baseband has its own secure bootchain of course as well.

Additionally given that this is a very low power low level embedded system device for a specific function it seems most likely that it's also, like Intel's old Atom chips, a refined derivative of older simpler x86 chips with in-order execution, no speculative execution, no µop transforms or other stuff like that. Would be kind of interesting to learn some of the details, but at any rate that means whole classes of security issues people are already bringing up in this thread (like Spectre/Meltdown) are entirely irrelevant. If some arch simply lacks speculative hardware period then that's that. Simplicity in general can have major performance impacts sure, but it's also lower energy and more secure.

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.
Re:x86 finds its way into the iPhone by foobarian on Saturday September 15, 2018 @10:41AM (#17994439)
Intel making the baseband instead of Qualcomm?? That seems like a huge deal to me.
Re:x86 finds its way into the iPhone by jsjohnst on Saturday September 15, 2018 @01:45PM (#17995236)
That’s old news mostly. Intel has been making iPhone basebands for several generations, the new news is its exclusively Intel. Given Qualcomm and Apple’s very public fights, not surprising, but I’m curious how Intel overcame Qualcomm‘s patents on CDMA. Did they expire? Did Intel somehow get a license? I’m definitely curious and will post back with what I find assuming someone else doesn’t first.

Edit:

Guess Intel got the CDMA assets via its purchase of VIA Telecom assets in 2015. Wonder why it’s taken this long to come to market?

Re:x86 finds its way into the iPhone by jonstokes on Friday September 14, 2018 @01:11PM (#17988972)
This ^^. The "OMG... HORROR" in this article about the mere fact of x86 usage is deeply silly. The stuff about C64 and so on at the end... there's just no redeeming this mess. The mods should nuke it.
Re:x86 finds its way into the iPhone by xxpor on Friday September 14, 2018 @01:24PM (#17989074)
I found it to be interesting. Don't be a gatekeeper.
Re:x86 finds its way into the iPhone by monocasa on Friday September 14, 2018 @01:18PM (#17989029)
So, I just want to throw out there that your arstechnica uarch articles are one of the things that pushed me into computer engineering rather than straight CS. And Inside The Machine I consider to be up there with Patterson & Hennessy. Thanks for all of that! : )
Re:x86 finds its way into the iPhone by jonstokes on Friday September 14, 2018 @01:27PM (#17989093)
Thanks!
Re:x86 finds its way into the iPhone by evancox100 on Friday September 14, 2018 @04:01PM (#17990460)
Hey, same here! Your articles are what inspired me to go into chip design /computer engineering. Still have my signed copy of Inside the Machine on my bookshelf :)

Thanks a ton!

Re:x86 finds its way into the iPhone by godelmachine on Friday September 14, 2018 @03:18PM (#17990061)
Thanks for the info! Now there's a pundit I can follow and read the books he authored.
Re:x86 finds its way into the iPhone by pcwalton on Friday September 14, 2018 @04:01PM (#17990459)
Uh, it's technically interesting. If HN consisted of just articles like this, it would be a better site.
Re:x86 finds its way into the iPhone by simias on Friday September 14, 2018 @06:20PM (#17991519)
Is it? It's 3 pages of overly emphatic text revealing that an Intel chip is based around an x86 CPU. By the author's own admission is their conclusion: "Nothing really, I just found this funny and wanted to share".

Also I'm a bit baffled that they wrote a tool to measure the entropy of the machine code, tried hand-disassembling and considered that it might have been an encrypted binary format before guessing that an Intel chip could be running an Intel CPU. But they did try "EVERY POSSIBLE RISC ARCHITECTURE [they] KNOW" because apparently nobody ever used CISC on embedded devices. Nobody tell him about the GameBoy.

Of course I'm a bit harsh, it's easy to mock in hindsight but it's still not very interesting technically.

Re:x86 finds its way into the iPhone by lcq2 on Sunday September 16, 2018 @03:29AM (#17997757)
obviously you're not into baseband reversing, otherwise you would have known that for the past 10+ years, basebands were almost always RISC cpu and almost always ARM...

moreover, all previous iterations of Intel basebands were custom ARM cores based around Infineon IP acquired by Intel to be competitive in the baseband market...you did not even read my document, because I said this about the old baseband version

moreover, by the nature of baseband itself, it requires a CPU capable of real-time or near real-time processing, as a matter of fact other vendors are using Cortex-R CPU, which is an ARM cpu made for real-time os, giving you predictable timings, especially interrupt processing and memory access

for example, Cortex-R gives you a special kind of memory, called TCM (Tightly-Coupled Memory) memory, which gives you predictable memory access timings, something that you cannot obtain with a simple cache

by the way, Cortex-R is also used in WiFi chipsets, because the type of processing required is very similar (check the excellent writeup done by Google's Project Zero about this)

so yes, it is interesting to see how Intel managed to implement this kind of features in an x86 CPU, which was never designed for such kind of requirements

I suggest you take a look at the References in my document, they might provide some useful information on the matter

of course if you're not interested in baseband reversing, then I guess you're right, it's not technically interesting material

Re:x86 finds its way into the iPhone by pcwalton on Friday September 14, 2018 @07:38PM (#17991960)
It's interesting that x86 is making inroads into mobile, yes.
Re:x86 finds its way into the iPhone by wrs on Friday September 14, 2018 @08:44PM (#17992244)
Sorry, having learned on VAX and 68K, followed by several years of ARM, I will never lose my instinctive revulsion to the creeping unkillable multitentacled horror that is x86. :)
Re:x86 finds its way into the iPhone by mehrdadn on Friday September 14, 2018 @02:39PM (#17989695)
It was a great read, I wouldn't nuke it.
Re:x86 finds its way into the iPhone by chocolatebunny on Friday September 14, 2018 @02:03PM (#17989383)
The article mentions that the old Intel baseband processor was running ARM. It seems like Intel is slowly trying to migrate all their processors to x86, given that they migrated their Management Engine from ARC to x86 a few years ago and now this.
Re:x86 finds its way into the iPhone by godelmachine on Friday September 14, 2018 @02:23PM (#17989552)
Would you please tell me what do you mean by baseband here? Are you referring to base radio frequency? Thanks.
Re:x86 finds its way into the iPhone by SomeHacker44 on Friday September 14, 2018 @02:43PM (#17989729)
Baseband usually refers to the firmware running the CPU/chip dedicated to operating the radio(s), generally the WAN radio (LTE, 3G, etc.) for a cellular connection, although some are integrated with other types (WiFi, Bluetooth, NFC, etc.).
Re:x86 finds its way into the iPhone by godelmachine on Friday September 14, 2018 @03:19PM (#17990063)
Thanks!
Re:x86 finds its way into the iPhone by lcq2 on Sunday September 16, 2018 @03:42AM (#17997796)
oh not really, as I already said, Intel basebands were ARM cpu...iPhone was using the Hexagon platform only for CDMA versions, you can check it by downloading a random ipsw from previous years iPhone models

they were Hexagon only just for few models (iPhone 5 and 5s I think), before that, they were using the Infineon baseband, which guess what...it's what Intel bought :)

btw, for the last 10+ basebands were mostly ARMs, with very few exceptions (the already mentioned Hexagon), check also Mediatek and Huawei basebands

and yes, I don't like having an x86 as an embedded CPU, but that's my problem, I guess...

Re:x86 finds its way into the iPhone by rasz on Saturday September 15, 2018 @09:15AM (#17994181)
sure, booting in real mode, a20, EIP rollover. For real Intel wins look no further than Puma cable modem chipsets switched over from arm to x86 - 1GBit links can be DOSed with 1Kb/s stream.