xorl %eax, %eax

CVE-2010-3850: Linux kernel ECONET Missing Capability Check

with 2 comments

The third ECONET vulnerability Nelson Elhage released was this one. It’s important to note here that this is the most critical of the three bugs because as N. Elhage said:

CVE-2010-3850 is mostly interesting because without it, there is no way an
unprivileged user can trigger the first two bugs unless an administrator has
already configured an econet address somewhere (econet_sendmsg fails quickly if
there are no econet addresses configured on the system).

The bug is in the IOCTL handling routine of the discussed packet family.

/*
 *      Handle Econet specific ioctls
 */

static int ec_dev_ioctl(struct socket *sock, unsigned int cmd, void __user *arg)
{
        struct ifreq ifr;
        struct ec_device *edev;
        struct net_device *dev;
        struct sockaddr_ec *sec;
        int err;

        /*
         *      Fetch the caller's info block into kernel space
         */

        if (copy_from_user(&ifr, arg, sizeof(struct ifreq)))
                return -EFAULT;
    ...
        switch (cmd) {
        case SIOCSIFADDR:
                edev = dev->ec_ptr;
                if (edev == NULL) {
                        /* Magic up a new one. */
                        edev = kzalloc(sizeof(struct ec_device), GFP_KERNEL);
                        if (edev == NULL) {
                                err = -ENOMEM;
                                break;
                        }
                        dev->ec_ptr = edev;
                } else
                        net2dev_map[edev->net] = NULL;
                edev->station = sec->addr.station;
                edev->net = sec->addr.net;
                net2dev_map[sec->addr.net] = dev;
                if (!net2dev_map[0])
                        net2dev_map[0] = dev;
                break;
    ...
        return err;
}

There is no capability check on ‘SIOCSIFADDR’ IOCTL command allowing unprivileged users to make such calls. The patch was…

        case SIOCSIFADDR:
+               if (!capable(CAP_NET_ADMIN))
+                       return -EPERM;
+
                edev = dev->ec_ptr;

Written by xorl

December 1, 2010 at 07:45

Posted in linux, vulnerabilities

2 Responses

Subscribe to comments with RSS.

  1. i want to know hw i can use my econet email check .

    tatenda zveushe

    March 15, 2011 at 17:47

  2. I can’t help you with that.

    xorl

    March 15, 2011 at 23:00


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: