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 for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Date:	Wed, 12 Aug 2015 15:22:05 +0800
From:	Su Kang Yin <cantona@...tona.net>
To:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:	Jiri Slaby <jslaby@...e.com>, linux-serial@...r.kernel.org,
	linux-kernel@...r.kernel.org, Su Kang Yin <cantona@...tona.net>
Subject: [PATCH v2] serial: max310x: Fix out of bounds access

Max310x driver supports up to 4 UART devices but array size of
"struct max310x_one" is set to 1. That leads to out of bounds
access on UART port registration.

This patch fixed it by increase the array size to 4 which is
maximum supported UART.

Signed-off-by: Su Kang Yin <cantona@...tona.net>
---
v2: add Signed-off-by: line.

 drivers/tty/serial/max310x.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/tty/serial/max310x.c b/drivers/tty/serial/max310x.c
index 182549f..b523552 100644
--- a/drivers/tty/serial/max310x.c
+++ b/drivers/tty/serial/max310x.c
@@ -33,6 +33,9 @@
 #define MAX310X_MAJOR			204
 #define MAX310X_MINOR			209
 
+/* Maximum supported device */
+#define MAX_DEVICE			4
+
 /* MAX310X register definitions */
 #define MAX310X_RHR_REG			(0x00) /* RX FIFO */
 #define MAX310X_THR_REG			(0x00) /* TX FIFO */
@@ -273,7 +276,7 @@ struct max310x_port {
 #ifdef CONFIG_GPIOLIB
 	struct gpio_chip	gpio;
 #endif
-	struct max310x_one	p[0];
+	struct max310x_one	p[MAX_DEVICE];
 };
 
 static u8 max310x_port_read(struct uart_port *port, u8 reg)
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ