Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

USB: isight: fix kernel bug when loading firmware

We were sending data on the stack when uploading firmware, which causes
some machines fits, and is not allowed. Fix this by using the buffer we
already had around for this very purpose.

Reported-by: Wouter M. Koolen <wmkoolen@cwi.nl>
Tested-by: Wouter M. Koolen <wmkoolen@cwi.nl>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

+4 -2
+4 -2
drivers/usb/misc/isight_firmware.c
··· 55 55 56 56 ptr = firmware->data; 57 57 58 + buf[0] = 0x01; 58 59 if (usb_control_msg 59 - (dev, usb_sndctrlpipe(dev, 0), 0xa0, 0x40, 0xe600, 0, "\1", 1, 60 + (dev, usb_sndctrlpipe(dev, 0), 0xa0, 0x40, 0xe600, 0, buf, 1, 60 61 300) != 1) { 61 62 printk(KERN_ERR 62 63 "Failed to initialise isight firmware loader\n"); ··· 101 100 } 102 101 } 103 102 103 + buf[0] = 0x00; 104 104 if (usb_control_msg 105 - (dev, usb_sndctrlpipe(dev, 0), 0xa0, 0x40, 0xe600, 0, "\0", 1, 105 + (dev, usb_sndctrlpipe(dev, 0), 0xa0, 0x40, 0xe600, 0, buf, 1, 106 106 300) != 1) { 107 107 printk(KERN_ERR "isight firmware loading completion failed\n"); 108 108 ret = -ENODEV;