[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <cab75c988650043a88035799f5ca18b8549eb0a4.1468483951.git.jslaby@suse.cz>
Date: Thu, 14 Jul 2016 10:15:49 +0200
From: Jiri Slaby <jslaby@...e.cz>
To: stable@...r.kernel.org
Cc: linux-kernel@...r.kernel.org,
Alan Stern <stern@...land.harvard.edu>,
Jiri Slaby <jslaby@...e.cz>
Subject: [PATCH 3.12 57/88] USB: EHCI: declare hostpc register as zero-length array
From: Alan Stern <stern@...land.harvard.edu>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 7e8b3dfef16375dbfeb1f36a83eb9f27117c51fd upstream.
The HOSTPC extension registers found in some EHCI implementations form
a variable-length array, with one element for each port. Therefore
the hostpc field in struct ehci_regs should be declared as a
zero-length array, not a single-element array.
This fixes a problem reported by UBSAN.
Signed-off-by: Alan Stern <stern@...land.harvard.edu>
Reported-by: Wilfried Klaebe <linux-kernel@...enslange-mailadresse.de>
Tested-by: Wilfried Klaebe <linux-kernel@...enslange-mailadresse.de>
Signed-off-by: Jiri Slaby <jslaby@...e.cz>
---
include/linux/usb/ehci_def.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/linux/usb/ehci_def.h b/include/linux/usb/ehci_def.h
index daec99af5d54..1c88b177cb9c 100644
--- a/include/linux/usb/ehci_def.h
+++ b/include/linux/usb/ehci_def.h
@@ -178,11 +178,11 @@ struct ehci_regs {
* PORTSCx
*/
/* HOSTPC: offset 0x84 */
- u32 hostpc[1]; /* HOSTPC extension */
+ u32 hostpc[0]; /* HOSTPC extension */
#define HOSTPC_PHCD (1<<22) /* Phy clock disable */
#define HOSTPC_PSPD (3<<25) /* Port speed detection */
- u32 reserved5[16];
+ u32 reserved5[17];
/* USBMODE_EX: offset 0xc8 */
u32 usbmode_ex; /* USB Device mode extension */
--
2.9.1
Powered by blists - more mailing lists