In USB Gadget, a subsystem of the Linux kernel that provides a software interface for creating client USB devices and simulating USB devices, a vulnerability has been discovered (CVE-2021-39685) that could lead to information leakage from the kernel, crashes, or arbitrary code execution at the kernel level. The attack is carried out by an unprivileged local user through manipulation of various device classes implemented based on the USB Gadget API, such as rndis, hid, uac1, uac1_legacy, and uac2.
The issue has been resolved in the recently published updates of the Linux kernel 5.15.8, 5.10.85, 5.4.165, 4.19.221, 4.14.258, 4.9.293, and 4.4.295. However, the problem remains unfixed in distributions (Debian, Ubuntu, RHEL, SUSE, Fedora, Arch). A prototype exploit has been prepared to demonstrate the vulnerability.
Il problema è causato da un overflow del buffer nei gestori delle richieste di trasferimento dati nei driver gadget rndis, hid, uac1, uac1_legacy e uac2. A seguito dello sfruttamento di questa vulnerabilità, un attaccante non privilegiato potrebbe accedere alla memoria del kernel inviando una richiesta di controllo speciale con un valore del campo wLength che supera la dimensione di un buffer statico, per il quale vengono sempre allocati 4096 byte (USB_COMP_EP0_BUFSIZ). Durante l'attacco è possibile leggere o scrivere fino a 65 KB di dati nella memoria del kernel da un processo non privilegiato nello spazio utente.
Fonte: opennet.ru
