Using Rowhammer bitflips to root Android phones
arstechnica.com
arstechnica.com
If you have a Microcenter nearby, you can get a $40 discount on an AM1 bundle deal. The motherboard and CPU end up being about $40 total. It makes a decent little Unix server.
The Intel J1800/J1900/J2900 boards are pretty cheap too but no ECC. Also, Asrock just announced its Goldmont-based J4205 board.
Kabini supports it. Construction cores support it. FM2+ does not, but the mobile socket version FP3 does.
> Tests show that simple ECC solutions, providing single-error correction and double-error detection (SECDED) capabilities, are not able to correct or detect all observed disturbance errors because some of them include more than two flipped bits per memory word.
Proofing hardware against Rowhammer is still necessary even if it does happen to help DRM. It is not possible to write secure code of any kind in an environment where Rowhammer can be performed. The casual dismissiveness the industry seems to have about this problem really surprises me... per the article we all just read, this at least threatens to become a Heartbleed-class problem at some point, but will make Heartbleed remediation look like a walk in the park by comparison. Hardware diversity generally protects us, but there are places where there isn't as much diversity, such as phones, where this could become a massive problem.
Rowhammer via Javascript is already a thing.
See where I'm going with this?
Since we're unlikely to see larger memory cells again, mitigations will likely be applied. There is a good question on a discussion board [1] from last year about memory scrambling and its utility here; but with no responses. Can these questions be answered? Some points about memory scrambling are also made here [2] by Kim of the 2014 CMU paper.
[1] https://groups.google.com/forum/#!topic/rowhammer-discuss/tp...
https://news.ycombinator.com/item?id=9251479
It also reminds me of the old CD copy-protection schemes that worked by attempting to (and in a lot of cases, successfully) forcing the scrambling algorithm it uses to output difficult-to-write bit strings:
https://www.pricenfees.com/digit-life-archives/magic-figures...
http://www.cdmediaworld.com/hardware/cdrom/news/0102/sd2_tru...
http://www.sciencedirect.com/science/article/pii/S1742287616...
They suggest that the scrambler is reseeded randomly on every power up so it may be hard to control raw bits on the data bus.
And it's always been done this way, old "dumb phones" have always been closed proprietary blobs.
The real reason is that hardware manufacturers like control.
I'd say it's a better way of running a consumer device for the typical user. For example, any application you run on a Windows PC even without administrator access could access and upload your web browser profiles. The average user doesn't expect this.
But a lot of manufactures do give you the choice to run your own firmwares which can have the root user access. It'll require a bootloader unlock which removes the signature checking.
For example: HTC: http://www.htcdev.com/bootloader
Motorolla: https://motorola-global-portal.custhelp.com/app/standalone/b...
Sony: http://developer.sonymobile.com/unlockbootloader/unlock-your...
LG: https://developer.lge.com/resource/mobile/RetrieveBootloader...
Huawei: https://emui.huawei.com/en/plugin/unlock/index
Couldn't find an official page for Samsung but it looks like it's a matter of running fastboot after enabling OEM unlock in developer settings.
The other side of this is that there are quite a few devices that are carrier branded. And usually what happens is that carrier requests that the phone's bootloader is not unlockable.
Sadly unlike how Apple can sell their phone without any carrier modifications, Android manufacturers have to accept these kinds of changes otherwise they won't be able to sell their phone.
Good thing we're still admin/root on our personal computers. Seeing what MS/Google are doing, perhaps not for too long.
What you're really asking is why is there no root shell by default on all phones, and simply posing the question also answers it - it's a phone, there's zero demand for messing about with terminal emulators on a phone. If you say, but I'd like to install apps as root, the problem is such apps could break the phone in arbitrary ways like by infecting it with malware/adware/spyware that then can't be uninstalled. Modern operating systems are very much designed to limit what apps can do to avoid the nightmare that desktop OS's turned into, where people are afraid of installing apps in case something goes wrong. For better or worse you can install apps on Android/iOS without much fear, which is one reason people do it so much: you can always remove the app again if it's trouble.
Android is pretty customisable and has lots of permissions anyway. There are very few things you can't do if you don't have a carrier-locked phone. So supporting apps with root access would vastly worsen the malware situation in order to satisfy a tiny number of geeks who like editing config files: a very bad tradeoff.
But hey, Android is open source, so if you think I'm wrong go ahead and make money selling phones with root access.
Oh yes, this. I pay for Google Music which is supposed to include that, but I do now have it by virtue of living on the wrong side of some border.
If you can beat YouTube's DRM then you can just make your own player app. No need for root.
If you can't then what makes you think you could defeat whatever checking for rooted devices YouTube would add to their app?
Anyway, this sort of discussion is pretty pointless. The market has spoken. The number of people who care about root access is tiny compared to the number of people who want a safe device and app experience. Heck the entire iPad/iOS experience is pretty much "let's take a general purpose computer, make it do less, and it'll sell much better".
Works fantastically.
[1] https://f-droid.org/repository/browse/?fdfilter=NewPipe&fdid...
EDIT to match your edit: you remember wrong, the option is always there (unless there is some manufacturer out there that blocks it (Amazon maybe?), but most devices certainly don't)
After that you are allowed to install .apk files (e.g. clicking the "download of xy.apk finished" notification or in a file explorer app).
Edit: that setting is always there, it's only greyed out if you installed a corporate app that explicitly disables it (e.g. the "GoodApp" email/calendar/contacts suite).
Wait.. What? Why would that be the case? And .. why would you state that you'd lose your warranty and prepend 'of course'?
As far as I'm aware you do NOT lose your warranty. That would be rather stupid (of course).
But even if you manage to do that somehow, that is a specific problem. Using a general statement like 'flashing voids your warranty' remains weird (and wrong imo).
"Stuffing your phone in your pockets voids your warranty. Because if you stuff it in your back pocket and sit down on it, hard, it's not the manufacturer's fault if the screen breaks. Is it?"
That said, even if you flash stuff without reading instructions or fully understanding what you do: Most errors I've seen are flat-out not working (software stating: "Can't do this, you're messing up") or recoverable/soft-bricks only.
(In the end it doesn't matter if you CAN kill your phone by flashing nonsense: That still wouldn't make a good argument for "Flashing voids the manufacturer's warranty". I'd just mean that those individuals who bricked their phone .. might not be covered.)
Apple added "been in water detection" to avoid payout on that very activity.
If I flash my phone and later some part of it breaks because it came bad from factory, that is independent of me flashing the phone and should be covered.
GP replied to one of my posts, saying that there IS a real risk of bricking your phone when you flash it (I don't disagree, but consider it unlikely).
By comparing the process with a totally different ~real risk~ (phone -> toilet) I'm trying to drive the point home that it isn't a problem of either flashing your phone or playing some mobile game on that white throne of yours, it is a problem of being careless. Bricking my phone shouldn't be covered by a warranty. Flash or flush doesn't matter.
But trying to imply that the warranty is void because I installed software is overly broad and crazy: If I flash CM today and the phone dies in a month from now due (battery dead, hardware issues w/ screen or power button, antenna issues, pick anything faulty you had with a vanilla/unchanged handset in the past), then CM isn't to blame and my phone has a working warranty (for all I know, for all I care - and anything else seems completely unacceptable in my world).
Of course the manufacturers, who have vested financial insterest, will make you think otherwise.
Of course, this depends on the laws in your jurisdiction.
"What did you do that bricked your phone?"
"I flashed some custom firmware and stopped the flash mid-way"
"But how? All our phones are locked"
"I unlocked it"
"Aha! That is the real culprit!"
Likewise, if you hack special software onto the phone, overriding protections that they put in place to prevent it, I could see them refusing to spend time and money trying to fix the phone until you undid those changes first. And I believe some of those changes can't be un-done fully, even if you re-flash a stock firmware.
The net effect is that it effectively voids your warranty.
So no, technically you don't lose your warranty, but you also can't really make use of it, either.
This really only applies to software things, though. Hardware problems, like the battery exploding or the phone just refusing to turn on would still be easy to get covered, since you can't even get far enough to see it's been modified.
But if the GPS stops working or it stops receiving calls, they could blame it on the custom firmware, and they might even be correct.
If I hand in my handset to claim my warranty, I'm fine with a 'wipe by default' policy. In fact, my limited experiences (both with my phones and the ones from my closest family) that was implied anyway: You'd get the phone back with a ~fresh~ factory image (and all the crap- and adware that this includes).
So here's the thing: If I claim that GPS doesn't work, you reflash it with a Known Good™ image and GPS still doesn't work - then the device has a hardware problem.
If I can cause a hardware problem by running a different flavor of Android, then .. that's a serious hardware _design_ problem.
I'm not saying that you cannot kill or damage a device. But defaulting to 'You installed stuff, you probably caused it' seems rather simplistic, is probably wrong a good number of times.
You brought up PCs: I think you'd have a hard time if you'd defend the stance that installing Linux on a laptop voids the warranty. Granted, the underpaid tech support might not be able to help me around software issues, but if I claim that the wifi doesn't work and send it in... Do you believe they can/could/should refuse to check and fix the problem under warranty?
I'm actually saying that they did refuse to attempt to fix the problem unless you restored the original OS that they sold it to you with. (I believe upgrades to newer versions was okay, because those were supported on newer computers. I didn't encounter that situation in the time I was there.)
Having said that, I didn't always toe the company line. I often did my best to help people who were using an unsupported configuration (added internal hardware, different OS) but there was still a limit to what I could do. Unlike most of the others, though, I had a few years experience working at a computer shop, so I actually knew things and wasn't just reading from the company intranet's guides.
I got caught a couple times on software problems that appeared like hardware problems, too. By not forcing them to revert to the original software, and then escalating them to second tier support, I ended up getting in trouble. So there was at least some method to their madness.
Sending it in, though... There wasn't a place to do that. So far as I know, there weren't any physical stores other than big name retailers like Best Buy, and you couldn't just ship it in without going through phone support. So you had to try the advice from the phone support first before shipping it in.
Maybe in the USA you do (I'm not sure about consumer protection law there), but in the EU you certainly don't. The law states clearly that: It's up to the manufacturer to prove that the unintended software modification caused the hardware problem.
So, if your software modification doesn't pose any problem, or even in the case it does, if it doesn't affect the part of the device you are asking to repair under warranty, then the manufacturer has to make the repair under warranty.
On old UNIX mainframes the trust model had 2 kinds of actors:
- System administrators
- Users
The biggest security concern was one user getting access to the files of another user on the same system. The sysadmin decided which applications to trust (and most of them were either opensource or made by big companies, so we didn't have to worry about application developers doing nasty things). As a result, applications just ran with all the permissions of the user who started them. They could do anything that the user themselves were allowed to do, like read all your files, open a network connection and send your secrets out over the internet. But so long as users didn't run any dodgy programs it was (mostly) fine.
All modern desktop operating systems inherit that system. But over the last couple decades three things have changed:
- Computers got so cheap that now everyone has their own
- There are more apps than ever, and some of them are malicious
- There aren't enough sysadmins to save grandma
Modern phones we have a much better security model, which they inherited from the web. There are two changes:
- Multiuser support is gone at an application level.
- Apps are sandboxed from one another to protect you and your data from malicious apps. The way they do that is by isolating each app on the phone so no app can read&write to any of the data owned by another app.
For example, if you use google docs then by necessity you have to trust the docs app with your documents. But thats it! The google docs app doesn't get to access to your facebook login information. And the facebook app doesn't have access to your google account. If you had equivalent native apps on your desktop, these apps would be able to read one another's files!
But rooting your phone (at least partially) ruins all that! Rooting (by definition!) gives some 3rd party apps the capacity to access data stored by other apps on your device, which ruins the phone's security model.
The reason why some manufacturers (like apple) take a hardline stance against rooting is that if rooting your phone was easy, some app developers would undoubtably decide they'll only function on rooted devices. (This happens on android today for wifi sniffers and stuff like that.) If enough apps do that, the manufacturers will feel pressure to make it easy to disable app sandboxing, which will result in more and more apps wanting "Full permissions on your phone". People will mash "yes" on the install box (nobody reads that stuff anyway) and before you know it there'll be malware on your phone reading your email and threatening to send porn to your boss on your behalf if you don't pay up. DDoS attacks will come from phones, and will cripple the mobile network. And to fix all that norton will release an android version which will start scanning your phone for viruses at the worst possible moment of that show you like on netflix.
And that is why rooting your phone is hard.
> […] the data owned by another app.
This makes me sad. I don't want my data owned by an app, I want it owned by me.(This does not imply allowing all software running on my behalf access to all of my data all of the time.)
Apps owning their own data in Android should make you happy, not sad, because it's what prevents a malicious app from hoovering up all of your Tinder messages, or your financial data from Mint.
> That's completely separate from ownership of the data
No, it isn't. Under the app-controlled model, my access to my data is limited to what the app offers. > […] it's what prevents a malicious app from hoovering up all
> of your Tinder messages, or your financial data from Mint.
That's an implementation of access control using the app-owned-data model. It's not the only possible implementation of access control.That's well and good, but it also prevents YOU from hoovering up all your data.
Are you claiming that wifi sniffers could work without root, and require root for other reasons? An app that uses root to work around a gap in the permission system is not in support of your point.
Also, apps can already force the user to grant them very invasive permissions or exit. Yet I don't see it being universally abused.
Then why am I reading about this in October?
https://www.gnu.org/philosophy/right-to-read.en.html
I had thought this was too obvious to bother pointing out, but no, root exploits are not a good thing. The reason phones use kernel sandboxing is to allow users to install apps and have confidence the permissions granted mean something. A root exploit means any app or update you install may turn the phone into spyware, a portable bug-in-your-pocket.
The number of users who care about that is measured in billions (all phone users). The number of phone users who care about getting a root shell for their own use is vanishingly small, especially as people who care about that buy phones like the Nexus that have unlocked bootloaders anyway.
So no - this sort of exploit is pretty damn bad. The number of people hurt is multiple orders of magnitude higher than the number of people "helped", where that "help" is extremely tenuous anyway.
Only a very small number of people care about how /any/ individual piece of technology could be improved, they have have other things to think about. That is a not a valid argument. It would be better to have it by some other means to get root, but it's not as simple as you make it out. Show a user 2 otherwise identical phones, explain that on one phone, they could do things like tethering, and on the other phone, it's restricted because they can't get root, they will choose the one where they can get root.
There really aren't any reasons to try and root an Android phone. If you want to replace the OS with some custom open source build, just use a phone with an unlocked bootloader and go wild. But you can already access so many features and customise so many things without root it hardly seems worth it.
Your attitude seems to be "I should be able to get a cheap phone from a carrier by agreeing not to tether, and then I should be able to violate that agreement anyway, and this is a totally moral position". Phones are a commodity. You can get them anywhere. Want to tether? Buy a phone and a plan that allows it. Problem solved.
Which is why it baffles me beyond all limits just why so many smart Americans go out of their way to defend corporate practices that hurt them as customers.
Why are you trying so hard to support your telcos decision to make your life worse?
If everybody in your neighbourhood turned their faucets on at once, water supply would simply stop working. So?
This really isn't complicated. If your carrier contract doesn't forbid tethering but they sold you a phone that does, take it up with them, that sounds messed up and rare. If your contract forbids tethering then you're just trying to weasel your way out of a market you voluntarily entered in to. That's the opposite of the free market.
Now you are correct, and carriers responded to those demands from users for mobile networking with (usually metered or priced as an addon) "mobile hotspot" applications.
Contrary to your earlier claims, the advanced Android and iPhone user communities are not insignificant and may have played a part in getting demands like these met.
Places like androidpolice, and sites like engadget, lifehacks, gizmodo and others cater to this market, and drive popular knowledge of root modifications and jail breaking. Previous incarnations of Cyanogenmod boasted large numbers of downloads in the 100s of thousands if not millions.
let's see: device that sells the free-to-root marketing (even being a lie in this case), Nexus: billions of sales.
device that boast root to be impossible, blackberry: zero sales
Or we could end it and give users (limited) root access to their stock phones. Let us run OCI containers with restricted root user accounts. Bind mount certain filesystems given the correct Android permissions, such as the SD card or internal storage, or the user's emulated root. Or supported nested ARM virtualization.
Modern Linux supports a uid 0 with less than complete access in a cgroup, using the LSM to regulate specific capabilities, or creating the cgroup with limited caps to begin with.
Make access to areas the carrier considers sensitive conditional on a capability, or limit access to the full video decode hardware or shared memory from this root jail.
I have been able to compile but not run the runc binary from OCI/docker/rkt. Nested cgroupfs would solve a lot of these restrictions.
Actually the same generation of the same phone can use different memory chips and be produced by different manufacturers. It's very common for Apple and Samsung where they can't source enough parts from a single manufacturer.
SuperSU is popular app used to limit which apps can get root permission via the su binary. But depending on the way the device is rooted you can actually use root permission to remove SuperSU while leaving the binary that grants root in-tact.
This allows you to create a "backdoor" in which your "legitimate app" asks for root, then downloads an update and deletes SuperSU, allowing the payload (and any other apps) to get root access silently.
That doesn't mean that you can't catch most of the cases where a programme would do something like this. As they say, perfect is the enemy of good—in this case perfect is provably impossible, but that doesn't mean we shouldn't strive to find something that improves the current state. Google automatically scans all Play Store submissions for known malicious behaviour, they might be able to detect rowhammer exploits the same way.
It's a cute theorem, but it's more misleading than it is useful. Let's say we use a simple bytecode format for your programs. They can only open that dialog by having a call to the open-dialog function with a fixed parameter saying "VIRUS". We may not be able to say if an arbitrary program will run that call, but we can state with certainty whether it has that call. Such a program is either a virus or a virus decoy, and either way should be blocked.
We don't need to answer the question "Are we certain the program does X at runtime?". If we can answer "Does the program have an X-performing module?" that's good enough.
On android we can't answer that because the execution model is too powerful. But it's possible to make a practical app platform with the ability to answer that question.
How was I supposed to understand that someone was really asking if there's a way for an Android app to change its behavior at runtime when all mobile platforms have access to JavaScript...
you cant be serious, google is not paying 200K for developers to play with individual cases of consumer/dev support. You cant even get Human support from google when you make >$100K a month in adsense/YT.
https://play.google.com/store/apps/details?id=org.iseclab.dr...
You can see this reflected in the going rates for vulnerabilities, respectively. A remote iOS jailbreak can net you a cool 1.5 million, while Android goes for $200,000.http://arstechnica.com/security/2016/09/1-5-million-bounty-f...
Then there's the slight problem of rootless that makes it harder to do a permanent jailbreak, but getting root should be a pretty decent step along the way.
The app doesn't actually root the phone, as far as I can tell.
E.g. here's a 1977 databook from Mostek, at the time the premier DRAM manufacturer: https://archive.org/stream/bitsavers_mostekdataryProducts_17...
Look at these tests in particular:
Adjacent Row Disturb Refresh
Column Disturb
Pattern Sensitivity
Look at the details of the column disturb test:Column is written with an all ones data pattern an "0" is then written into row of the column 100 times followed by reading all other bits of the column and checking each bit for a logic "1" output. Row of the column is then rewritten to a "1" and the procedure is repeated for rows 1,2,3, ... 63 of the column under test. The entire procedure is then repeated for columns 1-63.
That particular test step is only repeated 100 times, because it's a production test and short test time is critical. You can bet that in design verification the chip was characterized a lot more thoroughly.
The downside of increasing memory sizes over the decades (now literally billions of bits in a single chip rather than thousands) is reduced design margins. So we get rowhammer.
You can bet that rowhammer did not come as any surprise to key engineers at the DRAM manufacturers. They just didn't take it very seriously as a possible real world problem, because the access patterns required to cause it are atypical from those of "normal" operation.
As you state, this type of problem is not new, and as noted at [1] e.g. Intel have taken this seriously on their Xeon lineup for a while.
It's a shame (LP)DDR4 standards did not make Target Row Refresh mandatory.
From the FAQ at [2]:
I have a phone with LPDDR4 memory. Am I safe against Drammer attacks? Again, we don’t know. Chances are that your DRAM comes with the Target Row Refresh (TRR) mitigation, which makes it harder – but still not impossible, in theory – to induce bit flips. Moreover, TRR for LPDDR4 is optional, so your DRAM manufacturer may have decided to drop this technique and leave you vulnerable.
[1] https://en.wikipedia.org/wiki/Row_hammer#Mitigation [2] https://www.vusec.net/projects/drammer/
I bet there are also plenty of others wondering whether it's actually a known backdoor that's been used secretly for a long time, and this is just an independent discovery since everyone else who knew about it were told to keep quiet...
All of which means that right now there are probably guys posting in an HN discussion thread on NSA's private comment site. They're saying something like: it's only clever because he's not a spook ... we've been doing this for the last decade. :)
...yeah...sometimes it happens that you are ignorant of the details of a topic...and learning more about it can feel magical...