Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

serial: initialize retinfo in 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.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Link: https://lore.kernel.org/r/967b9ef1-fb36-48bf-9e6a-1b99af24c052@p183
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Alexey Dobriyan and committed by
Greg Kroah-Hartman
cfb5e0ce 1f34e3de

+3
+3
drivers/tty/serial/serial_core.c
··· 775 775 struct uart_port *uport; 776 776 int ret = -ENODEV; 777 777 778 + /* Initialize structure in case we error out later to prevent any stack info leakage. */ 779 + *retinfo = (struct serial_struct){}; 780 + 778 781 /* 779 782 * Ensure the state we copy is consistent and no hardware changes 780 783 * occur as we go