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>] [day] [month] [year] [list]
Message-Id: <20160818135555.271642540@linuxfoundation.org>
Date:	Thu, 18 Aug 2016 15:57:02 +0200
From:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To:	linux-kernel@...r.kernel.org
Cc:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	stable@...r.kernel.org, Ivan Ivanov <iivanov.xz@...il.com>,
	Frank Rowand <frowand.list@...il.com>,
	Nicolas Dechesne <nicolas.dechesne@...aro.org>,
	Bjorn Andersson <bjorn.andersson@...aro.org>,
	Andy Gross <andy.gross@...aro.org>,
	Frank Rowand <frank.rowand@...sony.com>,
	Stephen Boyd <sboyd@...eaurora.org>
Subject: [PATCH 4.4 012/138] tty: serial: msm: Dont read off end of tx fifo

4.4-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Bjorn Andersson <bjorn.andersson@...aro.org>

commit 30acf549ca1e81859a67590ab9ecfce3d1050a0b upstream.

For dm uarts in pio mode tx data is transferred to the fifo register 4
bytes at a time, but care is not taken when these 4 bytes spans the end
of the xmit buffer so the loop might read up to 3 bytes past the buffer
and then skip the actual data at the beginning of the buffer.

Fix this by, analogous to the DMA case, make sure the chunk doesn't
wrap the xmit buffer.

Fixes: 3a878c430fd6 ("tty: serial: msm: Add TX DMA support")
Cc: Ivan Ivanov <iivanov.xz@...il.com>
Reported-by: Frank Rowand <frowand.list@...il.com>
Reported-by: Nicolas Dechesne <nicolas.dechesne@...aro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@...aro.org>
Acked-by: Andy Gross <andy.gross@...aro.org>
Tested-by: Frank Rowand <frank.rowand@...sony.com>
Reviewed-by: Stephen Boyd <sboyd@...eaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>

---
 drivers/tty/serial/msm_serial.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/tty/serial/msm_serial.c
+++ b/drivers/tty/serial/msm_serial.c
@@ -726,7 +726,7 @@ static void msm_handle_tx(struct uart_po
 		return;
 	}
 
-	pio_count = CIRC_CNT(xmit->head, xmit->tail, UART_XMIT_SIZE);
+	pio_count = CIRC_CNT_TO_END(xmit->head, xmit->tail, UART_XMIT_SIZE);
 	dma_count = CIRC_CNT_TO_END(xmit->head, xmit->tail, UART_XMIT_SIZE);
 
 	dma_min = 1;	/* Always DMA */


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ