[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <967b9ef1-fb36-48bf-9e6a-1b99af24c052@p183>
Date: Thu, 5 Oct 2023 19:34:21 +0300
From: Alexey Dobriyan <adobriyan@...il.com>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Jiri Slaby <jirislaby@...nel.org>
Cc: linux-serial@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: stack leak via uart_get_info() ?
If this check ever triggers
static int uart_get_info(struct tty_port *port, struct serial_struct *retinfo)
{
uport = uart_port_check(state);
if (!uport)
goto out;
then all those sysfs users will print stack contents to userspace.
Can it trigger while sysfs read is executing?
Signed-off-by: Alexey Dobriyan <adobriyan@...il.com>
---
--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
@@ -775,6 +775,8 @@ static int uart_get_info(struct tty_port *port, struct serial_struct *retinfo)
struct uart_port *uport;
int ret = -ENODEV;
+ *retinfo = (struct serial_struct){};
+
/*
* Ensure the state we copy is consistent and no hardware changes
* occur as we go
Powered by blists - more mailing lists