mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
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:2c43b5611fmaster date: 2026-04-07 13:54:19 +0200
This commit is contained in:
1 parent
f35f0ac0c8
commit
afb919ff6a
1 file changed
+3
@@ -1547,6 +1547,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);
|
||||
|
||||