Skip to content

serial: fix IRQ chain race, baud fallback, and uartclk overflow

Hui Peng linux-serial lkml stable 5 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v6 Latest3 patches 2 repliesIn review
  2. v53 patches 2 repliesSuperseded
  3. v43 patches 3 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v33 patches1 replySuperseded
v23 patches2 repliesSuperseded

Changes in v6 from the cover letter

- Use check_mul_overflow() in patch 3/3 as suggested by Jiri Slaby.

Patches in v6 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3serial: 8250: fix deadlock in serial8250_register_ports()drivers/tty/serial/8250/8250_core.c+1 -12 replies
2/3serial: core: fix baud rate fallback in uart_get_baud_rate()drivers/tty/serial/serial_core.c+3 -00 replies
3/3serial: core: reject baud_base values that overflow port->uartclk in uart_set_info()drivers/tty/serial/serial_core.c+1 -50 replies

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchIlpo Järvinen
1/3R-b
2/3R-b
3/3R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v6 thread

Cover letter [PATCH v6 0/3] serial: fix IRQ chain race, baud fallback, and uartclk overflow

This series addresses three concurrency and integer overflow issues in the serial driver core and 8250 driver:

1. Fix a mutex vs spinlock deadlock in serial8250_register_ports() during IRQ chain setup.
2. Fix baud rate fallback in uart_get_baud_rate() when custom divisor is in use.
3. Replace manual baud_base overflow check in uart_set_info() with check_mul_overflow(new_info->baud_base, 16, &uartclk), preventing 32-bit unsigned arithmetic wraparound.

All 3 patches have been ported to the latest tip of mainline (551c722f4080) and dynamically verified in QEMU KVM with CONFIG_KASAN=y.

Changes in v6:
- Use check_mul_overflow() in patch 3/3 as suggested by Jiri Slaby.

Hui Peng (3):
serial: 8250: fix deadlock in serial8250_register_ports()
serial: core: fix baud rate fallback in uart_get_baud_rate()
serial: core: reject baud_base values that overflow port->uartclk in

    uart_set_info()
 drivers/tty/serial/8250/8250_core.c |  4 ++--
 drivers/tty/serial/serial_core.c    | 12 +++++++++---
 2 files changed, 11 insertions(+), 5 deletions(-)
Signature · 1 line
2.47.3