Linux Serial subsystem development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Hugo Villeneuve" <hugo@hugovil.com>
Cc: linux-serial@vger.kernel.org
Subject: Re: [PATCH 1/5] serial: core: fix division by zero if old termios is present but has invalid rate
Date: Tue, 20 Oct 2026 18:51:59 +0000	[thread overview]
Message-ID: <sashiko-outbox-179496@kernel.org> (raw)
In-Reply-To: <20261020184131.2893575-2-hugo@hugovil.com>

> From: Hugo Villeneuve <hvilleneuve@dimonoff.com>
> 
> If the old baud rate termios is present, it is implicitely assumed to be
> valid. However, if base_baud is lowered via TIOCSSERIAL, and the new
> max value is lower than the old baud rate, the later will become invalid,
> and uart_get_baud_rate() loop will exit, and return a baud rate of zero,
> causing this:
> 
>   WARNING: drivers/tty/serial/serial_core.c:547 at
>     uart_get_baud_rate+0x104/0x180, CPU#0: uart_baud_test/782
>   ...
>   Division by zero in kernel.
>   CPU: 0 UID: 0 PID: 782 Comm: uart_baud_test Tainted... 7.3.0-rc6-...
>   Tainted: [W]=WARN
>   Hardware name: Freescale i.MX6 Ultralite (Device Tree)
> [ ... ]
> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
> Cc: stable@vger.kernel.org
> Reported-by: Hui Peng <benquike@gmail.com>
> Link: https://lore.kernel.org/all/20260930125901.778868-1-benquike@gmail.com/
> Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261020184131.2893575-1-hugo@hugovil.com?part=1


  reply	other threads:[~2026-10-20 18:52 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-20 18:41 [PATCH 0/5] serial: core: fixes and improvements to uart_get_baud_rate() Hugo Villeneuve
2026-10-20 18:41 ` [PATCH 1/5] serial: core: fix division by zero if old termios is present but has invalid rate Hugo Villeneuve
2026-10-20 18:51   ` sashiko-bot [this message]
2026-10-20 18:41 ` [PATCH 2/5] serial: core: clip out-of-range baud rate to min/max, not min+1/max-1 Hugo Villeneuve
2026-10-20 18:49   ` sashiko-bot
2026-10-20 18:41 ` [PATCH 3/5] serial: core: always return in-range baud rate even in case of failure Hugo Villeneuve
2026-10-20 18:57   ` sashiko-bot
2026-10-20 18:41 ` [PATCH 4/5] serial: core: avoid redundant baud assignment without any UPF_SPD_* flags Hugo Villeneuve
2026-10-20 18:45   ` sashiko-bot
2026-10-20 18:41 ` [PATCH 5/5] serial: core: refactor uart_get_baud_rate() for readability Hugo Villeneuve
2026-10-20 18:51   ` sashiko-bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=sashiko-outbox-179496@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=hugo@hugovil.com \
    --cc=linux-serial@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox