lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 24 Nov 2022 11:02:18 +0100
From:   Ricardo Ribalda <ribalda@...omium.org>
To:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Jiri Slaby <jirislaby@...nel.org>,
        Jonathan Corbet <corbet@....net>
Cc:     Ricardo Ribalda <ribalda@...omium.org>, linux-doc@...r.kernel.org,
        linux-serial@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH v2 1/2] earlycon: Replace simple_strtoul with kstrtouint

Baud rate is declared as unsigned integer. Use the right function.

Signed-off-by: Ricardo Ribalda <ribalda@...omium.org>

diff --git a/drivers/tty/serial/earlycon.c b/drivers/tty/serial/earlycon.c
index a5f380584cda..5b73da9487b1 100644
--- a/drivers/tty/serial/earlycon.c
+++ b/drivers/tty/serial/earlycon.c
@@ -120,7 +120,9 @@ static int __init parse_options(struct earlycon_device *device, char *options)
 	}
 
 	if (options) {
-		device->baud = simple_strtoul(options, NULL, 0);
+		if (kstrtouint(options, 0, &device->baud) < 0)
+			pr_warn("[%s] unsupported earlycon baud rate option\n",
+				options);
 		length = min(strcspn(options, " ") + 1,
 			     (size_t)(sizeof(device->options)));
 		strscpy(device->options, options, length);
@@ -303,7 +305,9 @@ int __init of_setup_earlycon(const struct earlycon_id *match,
 		port->uartclk = be32_to_cpu(*val);
 
 	if (options) {
-		early_console_dev.baud = simple_strtoul(options, NULL, 0);
+		if (kstrtouint(options, 0, &early_console_dev.baud) < 0)
+			pr_warn("[%s] unsupported earlycon baud rate options\n",
+				options);
 		strscpy(early_console_dev.options, options,
 			sizeof(early_console_dev.options));
 	}

-- 
b4 0.11.0-dev-d93f8

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ