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]
Message-Id: <20220629000232.3440704-3-jeremy.linton@arm.com>
Date:   Tue, 28 Jun 2022 19:02:32 -0500
From:   Jeremy Linton <jeremy.linton@....com>
To:     linux-serial@...r.kernel.org
Cc:     andriy.shevchenko@...ux.intel.com, gregkh@...uxfoundation.org,
        jirislaby@...nel.org, miquel.raynal@...tlin.com,
        phil.edworthy@...esas.com, kernel@...il.dk,
        linux-kernel@...r.kernel.org, Jeremy Linton <jeremy.linton@....com>
Subject: [PATCH 2/2] serial: 8250: dw: Fix NULL pointer dereference

Similarly to e6a08c6949cb, ACPI machines don't have
a pdata setup, leading to a null pointer dereference
when dw8250_handle_irq runs.

Fixes: aa63d786cea2 ("serial: 8250: dw: Add support for DMA flow controlling devices")
Signed-off-by: Jeremy Linton <jeremy.linton@....com>
---
 drivers/tty/serial/8250/8250_dw.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c
index 53e488beb8c2..06f80090cbb9 100644
--- a/drivers/tty/serial/8250/8250_dw.c
+++ b/drivers/tty/serial/8250/8250_dw.c
@@ -237,10 +237,13 @@ static int dw8250_handle_irq(struct uart_port *p)
 	struct dw8250_data *d = to_dw8250_data(p->private_data);
 	unsigned int iir = p->serial_in(p, UART_IIR);
 	bool rx_timeout = (iir & 0x3f) == UART_IIR_RX_TIMEOUT;
-	unsigned int quirks = d->pdata->quirks;
+	unsigned int quirks = 0;
 	unsigned int status;
 	unsigned long flags;
 
+	if (d->pdata)
+		quirks = d->pdata->quirks;
+
 	/*
 	 * There are ways to get Designware-based UARTs into a state where
 	 * they are asserting UART_IIR_RX_TIMEOUT but there is no actual
-- 
2.35.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ