diff options
| author | Zongmin Zhou <zhouzongmin@kylinos.cn> | 2026-08-27 09:45:24 +0800 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2026-09-23 14:58:06 +0200 |
| commit | bf961847813d9edcb5a9c089714069428d141fa9 (patch) | |
| tree | dd5e46729bded87c4240feb79cfe5ba28164b5fa /tools/perf/scripts/python/stackcollapse.py | |
| parent | 857f31656f352c4e290122c0a216b9dc74224f3d (diff) | |
| download | linux-next-bf961847813d9edcb5a9c089714069428d141fa9.tar.gz linux-next-bf961847813d9edcb5a9c089714069428d141fa9.zip | |
serial: sifive: fix off-by-one in console port bounds check
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].
Fix the check to use >= instead, matching the check already used in
sifive_serial_console_setup().
Fixes: 45c054d0815b ("tty: serial: add driver for the SiFive UART")
Signed-off-by: Zongmin Zhou <zhouzongmin@kylinos.cn>
Link: https://patch.msgid.link/20260827014524.19375-1-min_halo@163.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools/perf/scripts/python/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions
