ns16550: harden positional parsing

Advancing past a character without knowing whether that's the NUL char is
at risk of reading beyond the buffer.

Fixes: 25de1f6920 ("Allow arch-specific defaults to be specified for ns16550")
Reported-by: Kamil Frankowicz <kamil.frankowicz@cert.pl>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
master commit: 2c43b5611f
master date: 2026-04-07 13:54:19 +0200
This commit is contained in:
Jan Beulich committed 2026-04-20 12:36:19 +02:00
1 parent 928144f39f
commit 491f6618b5
1 file changed
+3
+3
View File
@@ -1529,6 +1529,9 @@ static bool __init parse_positional(struct ns16550 *uart, char **str)
{
uart->data_bits = simple_strtoul(conf, &conf, 10);
if ( !*conf )
PARSE_ERR_RET("bad DPS setting");
uart->parity = parse_parity_char(*conf);
uart->stop_bits = simple_strtoul(conf + 1, &conf, 10);
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.