[PATCH] serial: sifive: fix off-by-one in console port bounds check

patchwork-bot+linux-riscv at kernel.org patchwork-bot+linux-riscv at kernel.org
Sun Nov 1 14:16:22 PST 2026


Hello:

This patch was applied to riscv/linux.git (fixes)
by Greg Kroah-Hartman <gregkh at linuxfoundation.org>:

On Thu, 27 Aug 2026 09:45:24 +0800 you wrote:
> From: Zongmin Zhou <zhouzongmin at kylinos.cn>
> 
> sifive_serial_console_ports[] is sized SIFIVE_SERIAL_MAX_PORTS (8), so
> valid indices are 0..7. The bounds check in sifive_serial_probe() uses
> "id > SIFIVE_SERIAL_MAX_PORTS", which lets id == 8 pass and causes an
> out-of-bounds write in __ssp_add_console_port() through
> sifive_serial_console_ports[ssp->port.line].
> 
> [...]

Here is the summary with links:
  - serial: sifive: fix off-by-one in console port bounds check
    https://git.kernel.org/riscv/c/bf961847813d

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html





More information about the linux-riscv mailing list