|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [xen master] ns16550: harden positional parsing
commit 2c43b5611ffbe35611dd391c949f7cb15e1b29e7
Author: Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Tue Apr 7 13:54:19 2026 +0200
Commit: Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Tue Apr 7 13:54:19 2026 +0200
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: 25de1f692059 ("Allow arch-specific defaults to be specified for
ns16550")
Reported-by: Kamil Frankowicz <kamil.frankowicz@xxxxxxx>
Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
Acked-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
xen/drivers/char/ns16550.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/xen/drivers/char/ns16550.c b/xen/drivers/char/ns16550.c
index 0339d321bd..a17a87de31 100644
--- a/xen/drivers/char/ns16550.c
+++ b/xen/drivers/char/ns16550.c
@@ -1518,6 +1518,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);
--
generated by git-patchbot for /home/xen/git/xen.git#master
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |