В ядре Linux устранена следующая уязвимость:
wan: wanxl: аппаратный сброс производится только после сопоставления BAR.
wanxl_pci_init_one() сохраняет только что выделенную карту в данных драйвера.
до отображения PLX BAR. Несколько ранних неудачных зондов затем прекратились
через wanxl_pci_remove_one(), включая неспособность выделить когерентный
область состояния или восстановить маску DMA.
wanxl_pci_remove_one() безоговорочно вызывает wanxl_reset() и
wanxl_reset() разыменовывает card->plx. Об этих ранних неудачах card->plx
по-прежнему имеет значение NULL, поэтому путь ошибки может разыменовывать NULL-указатель MMIO.
Выполняйте аппаратный сброс только после создания сопоставления BAR. Остальные
очистка в wanxl_pci_remove_one() уже проверяет, будут ли более поздние ресурсы
были выделены. Эта проблема была обнаружена средством проверки статического анализа и подтверждена
проверка источника вручную.
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: wan: wanxl: Only reset hardware after BAR mapping wanxl_pci_init_one() stores the freshly allocated card in driver data before the PLX BAR is mapped. Several early probe failures then unwind through wanxl_pci_remove_one(), including failure to allocate the coherent status area or to restore the DMA mask. wanxl_pci_remove_one() unconditionally calls wanxl_reset(), and wanxl_reset() dereferences card->plx. On those early failures card->plx is still NULL, so the error path can dereference a NULL MMIO pointer. Only issue the hardware reset once the BAR mapping exists. The remaining cleanup in wanxl_pci_remove_one() already checks whether later resources were allocated. This issue was found by a static analysis checker and confirmed by manual source review.