提交 0b818e39 编写于 作者: O Oliver Neukum 提交者: Greg Kroah-Hartman

USB: usb_driver_claim_interface: add sanity checking

Attacks that trick drivers into passing a NULL pointer
to usb_driver_claim_interface() using forged descriptors are
known. This thwarts them by sanity checking.
Signed-off-by: NOliver Neukum <ONeukum@suse.com>
CC: stable@vger.kernel.org
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 7222c832
......@@ -502,11 +502,15 @@ static int usb_unbind_interface(struct device *dev)
int usb_driver_claim_interface(struct usb_driver *driver,
struct usb_interface *iface, void *priv)
{
struct device *dev = &iface->dev;
struct device *dev;
struct usb_device *udev;
int retval = 0;
int lpm_disable_error;
if (!iface)
return -ENODEV;
dev = &iface->dev;
if (dev->driver)
return -EBUSY;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册