[lvc-project] [PATCH] usb: serial: ti_usb_3410_5052: Add NULL check for read_urb in ti_open()
Johan Hovold
johan at kernel.org
Thu Apr 24 10:25:17 MSK 2025
On Tue, Apr 22, 2025 at 11:51:40PM +0300, Alexei Safin wrote:
> Avoid dereferencing port->read_urb when it is NULL, which may happen if
> usb_alloc_urb() fails or initialization of usb_serial_port is incomplete.
>
> Dereferencing a NULL pointer in ti_open() leads to a kernel crash.
> This condition was detected by a static analyzer, but can also occur
> in practice if memory allocation fails in probe path or if the driver
> is incorrectly initialized by a faulty device descriptor.
No, this can't happen as probe would abort on allocation failures and
the malicious descriptor case was fixed 8 years ago by commit
ef079936d3cd ("USB: serial: ti_usb_3410_5052: fix NULL-deref at open").
Johan
More information about the lvc-project
mailing list