В ядре Linux устранена следующая уязвимость: net: usb: pegasus: don't advance rx_skb->data on droped frames Для чипа 0x8513 read_bulk_callback() пропускает 2-байтовый заголовок receive, продвигая pegasus->rx_skb->data на место. Это делается до проверки pkt_len > PEGASUS_MTU, и когда эта проверка падает, хороший путь повторно отправляет тот же skb с расширенным rx_skb->data в качестве буфера передачи, все еще PEGASUS_MTU байтов длиной. Таким образом, каждый кадр с полем негабаритной длины перемещает буфер приема на два байта ближе к концу области данных skb.
Устройство, которое продолжает отправлять такие кадры, заставляет контроллер хоста записывать полученные данные через skb_shared_info и после окончания выделения, а поврежденный skb_shared_info используется, когда skb в конечном итоге освобождается. С эмулируемым устройством, отправляющим кадры, заполненные 0x5a на ядре KASAN: BUG: KASAN: slab-out-of-bounds в dummy_timer+0xade/0x3f00 [dummy_hcd] Write размера 1536 в addr ffff888105821202 по задаче swapper/1/0 ... Упс: общая ошибка защиты, вероятно, для неканонического адреса 0xeb4b474b4b4b4b4c: 0000 [1] PREEMPT SMP KASAN NOPTI KASAN: возможно, wild-memory-access в диапазоне [0x5a5a5a5a5a5a60-0x5a5a5a5a5a67] RIP: 0010:skb_release_data+0x36f/0x800 Only пропускает начало заголовка с skb_reserve() В отличие от старой настройки указателя, skb_reserve() также перемещает skb->tail, поэтому два байта заголовка теперь учитываются по отношению к размеру буфера: соответственно, понизьте предел длины для 0x8513, в противном случае pkt_len PEGASUS_MTU - 1 или PEGASUS_MTU переключится на skb_over_panic().
Найден путем обзора кода с помощью LLM и воспроизведен с эмулируемым устройством USB (raw-гаджет + dummy_hcd).
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: net: usb: pegasus: do not advance rx_skb->data on dropped frames For the 0x8513 chip, read_bulk_callback() skips the 2-byte receive header by advancing pegasus->rx_skb->data in place. This is done before the pkt_len > PEGASUS_MTU check, and when that check drops the frame the good path resubmits the same skb with the advanced rx_skb->data as the transfer buffer, still PEGASUS_MTU bytes long. Every frame with an oversized length field therefore moves the receive buffer two more bytes towards the end of the skb data area. A device that keeps sending such frames makes the host controller write received data over skb_shared_info and past the end of the allocation, and the corrupted skb_shared_info is used when the skb is eventually freed. With an emulated device sending frames filled with 0x5a on a KASAN kernel: BUG: KASAN: slab-out-of-bounds in dummy_timer+0xade/0x3f00 [dummy_hcd] Write of size 1536 at addr ffff888105821202 by task swapper/1/0 ... Oops: general protection fault, probably for non-canonical address 0xeb4b474b4b4b4b4c: 0000 [#1] PREEMPT SMP KASAN NOPTI KASAN: maybe wild-memory-access in range [0x5a5a5a5a5a5a5a60-0x5a5a5a5a5a5a5a67] RIP: 0010:skb_release_data+0x36f/0x800 Only skip the header with skb_reserve() once the frame is going to be passed up, so the receive buffer always starts at the beginning of the skb data area. Unlike the old pointer adjustment, skb_reserve() also moves skb->tail, so the two header bytes now count against the buffer size: lower the length limit for the 0x8513 accordingly, otherwise a pkt_len of PEGASUS_MTU - 1 or PEGASUS_MTU would trip skb_over_panic(). Found by code review with LLM assistance and reproduced with an emulated USB device (raw-gadget + dummy_hcd).