[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <4be800b2-1c2b-4803-9cac-f3d0928a5975@omp.ru>
Date: Sat, 20 Sep 2025 11:56:29 +0300
From: Sergey Shtylyov <s.shtylyov@....ru>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>, Jiri Slaby
<jirislaby@...nel.org>, Matthias Brugger <matthias.bgg@...il.com>,
AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>,
<linux-serial@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] serial: 8250_mtk: correct max baud rate in the
set_termios() method
On 9/5/25 11:07 PM, Sergey Shtylyov wrote:
> As is obvious from the code calculating the divisor in the set_termios()
> method, the Mediatek UART driver uses 256-time oversampling for the high
> baud rates, so passing port->uartclk to uart_get_baud_rate() for the max
> acceptable baud rate makes no sense, we should divide by 256 first (this
Well, I thought again and 256 seems to be an overkill, I should probably
have reverted to division by 16 instead...
> should also prevent overflow when some arbitrary baud rate is passed via
> termios->c_ospeed)...
>
> Found by Linux Verification Center (linuxtesting.org) with the Svace static
> analysis tool.
>
> Fixes: 81bb549fdf14 ("serial: 8250_mtk: support big baud rate.")
> Signed-off-by: Sergey Shtylyov <s.shtylyov@....ru>
[...]
MBR, Sergey
Powered by blists - more mailing lists