Module Name: src Committed By: martin Date: Thu Jan 2 09:43:56 UTC 2020
Modified Files: src/sys/dev/usb [netbsd-8]: ucycom.c uhid.c uthum.c Log Message: Pull up following revision(s) (requested by maxv in ticket #1480): sys/dev/usb/uthum.c: revision 1.18 sys/dev/usb/ucycom.c: revision 1.49 sys/dev/usb/uhid.c: revision 1.111 Fix buffer overflows. sc_{o,f}len are controlled by the USB device. By crafting the former the device can leak stack data. By crafting the latter the device can overwrite the stack. The combination of the two means the device can ROP the kernel and obtain code execution (demonstrated with an actual exploit over vHCI). Truncate the lengths to the size of the buffers, and also drop sc_ilen since it is unused. Patch tested with vHCI+kASan. - Fix buffer overflows. Also add missing mutex_exit. - Fix buffer overflows: validate the lengths at attach time, given that they are apparently not supposed to be variable. Drop sc_ilen since it is unused. To generate a diff of this commit: cvs rdiff -u -r1.45 -r1.45.8.1 src/sys/dev/usb/ucycom.c cvs rdiff -u -r1.99 -r1.99.6.1 src/sys/dev/usb/uhid.c cvs rdiff -u -r1.13 -r1.13.8.1 src/sys/dev/usb/uthum.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.