Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
hw: usb: hcd-ohci: check len and frame_number variables
While servicing the OHCI transfer descriptors(TD), OHCI host controller derives variables 'start_addr', 'end_addr', 'len' etc. from values supplied by the host controller driver. Host controller driver may supply values such that using above variables leads to out-of-bounds access issues. Add checks to avoid them. AddressSanitizer: stack-buffer-overflow on address 0x7ffd53af76a0 READ of size 2 at 0x7ffd53af76a0 thread T0 #0 ohci_service_iso_td ../hw/usb/hcd-ohci.c:734 #1 ohci_service_ed_list ../hw/usb/hcd-ohci.c:1180 #2 ohci_process_lists ../hw/usb/hcd-ohci.c:1214 qemu#3 ohci_frame_boundary ../hw/usb/hcd-ohci.c:1257 qemu#4 timerlist_run_timers ../util/qemu-timer.c:572 qemu#5 qemu_clock_run_timers ../util/qemu-timer.c:586 qemu#6 qemu_clock_run_all_timers ../util/qemu-timer.c:672 qemu#7 main_loop_wait ../util/main-loop.c:527 qemu#8 qemu_main_loop ../softmmu/vl.c:1676 qemu#9 main ../softmmu/main.c:50 Reported-by: Gaoning Pan <[email protected]> Reported-by: Yongkang Jia <[email protected]> Reported-by: Yi Ren <[email protected]> Signed-off-by: Prasad J Pandit <[email protected]> Message-id: [email protected] Signed-off-by: Gerd Hoffmann <[email protected]>
- Loading branch information