First published: Thu Aug 05 2010(Updated: )
Description of problem: There is a problem with the ioctl subsystem for drm, though it is most explicitly exposed by the intel GEM driver. Under driver-defined ioctls, drm does not sanitize the ioctl command, allowing the caller to specify how much memory should be kmalloc'd and copied back to the caller, regardless of what the driver ioctl actually does (it doesn't even need to succeed). drivers/gpu/drm/drm_drv.c long drm_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) ... unsigned int nr = DRM_IOCTL_NR(cmd); ... if ((nr >= DRM_COMMAND_BASE) && (nr < DRM_COMMAND_END) && (nr < DRM_COMMAND_BASE + dev->driver->num_ioctls)) ioctl = &dev->driver->ioctls[nr - DRM_COMMAND_BASE]; ... if (cmd & (IOC_IN | IOC_OUT)) { if (_IOC_SIZE(cmd) <= sizeof(stack_kdata)) { kdata = stack_kdata; } else { kdata = kmalloc(_IOC_SIZE(cmd), GFP_KERNEL); ... } } ... retcode = func(dev, kdata, file_priv); ... if (cmd & IOC_OUT) { if (copy_to_user((void __user *)arg, kdata, _IOC_SIZE(cmd)) != 0) retcode = -EFAULT; } "cmd" is caller-controlled, and can do whatever it likes for _IOC_SIZE(cmd), IOC_IN and IOC_OUT, resulting in leakage of previously freed kernel heap memory contents up to 16K in size.
Credit: secalert@redhat.com secalert@redhat.com
Affected Software | Affected Version | How to fix |
---|---|---|
debian/linux-2.6 | ||
Linux Linux kernel | <2.6.27.53 | |
Linux Linux kernel | >=2.6.32<2.6.32.21 | |
Linux Linux kernel | >=2.6.34<2.6.34.6 | |
Linux Linux kernel | >=2.6.35<2.6.35.4 | |
Debian Debian Linux | =5.0 | |
openSUSE openSUSE | =11.1 | |
openSUSE openSUSE | =11.3 | |
SUSE Linux Enterprise Desktop | =11-sp1 | |
Suse Linux Enterprise High Availability Extension | =11-sp1 | |
Suse Linux Enterprise Real Time | =11-sp1 | |
SUSE Linux Enterprise Server | =11-sp1 |
Sign up to SecAlerts for real-time vulnerability data matched to your software, aggregated from hundreds of sources.