Re: [linus:master] [serial] 43066e3222: BUG:kernel_NULL_pointer_dereference,address

From: Andy Shevchenko
Date: Thu Apr 04 2024 - 10:35:55 EST


On Thu, Apr 04, 2024 at 09:54:15AM +0300, Tony Lindgren wrote:
> * Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx> [240403 14:00]:
> > Probably we need to check if the port is still open...
> >
> > P.S. AFAIU the state / xmit is invalid pointer or so.
> >
> > Culprit line: serial_out(up, UART_TX, xmit->buf[xmit->tail]);
>
> Maybe we can set UPF_DEAD a bit earlier as below?

We should do this under port_mutex. Otherwise we replace one race by another.

--
With Best Regards,
Andy Shevchenko