3.14.78-stable review
Subsystems (4)
Greg Kroah-Hartman
maintainercover 3.14.78-stable review
This is the start of the stable review cycle for the 3.14.78 release. There are 35 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed Sep 7 16:39:50 UTC 2016. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
kernel.org/pub/linux/kernel/v3.x/stable-review/patch-3.14.78-rc1.gz
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-3.14.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <[email protected]>
Linux 3.14.78-rc1
Dan Carpenter <[email protected]>
ACPI / sysfs: fix error code in get_status()
Ian Abbott <[email protected]>
staging: comedi: daqboard2000: bug fix board type matching code
Alexey Khoroshilov <[email protected]>
USB: serial: mos7840: fix non-atomic allocation in write path
Alexey Khoroshilov <[email protected]>
USB: serial: mos7720: fix non-atomic allocation in write path
Alan Stern <[email protected]>
USB: fix typo in wMaxPacketSize validation
Dan Carpenter <[email protected]>
crypto: nx - off by one bug in nx_of_update_msc()
Dmitry Torokhov <[email protected]>
Input: i8042 - set up shared ps2_cmd_mutex for AUX ports
Dmitry Torokhov <[email protected]>
Input: i8042 - break load dependency between atkbd/psmouse and i8042
Masahiro Yamada <[email protected]>
Input: tegra-kbc - fix inverted reset logic
Vegard Nossum <[email protected]>
fs/seq_file: fix out-of-bounds read
Linus Walleij <[email protected]>
gpio: Fix OF build problem on UM
Yinghai Lu <[email protected]>
megaraid_sas: Fix probing cards without io port
Gavin Li <[email protected]>
cdc-acm: fix wrong pipe type on rx interrupt xfers
Dave Carroll <[email protected]>
aacraid: Check size values after double-fetch from user
Felix Fietkau <[email protected]>
mac80211: fix purging multicast PS buffer queue
Stefan Haberland <[email protected]>
s390/dasd: fix hanging device after clear subchannel
Emmanouil Maroudas <[email protected]>
EDAC: Increment correct counter in edac_inc_ue_error()
Mathias Nyman <[email protected]>
xhci: Make sure xhci handles USB_SPEED_SUPER_PLUS devices.
Robert Deliën <[email protected]>
USB: serial: ftdi_sio: add PIDs for Ivium Technologies devices
Sheng-Hui J. Chu <[email protected]>
USB: serial: ftdi_sio: add device ID for WICED USB UART dev board
Daniele Palmas <[email protected]>
USB: serial: option: add support for Telit LE920A4
Lubomir Rintel <[email protected]>
USB: serial: option: add D-Link DWM-156/A3
Alexey Klimov <[email protected]>
USB: serial: fix memleak in driver-registration error path
Jim Lin <[email protected]>
usb: xhci: Fix panic if disconnect
Alan Stern <[email protected]>
USB: validate wMaxPacketValue entries in endpoint descriptors
Mathias Nyman <[email protected]>
usb: define USB_SPEED_SUPER_PLUS speed for SuperSpeedPlus USB3.1 devices
Felipe Balbi <[email protected]>
usb: dwc3: gadget: increment request->actual once
Simon Horman <[email protected]>
PCI: Limit config space size for Netronome NFP4000
Simon Horman <[email protected]>
PCI: Add Netronome NFP4000 PF device ID
Jason S. McMullan <[email protected]>
PCI: Limit config space size for Netronome NFP6000 family
Jason S. McMullan <[email protected]>
PCI: Add Netronome vendor and device IDs
Jason S. McMullan <[email protected]>
PCI: Support PCIe devices with short cfg_size
Helge Deller <[email protected]>
parisc: Fix order of EREFUSED define in errno.h
James Hogan <[email protected]>
arm64: Define AT_VECTOR_SIZE_ARCH for ARCH_DLINFO
Sebastian Andrzej Siewior <[email protected]>
x86/mm: Disable preemption during CR3 read+write
-------------
Diffstat:
Makefile | 4 +- arch/arm64/include/asm/elf.h | 1 + arch/arm64/include/uapi/asm/auxvec.h | 2 + arch/parisc/include/uapi/asm/errno.h | 4 +- arch/x86/include/asm/tlbflush.h | 7 +++ drivers/acpi/sysfs.c | 7 ++- drivers/crypto/nx/nx.c | 2 +- drivers/edac/edac_mc.c | 2 +- drivers/gpio/Kconfig | 1 + drivers/input/keyboard/tegra-kbc.c | 2 +- drivers/input/serio/i8042.c | 17 +------ drivers/input/serio/libps2.c | 10 ++-- drivers/pci/pci-sysfs.c | 18 +++---- drivers/pci/quirks.c | 12 +++++ drivers/s390/block/dasd.c | 10 +++- drivers/scsi/aacraid/commctrl.c | 13 ++++- drivers/scsi/megaraid/megaraid_sas_base.c | 6 +-- drivers/scsi/megaraid/megaraid_sas_fusion.c | 2 +- drivers/staging/comedi/drivers/daqboard2000.c | 2 +- drivers/usb/class/cdc-acm.c | 5 +- drivers/usb/class/cdc-acm.h | 1 - drivers/usb/core/config.c | 69 +++++++++++++++++++++++++-- drivers/usb/core/devices.c | 10 ++-- drivers/usb/core/hcd-pci.c | 2 +- drivers/usb/core/hcd.c | 6 +-- drivers/usb/core/hub.c | 26 +++++----- drivers/usb/core/urb.c | 3 +- drivers/usb/core/usb.h | 2 +- drivers/usb/dwc3/gadget.c | 19 ++++---- drivers/usb/host/xhci-hub.c | 3 ++ drivers/usb/host/xhci-mem.c | 9 ++-- drivers/usb/host/xhci-ring.c | 3 +- drivers/usb/host/xhci.c | 7 ++- drivers/usb/serial/ftdi_sio.c | 3 ++ drivers/usb/serial/ftdi_sio_ids.h | 12 +++++ drivers/usb/serial/mos7720.c | 2 +- drivers/usb/serial/mos7840.c | 4 +- drivers/usb/serial/option.c | 22 +++++++++ drivers/usb/serial/usb-serial.c | 4 +- fs/seq_file.c | 4 +- include/linux/i8042.h | 6 --- include/linux/pci_ids.h | 7 +++ include/linux/serio.h | 24 ++++++++-- include/uapi/linux/usb/ch9.h | 1 + net/mac80211/cfg.c | 2 +- net/mac80211/tx.c | 6 +-- 46 files changed, 272 insertions(+), 112 deletions(-)
Greg Kroah-Hartman
maintainerPATCH 1/35 x86/mm: Disable preemption during CR3 read+write
3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sebastian Andrzej Siewior <[email protected]>
commit 5cf0791da5c162ebc14b01eb01631cfa7ed4fa6e upstream.
There's a subtle preemption race on UP kernels:
Usually current->mm (and therefore mm->pgd) stays the same during the lifetime of a task so it does not matter if a task gets preempted during the read and write of the CR3.
But then, there is this scenario on x86-UP:
TaskA is in do_exit() and exit_mm() sets current->mm = NULL followed by:
-> mmput()
-> exit_mmap()
-> tlb_finish_mmu()
-> tlb_flush_mmu()
-> tlb_flush_mmu_tlbonly()
-> tlb_flush()
-> flush_tlb_mm_range()
-> __flush_tlb_up()
-> __flush_tlb()
-> __native_flush_tlb()
At this point current->mm is NULL but current->active_mm still points to the "old" mm.
Let's preempt taskA _after_ native_read_cr3() by taskB. TaskB has its own mm so CR3 has changed.
Now preempt back to taskA. TaskA has no ->mm set so it borrows taskB's mm and so CR3 remains unchanged. Once taskA gets active it continues where it was interrupted and that means it writes its old CR3 value back. Everything is fine because userland won't need its memory anymore.
Now the fun part:
Let's preempt taskA one more time and get back to taskB. This time switch_mm() won't do a thing because oldmm (->active_mm) is the same as mm (as per context_switch()). So we remain with a bad CR3 / PGD and return to userland.
The next thing that happens is handle_mm_fault() with an address for the execution of its code in userland. handle_mm_fault() realizes that it has a PTE with proper rights so it returns doing nothing. But the CPU looks at the wrong PGD and insists that something is wrong and faults again. And again. And one more time…
This pagefault circle continues until the scheduler gets tired of it and puts another task on the CPU. It gets little difficult if the task is a RT task with a high priority. The system will either freeze or it gets fixed by the software watchdog thread which usually runs at RT-max prio. But waiting for the watchdog will increase the latency of the RT task which is no good.
Fix this by disabling preemption across the critical code section.
--- arch/x86/include/asm/tlbflush.h | 7 +++++++ 1 file changed, 7 insertions(+)
arch/x86/include/asm/tlbflush.h +7 -0
@@ -17,7 +17,14 @@static inline void __native_flush_tlb (void ) { +/* +* If current->mm == NULL then we borrow a mm which may change during a +* task switch and therefore we must not be preempted while we write CR3 +* back: +*/ +preempt_disable ();native_write_cr3 (native_read_cr3 ()); +preempt_enable (); }static inline void __native_flush_tlb_global_irq_disabled (void )
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Greg Kroah-Hartman
maintainerPATCH 2/35 arm64: Define AT_VECTOR_SIZE_ARCH for ARCH_DLINFO
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: James Hogan <[email protected]>
commit 3146bc64d12377a74dbda12b96ea32da3774ae07 upstream.
AT_VECTOR_SIZE_ARCH should be defined with the maximum number of NEW_AUX_ENT entries that ARCH_DLINFO can contain, but it wasn't defined for arm64 at all even though ARCH_DLINFO will contain one NEW_AUX_ENT for the VDSO address.
This shouldn't be a problem as AT_VECTOR_SIZE_BASE includes space for AT_BASE_PLATFORM which arm64 doesn't use, but lets define it now and add the comment above ARCH_DLINFO as found in several other architectures to remind future modifiers of ARCH_DLINFO to keep AT_VECTOR_SIZE_ARCH up to date.
--- arch/arm64/include/asm/elf.h | 1 + arch/arm64/include/uapi/asm/auxvec.h | 2 ++ 2 files changed, 3 insertions(+)
arch/arm64/include/asm/elf.h +1 -0
@@ -137,6 +137,7 @@ extern unsigned long randomize_et_dyn(un#define SET_PERSONALITY (ex) clear_thread_flag(TIF_32BIT); +/* update AT_VECTOR_SIZE_ARCH if the number of NEW_AUX_ENT entries changes */ #define ARCH_DLINFO \ do { \ NEW_AUX_ENT(AT_SYSINFO_EHDR, \
arch/arm64/include/uapi/asm/auxvec.h +2 -0
@@ -19,4 +19,6 @@/* vDSO location */ #define AT_SYSINFO_EHDR 33 +#define AT_VECTOR_SIZE_ARCH 1/* entries in ARCH_DLINFO */ +#endif
Greg Kroah-Hartman
maintainerPATCH 3/35 parisc: Fix order of EREFUSED define in errno.h
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Helge Deller <[email protected]>
commit 3eb53b20d7bd1374598cfb1feaa081fcac0e76cd upstream.
When building gccgo in userspace, errno.h gets parsed and the go include file sysinfo.go is generated.
Since EREFUSED is defined to the same value as ECONNREFUSED, and ECONNREFUSED is defined later on in errno.h, this leads to go complaining that EREFUSED isn't defined yet.
Fix this trivial problem by moving the define of EREFUSED down after ECONNREFUSED in errno.h (and clean up the indenting while touching this line).
--- arch/parisc/include/uapi/asm/errno.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/parisc/include/uapi/asm/errno.h +2 -2
@@ -97,10 +97,10 @@#define ENOTCONN 235/* Transport endpoint is not connected */ #define ESHUTDOWN 236/* Cannot send after transport endpoint shutdown */ #define ETOOMANYREFS 237/* Too many references: cannot splice */ -#define EREFUSED ECONNREFUSED/* for HP's NFS apparently */ #define ETIMEDOUT 238/* Connection timed out */ #define ECONNREFUSED 239/* Connection refused */ -#define EREMOTERELEASE 240/* Remote peer released connection */ +#define EREFUSED ECONNREFUSED/* for HP's NFS apparently */ +#define EREMOTERELEASE 240/* Remote peer released connection */ #define EHOSTDOWN 241/* Host is down */ #define EHOSTUNREACH 242/* No route to host */
Greg Kroah-Hartman
maintainerPATCH 4/35 PCI: Support PCIe devices with short cfg_size
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jason S. McMullan <[email protected]>
commit c20aecf6963d1273d8f6d61c042b4845441ca592 upstream.
If a device quirk modifies the pci_dev->cfg_size to be less than PCI_CFG_SPACE_EXP_SIZE (4096), but greater than PCI_CFG_SPACE_SIZE (256), the PCI sysfs interface truncates the readable size to PCI_CFG_SPACE_SIZE.
Allow sysfs access to config space up to cfg_size, even if the device doesn't support the entire 4096-byte PCIe config space.
Note that pci_read_config() and pci_write_config() limit access to dev->cfg_size even though pcie_config_attr contains 4096 (the maximum size).
--- drivers/pci/pci-sysfs.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
drivers/pci/pci-sysfs.c +9 -9
@@ -1349,10 +1349,10 @@ int __must_check pci_create_sysfs_dev_fiif (!sysfs_initialized)return -EACCES ; -if (pdev->cfg_size <PCI_CFG_SPACE_EXP_SIZE ) - retval =sysfs_create_bin_file (&pdev->dev.kobj, &pci_config_attr); -else +if (pdev->cfg_size >PCI_CFG_SPACE_SIZE ) retval =sysfs_create_bin_file (&pdev->dev.kobj, &pcie_config_attr); +else + retval =sysfs_create_bin_file (&pdev->dev.kobj, &pci_config_attr);if (retval) goto err;
@@ -1409,10 +1409,10 @@ err_rom_file: err_resource_files:pci_remove_resource_files (pdev); err_config_file: -if (pdev->cfg_size <PCI_CFG_SPACE_EXP_SIZE ) -sysfs_remove_bin_file (&pdev->dev.kobj, &pci_config_attr); -else +if (pdev->cfg_size >PCI_CFG_SPACE_SIZE )sysfs_remove_bin_file (&pdev->dev.kobj, &pcie_config_attr); +else +sysfs_remove_bin_file (&pdev->dev.kobj, &pci_config_attr); err:return retval; }
@@ -1446,10 +1446,10 @@ void pci_remove_sysfs_dev_files(struct ppci_remove_capabilities_sysfs (pdev); -if (pdev->cfg_size <PCI_CFG_SPACE_EXP_SIZE ) -sysfs_remove_bin_file (&pdev->dev.kobj, &pci_config_attr); -else +if (pdev->cfg_size >PCI_CFG_SPACE_SIZE )sysfs_remove_bin_file (&pdev->dev.kobj, &pcie_config_attr); +else +sysfs_remove_bin_file (&pdev->dev.kobj, &pci_config_attr);pci_remove_resource_files (pdev);
Greg Kroah-Hartman
maintainerPATCH 5/35 PCI: Add Netronome vendor and device IDs
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jason S. McMullan <[email protected]>
commit a755e169031dac9ebaed03302c4921687c271d62 upstream.
Device IDs for the Netronome NFP3200, NFP3240, NFP6000, and NFP6000 SR-IOV devices.
--- include/linux/pci_ids.h | 6 ++++++ 1 file changed, 6 insertions(+)
include/linux/pci_ids.h +6 -0
@@ -2473,6 +2473,12 @@#define PCI_DEVICE_ID_KORENIX_JETCARDF2 0x1700#define PCI_DEVICE_ID_KORENIX_JETCARDF3 0x17ff +#define PCI_VENDOR_ID_NETRONOME 0x19ee +#define PCI_DEVICE_ID_NETRONOME_NFP3200 0x3200 +#define PCI_DEVICE_ID_NETRONOME_NFP3240 0x3240 +#define PCI_DEVICE_ID_NETRONOME_NFP6000 0x6000 +#define PCI_DEVICE_ID_NETRONOME_NFP6000_VF 0x6003 +#define PCI_VENDOR_ID_QMI 0x1a32#define PCI_VENDOR_ID_AZWAVE 0x1a3b
Greg Kroah-Hartman
maintainerPATCH 6/35 PCI: Limit config space size for Netronome NFP6000 family
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jason S. McMullan <[email protected]>
commit 9f33a2ae59f24452c1076749deb615bccd435ca9 upstream.
The NFP6000 has an erratum where reading/writing to PCI config space addresses above 0x600 can cause the NFP to generate PCIe completion timeouts.
Limit the NFP6000's config space size to 0x600 bytes.
--- drivers/pci/quirks.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
drivers/pci/quirks.c +11 -0
@@ -288,6 +288,17 @@ static void quirk_citrine(struct pci_dev }DECLARE_PCI_FIXUP_HEADER (PCI_VENDOR_ID_IBM ,PCI_DEVICE_ID_IBM_CITRINE , quirk_citrine); +/* +* This chip can cause bus lockups if config addresses above 0x600 +* are read or written. +*/ +static void quirk_nfp6000 (struct pci_dev *dev) +{ + dev->cfg_size =0x600 ; +} +DECLARE_PCI_FIXUP_HEADER (PCI_VENDOR_ID_NETRONOME ,PCI_DEVICE_ID_NETRONOME_NFP6000 , quirk_nfp6000); +DECLARE_PCI_FIXUP_HEADER (PCI_VENDOR_ID_NETRONOME ,PCI_DEVICE_ID_NETRONOME_NFP6000_VF , quirk_nfp6000); +/* On IBM Crocodile ipr SAS adapters, expand BAR to system page size */ static void quirk_extend_bar_to_page (struct pci_dev *dev) {
Greg Kroah-Hartman
maintainerPATCH 7/35 PCI: Add Netronome NFP4000 PF device ID
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Simon Horman <[email protected]>
commit 69874ec233871a62e1bc8c89e643993af93a8630 upstream.
Add the device ID for the PF of the NFP4000. The device ID for the VF, 0x6003, is already present as PCI_DEVICE_ID_NETRONOME_NFP6000_VF.
--- include/linux/pci_ids.h | 1 + 1 file changed, 1 insertion(+)
include/linux/pci_ids.h +1 -0
@@ -2476,6 +2476,7 @@#define PCI_VENDOR_ID_NETRONOME 0x19ee#define PCI_DEVICE_ID_NETRONOME_NFP3200 0x3200#define PCI_DEVICE_ID_NETRONOME_NFP3240 0x3240 +#define PCI_DEVICE_ID_NETRONOME_NFP4000 0x4000#define PCI_DEVICE_ID_NETRONOME_NFP6000 0x6000#define PCI_DEVICE_ID_NETRONOME_NFP6000_VF 0x6003
Greg Kroah-Hartman
maintainerPATCH 8/35 PCI: Limit config space size for Netronome NFP4000
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Simon Horman <[email protected]>
commit c2e771b02792d222cbcd9617fe71482a64f52647 upstream.
Like the NFP6000, the NFP4000 as an erratum where reading/writing to PCI config space addresses above 0x600 can cause the NFP to generate PCIe completion timeouts.
Limit the NFP4000's PF's config space size to 0x600 bytes as is already done for the NFP6000.
The NFP4000's VF is 0x6004 (PCI_DEVICE_ID_NETRONOME_NFP6000_VF), the same device ID as the NFP6000's VF. Thus, its config space is already limited by the existing use of quirk_nfp6000().
--- drivers/pci/quirks.c | 1 + 1 file changed, 1 insertion(+)
drivers/pci/quirks.c +1 -0
@@ -296,6 +296,7 @@ static void quirk_nfp6000(struct pci_dev { dev->cfg_size =0x600 ; } +DECLARE_PCI_FIXUP_HEADER (PCI_VENDOR_ID_NETRONOME ,PCI_DEVICE_ID_NETRONOME_NFP4000 , quirk_nfp6000);DECLARE_PCI_FIXUP_HEADER (PCI_VENDOR_ID_NETRONOME ,PCI_DEVICE_ID_NETRONOME_NFP6000 , quirk_nfp6000);DECLARE_PCI_FIXUP_HEADER (PCI_VENDOR_ID_NETRONOME ,PCI_DEVICE_ID_NETRONOME_NFP6000_VF , quirk_nfp6000);
Greg Kroah-Hartman
maintainerPATCH 9/35 usb: dwc3: gadget: increment request->actual once
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Felipe Balbi <[email protected]>
commit c7de573471832dff7d31f0c13b0f143d6f017799 upstream.
When using SG lists, we would end up settingrequest->actual to:
num_mapped_sgs * (request->length - count)
Let's fix that up by incrementing request->actual
only once.
--- drivers/usb/dwc3/gadget.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-)
drivers/usb/dwc3/gadget.c +11 -8
@@ -1799,14 +1799,6 @@ static int __dwc3_cleanup_done_trbs(stru s_pkt =1 ; } -/* -* We assume here we will always receive the entire data block -* which we should receive. Meaning, if we program RX to -* receive 4K but we receive only 2K, we assume that's all we -* should receive and we simply bounce the request back to the -* gadget driver for further processing. -*/ - req->request.actual += req->request.length - count;if (s_pkt)return 1 ; if ((event->status & DEPEVT_STATUS_LST) &&
@@ -1826,6 +1818,7 @@ static int dwc3_cleanup_done_reqs(structstruct dwc3_trb *trb;unsigned int slot;unsigned int i; +int count =0 ;int ret; do {
@@ -1842,6 +1835,8 @@ static int dwc3_cleanup_done_reqs(struct slot++; slot %=DWC3_TRB_NUM ; trb = &dep->trb_pool[slot]; + count += trb->size &DWC3_TRB_SIZE_MASK ; + ret =__dwc3_cleanup_done_trbs (dwc, dep, req, trb, event, status);
@@ -1849,6 +1844,14 @@ static int dwc3_cleanup_done_reqs(structbreak ; }while (++i < req->request.num_mapped_sgs); +/* +* We assume here we will always receive the entire data block +* which we should receive. Meaning, if we program RX to +* receive 4K but we receive only 2K, we assume that's all we +* should receive and we simply bounce the request back to the +* gadget driver for further processing. +*/ + req->request.actual += req->request.length - count;dwc3_gadget_giveback (dep, req, status);if (ret)
Greg Kroah-Hartman
maintainerPATCH 10/35 usb: define USB_SPEED_SUPER_PLUS speed for SuperSpeedPlus USB3.1 devices
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mathias Nyman <[email protected]>
commit 8a1b2725a60d3267135c15e80984b4406054f650 upstream.
Add a new USB_SPEED_SUPER_PLUS device speed, and make sure usb core can handle the new speed.
In most cases the behaviour is the same as with USB_SPEED_SUPER SuperSpeed devices. In a few places we add a "Plus" string to inform the user of the new speed.
--- drivers/usb/core/config.c | 3 ++- drivers/usb/core/devices.c | 10 ++++++---- drivers/usb/core/hcd-pci.c | 2 +- drivers/usb/core/hcd.c | 6 +++--- drivers/usb/core/hub.c | 26 +++++++++++++++----------- drivers/usb/core/urb.c | 3 ++- drivers/usb/core/usb.h | 2 +- include/uapi/linux/usb/ch9.h | 1 + 8 files changed, 31 insertions(+), 22 deletions(-)
drivers/usb/core/config.c +2 -1
@@ -192,6 +192,7 @@ static int usb_parse_endpoint(struct devif (usb_endpoint_xfer_int (d)) { i =1 ;switch (to_usb_device (ddev)->speed) { +case USB_SPEED_SUPER_PLUS :case USB_SPEED_SUPER :case USB_SPEED_HIGH :/* Many device manufacturers are using full-speed
@@ -264,7 +265,7 @@ static int usb_parse_endpoint(struct dev }/* Parse a possible SuperSpeed endpoint companion descriptor */ -if (to_usb_device (ddev)->speed ==USB_SPEED_SUPER ) +if (to_usb_device (ddev)->speed >=USB_SPEED_SUPER )usb_parse_ss_endpoint_companion (ddev, cfgno, inum, asnum, endpoint, buffer, size);
drivers/usb/core/devices.c +6 -4
@@ -221,7 +221,7 @@ static char *usb_dump_endpoint_descriptobreak ;case USB_ENDPOINT_XFER_INT : type ="Int." ; -if (speed ==USB_SPEED_HIGH || speed ==USB_SPEED_SUPER ) +if (speed ==USB_SPEED_HIGH || speed >=USB_SPEED_SUPER ) interval =1 << (desc->bInterval -1 );else interval = desc->bInterval;
@@ -230,7 +230,7 @@ static char *usb_dump_endpoint_descriptoreturn start; } interval *= (speed ==USB_SPEED_HIGH || - speed ==USB_SPEED_SUPER ) ?125 :1000 ; + speed >=USB_SPEED_SUPER ) ?125 :1000 ;if (interval %1000 ) unit ='u' ;else {
@@ -322,7 +322,7 @@ static char *usb_dump_config_descriptor(if (start > end)return start; -if (speed ==USB_SPEED_SUPER ) +if (speed >=USB_SPEED_SUPER ) mul =8 ;else mul =2 ;
@@ -534,6 +534,8 @@ static ssize_t usb_device_dump(char __us speed ="480" ;break ;case USB_SPEED_SUPER : speed ="5000" ;break ; +case USB_SPEED_SUPER_PLUS : + speed ="10000" ;break ;default : speed ="??" ; }
@@ -553,7 +555,7 @@ static ssize_t usb_device_dump(char __us/* super/high speed reserves 80%, full/low reserves 90% */ if (usbdev->speed ==USB_SPEED_HIGH || - usbdev->speed ==USB_SPEED_SUPER ) + usbdev->speed >=USB_SPEED_SUPER ) max =800 ;else max =FRAME_TIME_MAX_USECS_ALLOC ;
drivers/usb/core/hcd-pci.c +1 -1
@@ -207,7 +207,7 @@ int usb_hcd_pci_probe(struct pci_dev *de* The xHCI driver has its own irq management * make sure irq setup is not touched for xhci in generic hcd code */ -if ((driver->flags &HCD_MASK ) !=HCD_USB3 ) { +if ((driver->flags &HCD_MASK ) <HCD_USB3 ) {if (!dev->irq) { dev_err(&dev->dev, "Found HC with no IRQ. Check BIOS/PCI %s setup!\n",
drivers/usb/core/hcd.c +3 -3
@@ -1024,7 +1024,7 @@ static int register_root_hub(struct usb_ dev_name(&usb_dev->dev), retval);return (retval <0 ) ? retval : -EMSGSIZE ; } -if (usb_dev->speed ==USB_SPEED_SUPER ) { +if (usb_dev->speed >=USB_SPEED_SUPER ) { retval =usb_get_bos_descriptor (usb_dev);if (retval <0 ) {mutex_unlock (&usb_bus_list_lock);
@@ -2055,7 +2055,7 @@ int usb_alloc_streams(struct usb_interfa hcd =bus_to_hcd (dev->bus);if (!hcd->driver->alloc_streams || !hcd->driver->free_streams)return -EINVAL ; -if (dev->speed !=USB_SPEED_SUPER ) +if (dev->speed <USB_SPEED_SUPER )return -EINVAL ;if (dev->state <USB_STATE_CONFIGURED )return -ENODEV ;
@@ -2093,7 +2093,7 @@ int usb_free_streams(struct usb_interfac dev =interface_to_usbdev (interface); hcd =bus_to_hcd (dev->bus); -if (dev->speed !=USB_SPEED_SUPER ) +if (dev->speed <USB_SPEED_SUPER )return -EINVAL ;/* Streams only apply to bulk endpoints. */
drivers/usb/core/hub.c +15 -11
@@ -297,7 +297,7 @@ static void usb_set_lpm_parameters(strucunsigned int hub_u1_del;unsigned int hub_u2_del; -if (!udev->lpm_capable || udev->speed !=USB_SPEED_SUPER ) +if (!udev->lpm_capable || udev->speed <USB_SPEED_SUPER )return ; hub =usb_hub_to_struct_hub (udev->parent);
@@ -2559,7 +2559,7 @@ static unsigned hub_is_wusb(struct usb_h*/ static bool use_new_scheme (struct usb_device *udev,int retry) { -if (udev->speed ==USB_SPEED_SUPER ) +if (udev->speed >=USB_SPEED_SUPER )return false;return USE_NEW_SCHEME (retry);
@@ -3812,7 +3812,7 @@ int usb_disable_lpm(struct usb_device *ustruct usb_hcd *hcd;if (!udev || !udev->parent || - udev->speed !=USB_SPEED_SUPER || + udev->speed <USB_SPEED_SUPER || !udev->lpm_capable)return 0 ;
@@ -3868,7 +3868,7 @@ void usb_enable_lpm(struct usb_device *ustruct usb_hcd *hcd;if (!udev || !udev->parent || - udev->speed !=USB_SPEED_SUPER || + udev->speed <USB_SPEED_SUPER || !udev->lpm_capable)return ;
@@ -4127,7 +4127,9 @@ hub_port_init (struct usb_hub *hub, stru retval = -ENODEV ; -if (oldspeed !=USB_SPEED_UNKNOWN && oldspeed != udev->speed) { +/* Don't allow speed changes at reset, except usb 3.0 to faster */ +if (oldspeed !=USB_SPEED_UNKNOWN && oldspeed != udev->speed && + !(oldspeed ==USB_SPEED_SUPER && udev->speed > oldspeed)) {dev_dbg (&udev->dev,"device reset changed speed!\n" ); goto fail; }
@@ -4139,6 +4141,7 @@ hub_port_init (struct usb_hub *hub, stru* reported as 0xff in the device descriptor). WUSB1.0[4.8.1]. */ switch (udev->speed) { +case USB_SPEED_SUPER_PLUS :case USB_SPEED_SUPER :case USB_SPEED_WIRELESS :/* fixed at 512 */ udev->ep0.desc.wMaxPacketSize =cpu_to_le16 (512 );
@@ -4165,7 +4168,7 @@ hub_port_init (struct usb_hub *hub, struelse speed =usb_speed_string (udev->speed); -if (udev->speed !=USB_SPEED_SUPER ) +if (udev->speed <USB_SPEED_SUPER ) dev_info(&udev->dev, "%s %s USB device number %d using %s\n", (udev->config) ? "reset" : "new", speed,
@@ -4291,11 +4294,12 @@ hub_port_init (struct usb_hub *hub, stru devnum, retval); goto fail; } -if (udev->speed ==USB_SPEED_SUPER ) { +if (udev->speed >=USB_SPEED_SUPER ) { devnum = udev->devnum;dev_info (&udev->dev, -"%s SuperSpeed USB device number %d using %s\n" , +"%s SuperSpeed%s USB device number %d using %s\n" , (udev->config) ?"reset" :"new" , + (udev->speed ==USB_SPEED_SUPER_PLUS ) ?"Plus" :"" , devnum, udev->bus->controller->driver->name); }
@@ -4337,7 +4341,7 @@ hub_port_init (struct usb_hub *hub, stru* got from those devices show they aren't superspeed devices. Warm * reset the port attached by the devices can fix them. */ -if ((udev->speed ==USB_SPEED_SUPER ) && +if ((udev->speed >=USB_SPEED_SUPER ) && (le16_to_cpu (udev->descriptor.bcdUSB) <0x0300 )) {dev_err (&udev->dev,"got a wrong device descriptor, " "warm reset device\n" );
@@ -4348,7 +4352,7 @@ hub_port_init (struct usb_hub *hub, stru }if (udev->descriptor.bMaxPacketSize0 ==0xff || - udev->speed ==USB_SPEED_SUPER ) + udev->speed >=USB_SPEED_SUPER ) i =512 ;else i = udev->descriptor.bMaxPacketSize0;
@@ -4607,7 +4611,7 @@ static void hub_port_connect_change(stru udev->level = hdev->level +1 ; udev->wusb =hub_is_wusb (hub); -/* Only USB 3.0 devices are connected to SuperSpeed hubs. */ +/* Devices connected to SuperSpeed hubs are USB 3.0 or later */ if (hub_is_superspeed (hub->hdev)) udev->speed =USB_SPEED_SUPER ;else
drivers/usb/core/urb.c +2 -1
@@ -402,7 +402,7 @@ int usb_submit_urb(struct urb *urb, gfp_/* SuperSpeed isoc endpoints have up to 16 bursts of up to * 3 packets each */ -if (dev->speed ==USB_SPEED_SUPER ) { +if (dev->speed >=USB_SPEED_SUPER ) {int burst =1 + ep->ss_ep_comp.bMaxBurst;int mult =USB_SS_MULT (ep->ss_ep_comp.bmAttributes); max *= burst;
@@ -499,6 +499,7 @@ int usb_submit_urb(struct urb *urb, gfp_ }/* too big? */ switch (dev->speed) { +case USB_SPEED_SUPER_PLUS :case USB_SPEED_SUPER :/* units are 125us */ /* Handle up to 2^(16-1) microframes */ if (urb->interval > (1 <<15 ))
drivers/usb/core/usb.h +1 -1
@@ -43,7 +43,7 @@ static inline unsigned usb_get_max_power struct usb_host_config *c) {/* SuperSpeed power is in 8 mA units; others are in 2 mA units */ -unsigned mul = (udev->speed ==USB_SPEED_SUPER ?8 :2 ); +unsigned mul = (udev->speed >=USB_SPEED_SUPER ?8 :2 );return c->desc.bMaxPower * mul; }
include/uapi/linux/usb/ch9.h +1 -0
@@ -913,6 +913,7 @@ enum usb_device_speed {USB_SPEED_HIGH ,/* usb 2.0 */ USB_SPEED_WIRELESS ,/* wireless (usb 2.5) */ USB_SPEED_SUPER ,/* usb 3.0 */ + USB_SPEED_SUPER_PLUS, /* usb 3.1 */ };
Greg Kroah-Hartman
maintainerPATCH 11/35 USB: validate wMaxPacketValue entries in endpoint descriptors
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alan Stern <[email protected]>
commit aed9d65ac3278d4febd8665bd7db59ef53e825fe upstream.
Erroneous or malicious endpoint descriptors may have non-zero bits in reserved positions, or out-of-bounds values. This patch helps prevent these from causing problems by bounds-checking the wMaxPacketValue entries in endpoint descriptors and capping the values at the maximum allowed.
This issue was first discovered and tests were conducted by Jake Lamberson <[email protected]>, an intern working for Rosie Hall.
--- drivers/usb/core/config.c | 66 +++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 63 insertions(+), 3 deletions(-)
drivers/usb/core/config.c +63 -3
@@ -143,6 +143,31 @@ static void usb_parse_ss_endpoint_compan } } +static const unsigned short low_speed_maxpacket_maxes[4 ] = { + [USB_ENDPOINT_XFER_CONTROL ] =8 , + [USB_ENDPOINT_XFER_ISOC ] =0 , + [USB_ENDPOINT_XFER_BULK ] =0 , + [USB_ENDPOINT_XFER_INT ] =8 , +}; +static const unsigned short full_speed_maxpacket_maxes[4 ] = { + [USB_ENDPOINT_XFER_CONTROL ] =64 , + [USB_ENDPOINT_XFER_ISOC ] =1023 , + [USB_ENDPOINT_XFER_BULK ] =64 , + [USB_ENDPOINT_XFER_INT ] =64 , +}; +static const unsigned short high_speed_maxpacket_maxes[4 ] = { + [USB_ENDPOINT_XFER_CONTROL ] =64 , + [USB_ENDPOINT_XFER_ISOC ] =1024 , + [USB_ENDPOINT_XFER_BULK ] =512 , + [USB_ENDPOINT_XFER_INT ] =1023 , +}; +static const unsigned short super_speed_maxpacket_maxes[4 ] = { + [USB_ENDPOINT_XFER_CONTROL ] =512 , + [USB_ENDPOINT_XFER_ISOC ] =1024 , + [USB_ENDPOINT_XFER_BULK ] =1024 , + [USB_ENDPOINT_XFER_INT ] =1024 , +}; +static int usb_parse_endpoint (struct device *ddev,int cfgno,int inum,int asnum,struct usb_host_interface *ifp,int num_ep,unsigned char *buffer,int size)
@@ -151,6 +176,8 @@ static int usb_parse_endpoint(struct devstruct usb_endpoint_descriptor *d;struct usb_host_endpoint *endpoint;int n, i, j, retval; +unsigned int maxp; +const unsigned short *maxpacket_maxes; d = (struct usb_endpoint_descriptor *) buffer; buffer += d->bLength;
@@ -247,6 +274,42 @@ static int usb_parse_endpoint(struct dev endpoint->desc.wMaxPacketSize =cpu_to_le16 (8 ); } +/* Validate the wMaxPacketSize field */ + maxp =usb_endpoint_maxp (&endpoint->desc); + +/* Find the highest legal maxpacket size for this endpoint */ + i =0 ;/* additional transactions per microframe */ +switch (to_usb_device (ddev)->speed) { +case USB_SPEED_LOW : + maxpacket_maxes = low_speed_maxpacket_maxes; +break ; +case USB_SPEED_FULL : + maxpacket_maxes = full_speed_maxpacket_maxes; +break ; +case USB_SPEED_HIGH : +/* Bits 12..11 are allowed only for HS periodic endpoints */ +if (usb_endpoint_xfer_int (d) ||usb_endpoint_xfer_isoc (d)) { + i = maxp & (BIT (12 ) |BIT (11 )); + maxp &= ~i; + } +/* fallthrough */ +default : + maxpacket_maxes = high_speed_maxpacket_maxes; +break ; +case USB_SPEED_SUPER : +case USB_SPEED_SUPER_PLUS : + maxpacket_maxes = super_speed_maxpacket_maxes; +break ; + } + j = maxpacket_maxes[usb_endpoint_type (&endpoint->desc)]; + +if (maxp > j) { +dev_warn (ddev,"config %d interface %d altsetting %d endpoint 0x%X has invalid maxpacket %d, setting to %d\n" , + cfgno, inum, asnum, d->bEndpointAddress, maxp, j); + maxp = j; + endpoint->desc.wMaxPacketSize =cpu_to_le16 (i | maxp); + } +/* * Some buggy high speed devices have bulk endpoints using * maxpacket sizes other than 512. High speed HCDs may not
@@ -254,9 +317,6 @@ static int usb_parse_endpoint(struct dev*/ if (to_usb_device (ddev)->speed ==USB_SPEED_HIGH &&usb_endpoint_xfer_bulk (d)) { -unsigned maxp; - - maxp =usb_endpoint_maxp (&endpoint->desc) &0x07ff ;if (maxp !=512 ) dev_warn(ddev, "config %d interface %d altsetting %d " "bulk endpoint 0x%X has invalid maxpacket %d\n",
Greg Kroah-Hartman
maintainerPATCH 12/35 usb: xhci: Fix panic if disconnect
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jim Lin <[email protected]>
commit 88716a93766b8f095cdef37a8e8f2c93aa233b21 upstream.
After a device is disconnected, xhci_stop_device() will be invoked in xhci_bus_suspend().
Also the "disconnect" IRQ will have ISR to invoke xhci_free_virt_device() in this sequence.xhci_irq -> xhci_handle_event -> handle_cmd_completion -> xhci_handle_cmd_disable_slot -> xhci_free_virt_device
If xhci->devs[slot_id] has been assigned to NULL in xhci_free_virt_device(), then virt_dev->eps[i].ring in xhci_stop_device() may point to an invlid address to cause kernel panic.
virt_dev = xhci->devs[slot_id];
:
if (virt_dev->eps[i].ring && virt_dev->eps[i].ring->dequeue)
[] Unable to handle kernel paging request at virtual address 00001a68 [] pgd=ffffffc001430000
[] [00001a68] *pgd=000000013c807003, *pud=000000013c807003, *pmd=000000013c808003, *pte=0000000000000000
[] Internal error: Oops: 96000006 [#1] PREEMPT SMP
[] CPU: 0 PID: 39 Comm: kworker/0:1 Tainted: G U
[] Workqueue: pm pm_runtime_work
[] task: ffffffc0bc0e0bc0 ti: ffffffc0bc0ec000 task.ti:ffffffc0bc0ec000
[] PC is at xhci_stop_device.constprop.11+0xb4/0x1a4
This issue is found when running with realtek ethernet device (0bda:8153).
--- drivers/usb/host/xhci-hub.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/usb/host/xhci-hub.c +3 -0
@@ -276,6 +276,9 @@ static int xhci_stop_device(struct xhci_ ret =0 ; virt_dev = xhci->devs[slot_id]; +if (!virt_dev) +return -ENODEV ; + cmd =xhci_alloc_command (xhci, false, true,GFP_NOIO );if (!cmd) {xhci_dbg (xhci,"Couldn't allocate command structure.\n" );
Greg Kroah-Hartman
maintainerPATCH 13/35 USB: serial: fix memleak in driver-registration error path
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexey Klimov <[email protected]>
commit 647024a7df36014bbc4479d92d88e6b77c0afcf6 upstream.
udriver struct allocated by kzalloc() will not be freed if usb_register() and next calls fail. This patch fixes this by adding one more step with kfree(udriver) in error path.
--- drivers/usb/serial/usb-serial.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/usb/serial/usb-serial.c +3 -1
@@ -1426,7 +1426,7 @@ int usb_serial_register_drivers(struct u rc =usb_register (udriver);if (rc) -return rc; + goto failed_usb_register;for (sd = serial_drivers; *sd; ++sd) { (*sd)->usb_driver = udriver;
@@ -1444,6 +1444,8 @@ int usb_serial_register_drivers(struct uwhile (sd-- > serial_drivers)usb_serial_deregister (*sd);usb_deregister (udriver); +failed_usb_register: +kfree (udriver);return rc; }EXPORT_SYMBOL_GPL (usb_serial_register_drivers);
Greg Kroah-Hartman
maintainerPATCH 14/35 USB: serial: option: add D-Link DWM-156/A3
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lubomir Rintel <[email protected]>
commit cf1b18030de29e4e5b0a57695ae5db4a89da0ff7 upstream.
The device has four interfaces; the three serial ports ought to be handled by this driver:
00 Diagnostic interface serial port
01 NMEA device serial port
02 Mass storage (sd card)
03 Modem serial port
The other product ids listed in the Windows driver are present already.
--- drivers/usb/serial/option.c | 1 + 1 file changed, 1 insertion(+)
drivers/usb/serial/option.c +1 -0
@@ -1839,6 +1839,7 @@ static const struct usb_device_id option .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, { USB_DEVICE_AND_INTERFACE_INFO(0x07d1, 0x3e01, 0xff, 0xff, 0xff) }, /* D-Link DWM-152/C1 */ { USB_DEVICE_AND_INTERFACE_INFO(0x07d1, 0x3e02, 0xff, 0xff, 0xff) }, /* D-Link DWM-156/C1 */ + { USB_DEVICE_AND_INTERFACE_INFO(0x07d1, 0x7e11, 0xff, 0xff, 0xff) }, /* D-Link DWM-156/A3 */ { USB_DEVICE_INTERFACE_CLASS(0x2020, 0x4000, 0xff) }, /* OLICARD300 - MT6225 */ { USB_DEVICE(INOVIA_VENDOR_ID, INOVIA_SEW858) }, { USB_DEVICE(VIATELECOM_VENDOR_ID, VIATELECOM_PRODUCT_CDS7) },
Greg Kroah-Hartman
maintainerPATCH 15/35 USB: serial: option: add support for Telit LE920A4
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniele Palmas <[email protected]>
commit 01d7956b58e644ea0d2e8d9340c5727a8fc39d70 upstream.
This patch adds a set of compositions for Telit LE920A4.
Compositions in short are:
0x1207: tty + tty0x1208: tty + adb + tty + tty0x1211: tty + adb + ecm0x1212: tty + adb0x1213: ecm + tty0x1214: tty + adb + ecm + tty
telit_le922_blacklist_usbcfg3 is reused for compositions 0x1211 and 0x1214 due to the same interfaces positions.
--- drivers/usb/serial/option.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+)
drivers/usb/serial/option.c +21 -0
@@ -275,6 +275,12 @@ static void option_instat_callback(struc#define TELIT_PRODUCT_LE920 0x1200#define TELIT_PRODUCT_LE910 0x1201#define TELIT_PRODUCT_LE910_USBCFG4 0x1206 +#define TELIT_PRODUCT_LE920A4_1207 0x1207 +#define TELIT_PRODUCT_LE920A4_1208 0x1208 +#define TELIT_PRODUCT_LE920A4_1211 0x1211 +#define TELIT_PRODUCT_LE920A4_1212 0x1212 +#define TELIT_PRODUCT_LE920A4_1213 0x1213 +#define TELIT_PRODUCT_LE920A4_1214 0x1214/* ZTE PRODUCTS */ #define ZTE_VENDOR_ID 0x19d2
@@ -636,6 +642,11 @@ static const struct option_blacklist_inf .reserved = BIT(1) | BIT(5), }; +static const struct option_blacklist_info telit_le920a4_blacklist_1 = { + .sendsetup =BIT (0 ), + .reserved =BIT (1 ), +}; +static const struct option_blacklist_info telit_le922_blacklist_usbcfg0 = { .sendsetup =BIT (2 ), .reserved =BIT (0 ) |BIT (1 ) |BIT (3 ),
@@ -1211,6 +1222,16 @@ static const struct usb_device_id option .driver_info = (kernel_ulong_t)&telit_le922_blacklist_usbcfg3 }, { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE920), .driver_info = (kernel_ulong_t)&telit_le920_blacklist }, + { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE920A4_1207) }, + { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE920A4_1208), + .driver_info = (kernel_ulong_t)&telit_le920a4_blacklist_1 }, + { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE920A4_1211), + .driver_info = (kernel_ulong_t)&telit_le922_blacklist_usbcfg3 }, + { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE920A4_1212), + .driver_info = (kernel_ulong_t)&telit_le920a4_blacklist_1 }, + { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, TELIT_PRODUCT_LE920A4_1213, 0xff) }, + { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE920A4_1214), + .driver_info = (kernel_ulong_t)&telit_le922_blacklist_usbcfg3 }, { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_MF622, 0xff, 0xff, 0xff) }, /* ZTE WCDMA products */ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0002, 0xff, 0xff, 0xff), .driver_info = (kernel_ulong_t)&net_intf1_blacklist },
Greg Kroah-Hartman
maintainerPATCH 16/35 USB: serial: ftdi_sio: add device ID for WICED USB UART dev board
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sheng-Hui J. Chu <[email protected]>
commit ae34d12cc1e212ffcd92e069030e54dae69c832f upstream.
BCM20706V2_EVAL is a WICED dev board designed with FT2232H USB 2.0 UART/FIFO IC.
To support BCM920706V2_EVAL dev board for WICED development on Linux. Add the VID(0a5c) and PID(6422) to ftdi_sio driver to allow loading ftdi_sio for this board.
--- drivers/usb/serial/ftdi_sio.c | 1 + drivers/usb/serial/ftdi_sio_ids.h | 6 ++++++ 2 files changed, 7 insertions(+)
drivers/usb/serial/ftdi_sio.c +1 -0
@@ -1021,6 +1021,7 @@ static const struct usb_device_id id_tab { USB_DEVICE(ICPDAS_VID, ICPDAS_I7560U_PID) }, { USB_DEVICE(ICPDAS_VID, ICPDAS_I7561U_PID) }, { USB_DEVICE(ICPDAS_VID, ICPDAS_I7563U_PID) }, + { USB_DEVICE(WICED_VID, WICED_USB20706V2_PID) }, { } /* Terminating entry */ };
drivers/usb/serial/ftdi_sio_ids.h +6 -0
@@ -673,6 +673,12 @@#define INTREPID_NEOVI_PID 0x0701/* +* WICED USB UART +*/ +#define WICED_VID 0x0A5C +#define WICED_USB20706V2_PID 0x6422 + +/* * Definitions for ID TECH (www.idt-net.com) devices */ #define IDTECH_VID 0x0ACD/* ID TECH Vendor ID */
Greg Kroah-Hartman
maintainerPATCH 18/35 xhci: Make sure xhci handles USB_SPEED_SUPER_PLUS devices.
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mathias Nyman <[email protected]>
commit 0caf6b33452112e5a1186c8c964e90310e49e6bd upstream.
In most cases the devices with the speed set to USB_SPEED_SUPER_PLUS are handled like regular SuperSpeed devices.
--- drivers/usb/host/xhci-mem.c | 9 ++++++--- drivers/usb/host/xhci-ring.c | 3 ++- drivers/usb/host/xhci.c | 7 +++++-- 3 files changed, 13 insertions(+), 6 deletions(-)
drivers/usb/host/xhci-mem.c +6 -3
@@ -974,7 +974,7 @@ static u32 xhci_find_real_port_number(ststruct usb_device *top_dev;struct usb_hcd *hcd; -if (udev->speed ==USB_SPEED_SUPER ) +if (udev->speed >=USB_SPEED_SUPER ) hcd = xhci->shared_hcd;else hcd = xhci->main_hcd;
@@ -1009,6 +1009,7 @@ int xhci_setup_addressable_virt_dev(stru/* 3) Only the control endpoint is valid - one endpoint context */ slot_ctx->dev_info |=cpu_to_le32 (LAST_CTX (1 ) | udev->route);switch (udev->speed) { +case USB_SPEED_SUPER_PLUS :case USB_SPEED_SUPER : slot_ctx->dev_info |=cpu_to_le32 (SLOT_SPEED_SS ); max_packets =MAX_PACKET (512 );
@@ -1196,6 +1197,7 @@ static unsigned int xhci_get_endpoint_in }/* Fall through - SS and HS isoc/int have same decoding */ +case USB_SPEED_SUPER_PLUS :case USB_SPEED_SUPER :if (usb_endpoint_xfer_int (&ep->desc) ||usb_endpoint_xfer_isoc (&ep->desc)) {
@@ -1236,7 +1238,7 @@ static unsigned int xhci_get_endpoint_instatic u32 xhci_get_endpoint_mult (struct usb_device *udev,struct usb_host_endpoint *ep) { -if (udev->speed !=USB_SPEED_SUPER || +if (udev->speed <USB_SPEED_SUPER || !usb_endpoint_xfer_isoc (&ep->desc))return 0 ;return ep->ss_ep_comp.bmAttributes;
@@ -1288,7 +1290,7 @@ static u32 xhci_get_max_esit_payload(str usb_endpoint_xfer_bulk(&ep->desc))return 0 ; -if (udev->speed ==USB_SPEED_SUPER ) +if (udev->speed >=USB_SPEED_SUPER )return le16_to_cpu (ep->ss_ep_comp.wBytesPerInterval); max_packet =GET_MAX_PACKET (usb_endpoint_maxp (&ep->desc));
@@ -1359,6 +1361,7 @@ int xhci_endpoint_init(struct xhci_hcd * max_packet =GET_MAX_PACKET (usb_endpoint_maxp (&ep->desc)); max_burst =0 ;switch (udev->speed) { +case USB_SPEED_SUPER_PLUS :case USB_SPEED_SUPER :/* dig out max burst from ep companion desc */ max_burst = ep->ss_ep_comp.bMaxBurst;
drivers/usb/host/xhci-ring.c +2 -1
@@ -3705,7 +3705,7 @@ static unsigned int xhci_get_burst_count {unsigned int max_burst; -if (xhci->hci_version <0x100 || udev->speed !=USB_SPEED_SUPER ) +if (xhci->hci_version <0x100 || udev->speed <USB_SPEED_SUPER )return 0 ; max_burst = urb->ep->ss_ep_comp.bMaxBurst;
@@ -3731,6 +3731,7 @@ static unsigned int xhci_get_last_burst_return 0 ;switch (udev->speed) { +case USB_SPEED_SUPER_PLUS :case USB_SPEED_SUPER :/* bMaxBurst is zero based: 0 means 1 packet per burst */ max_burst = urb->ep->ss_ep_comp.bMaxBurst;
drivers/usb/host/xhci.c +5 -2
@@ -2054,6 +2054,7 @@ static unsigned int xhci_get_block_size(case USB_SPEED_HIGH :return HS_BLOCK ;case USB_SPEED_SUPER : +case USB_SPEED_SUPER_PLUS :return SS_BLOCK ;case USB_SPEED_UNKNOWN :case USB_SPEED_WIRELESS :
@@ -2179,7 +2180,7 @@ static int xhci_check_bw_table(struct xhunsigned int packets_remaining =0 ;unsigned int i; -if (virt_dev->udev->speed ==USB_SPEED_SUPER ) +if (virt_dev->udev->speed >=USB_SPEED_SUPER )return xhci_check_ss_bw (xhci, virt_dev);if (virt_dev->udev->speed ==USB_SPEED_HIGH ) {
@@ -2380,7 +2381,7 @@ void xhci_drop_ep_from_interval_table(stif (xhci_is_async_ep (ep_bw->type))return ; -if (udev->speed ==USB_SPEED_SUPER ) { +if (udev->speed >=USB_SPEED_SUPER ) {if (xhci_is_sync_in_ep (ep_bw->type)) xhci->devs[udev->slot_id]->bw_table->ss_bw_in -=xhci_get_ss_bw_consumed (ep_bw);
@@ -2418,6 +2419,7 @@ void xhci_drop_ep_from_interval_table(st interval_bw->overhead[HS_OVERHEAD_TYPE ] -=1 ;break ;case USB_SPEED_SUPER : +case USB_SPEED_SUPER_PLUS :case USB_SPEED_UNKNOWN :case USB_SPEED_WIRELESS :/* Should never happen because only LS/FS/HS endpoints will get
@@ -2477,6 +2479,7 @@ static void xhci_add_ep_to_interval_tabl interval_bw->overhead[HS_OVERHEAD_TYPE ] +=1 ;break ;case USB_SPEED_SUPER : +case USB_SPEED_SUPER_PLUS :case USB_SPEED_UNKNOWN :case USB_SPEED_WIRELESS :/* Should never happen because only LS/FS/HS endpoints will get
Greg Kroah-Hartman
maintainerPATCH 19/35 EDAC: Increment correct counter in edac_inc_ue_error()
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Emmanouil Maroudas <[email protected]>
commit 993f88f1cc7f0879047ff353e824e5cc8f10adfc upstream.
Fix typo in edac_inc_ue_error() to increment ue_noinfo_count instead of ce_noinfo_count.
--- drivers/edac/edac_mc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/edac/edac_mc.c +1 -1
@@ -962,7 +962,7 @@ static void edac_inc_ue_error(struct mem mci->ue_mc += count;if (!enable_per_layer_report) { - mci->ce_noinfo_count += count; + mci->ue_noinfo_count += count;return ; }
Greg Kroah-Hartman
maintainerPATCH 20/35 s390/dasd: fix hanging device after clear subchannel
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stefan Haberland <[email protected]>
commit 9ba333dc55cbb9523553df973adb3024d223e905 upstream.
When a device is in a status where CIO has killed all I/O by itself the interrupt for a clear request may not contain an irb to determine the clear function. Instead it contains an error pointer -EIO. This was ignored by the DASD int_handler leading to a hanging device waiting for a clear interrupt.
Handle -EIO error pointer correctly for requests that are clear pending and treat the clear as successful.
--- drivers/s390/block/dasd.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
drivers/s390/block/dasd.c +9 -1
@@ -1613,9 +1613,18 @@ void dasd_int_handler(struct ccw_deviceunsigned long long now;int expires; + cqr = (struct dasd_ccw_req *) intparm;if (IS_ERR (irb)) {switch (PTR_ERR (irb)) {case -EIO : +if (cqr && cqr->status ==DASD_CQR_CLEAR_PENDING ) { + device = (struct dasd_device *) cqr->startdev; + cqr->status =DASD_CQR_CLEARED ; +dasd_device_clear_timer (device); +wake_up (&dasd_flush_wq); +dasd_schedule_device_bh (device); +return ; + }break ;case -ETIMEDOUT : DBF_EVENT_DEVID(DBF_WARNING, cdev, "%s: "
@@ -1631,7 +1640,6 @@ void dasd_int_handler(struct ccw_device } now =get_tod_clock (); - cqr = (struct dasd_ccw_req *) intparm;/* check for conditions that should be handled immediately */ if (!cqr || !(scsw_dstat(&irb->scsw) == (DEV_STAT_CHN_END | DEV_STAT_DEV_END) &&
Greg Kroah-Hartman
maintainerPATCH 21/35 mac80211: fix purging multicast PS buffer queue
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Felix Fietkau <[email protected]>
commit 6b07d9ca9b5363dda959b9582a3fc9c0b89ef3b5 upstream.
The code currently assumes that buffered multicast PS frames don't have a pending ACK frame for tx status reporting.
However, hostapd sends a broadcast deauth frame on teardown for which tx status is requested. This can lead to the "Have pending ack frames" warning on module reload.
Fix this by using ieee80211_free_txskb/ieee80211_purge_tx_queue.
--- net/mac80211/cfg.c | 2 +- net/mac80211/tx.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-)
net/mac80211/cfg.c +1 -1
@@ -1126,7 +1126,7 @@ static int ieee80211_stop_ap(struct wiph/* free all potentially still buffered bcast frames */ local->total_ps_buffered -=skb_queue_len (&sdata->u.ap.ps.bc_buf); -skb_queue_purge (&sdata->u.ap.ps.bc_buf); +ieee80211_purge_tx_queue (&local->hw, &sdata->u.ap.ps.bc_buf);ieee80211_vif_copy_chanctx_to_vlans (sdata, true);mutex_lock (&local->mtx);
net/mac80211/tx.c +3 -3
@@ -351,7 +351,7 @@ static void purge_old_ps_buffers(struct skb =skb_dequeue (&ps->bc_buf);if (skb) { purged++; -dev_kfree_skb (skb); +ieee80211_free_txskb (&local->hw, skb); } total +=skb_queue_len (&ps->bc_buf); }
@@ -434,7 +434,7 @@ ieee80211_tx_h_multicast_ps_buf(struct iif (skb_queue_len (&ps->bc_buf) >=AP_MAX_BC_BUFFER ) {ps_dbg (tx->sdata,"BC TX buffer full - dropping the oldest frame\n" ); -dev_kfree_skb (skb_dequeue (&ps->bc_buf)); +ieee80211_free_txskb (&tx->local->hw,skb_dequeue (&ps->bc_buf)); }else tx->local->total_ps_buffered++;
@@ -2910,7 +2910,7 @@ ieee80211_get_buffered_bc(struct ieee802 sdata =IEEE80211_DEV_TO_SUB_IF (skb->dev);if (!ieee80211_tx_prepare (sdata, &tx, skb))break ; -dev_kfree_skb_any (skb); +ieee80211_free_txskb (hw, skb); } info =IEEE80211_SKB_CB (skb);
Greg Kroah-Hartman
maintainerPATCH 22/35 aacraid: Check size values after double-fetch from user
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dave Carroll <[email protected]>
commit fa00c437eef8dc2e7b25f8cd868cfa405fcc2bb3 upstream.
In aacraid's ioctl_send_fib() we do two fetches from userspace, one the get the fib header's size and one for the fib itself. Later we use the size field from the second fetch to further process the fib. If for some reason the size from the second fetch is different than from the first fix, we may encounter an out-of- bounds access in aac_fib_send(). We also check the sender size to insure it is not out of bounds. This was reported in https://bugzilla.kernel.org/show_bug.cgi?id=116751 and was assigned CVE-2016-6480.
--- drivers/scsi/aacraid/commctrl.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)
drivers/scsi/aacraid/commctrl.c +11 -2
@@ -63,7 +63,7 @@ static int ioctl_send_fib(struct aac_devstruct fib *fibptr;struct hw_fib * hw_fib = (struct hw_fib *)0 ;dma_addr_t hw_fib_pa = (dma_addr_t )0LL ; -unsigned size; +unsigned int size, osize;int retval;if (dev->in_reset) {
@@ -87,7 +87,8 @@ static int ioctl_send_fib(struct aac_dev* will not overrun the buffer when we copy the memory. Return * an error if we would. */ - size =le16_to_cpu (kfib->header.Size) +sizeof (struct aac_fibhdr ); + osize = size =le16_to_cpu (kfib->header.Size) + +sizeof (struct aac_fibhdr );if (size <le16_to_cpu (kfib->header.SenderSize)) size =le16_to_cpu (kfib->header.SenderSize);if (size > dev->max_fib_size) {
@@ -118,6 +119,14 @@ static int ioctl_send_fib(struct aac_dev goto cleanup; } +/* Sanity check the second copy */ +if ((osize !=le16_to_cpu (kfib->header.Size) + +sizeof (struct aac_fibhdr )) + || (size <le16_to_cpu (kfib->header.SenderSize))) { + retval = -EINVAL ; + goto cleanup; + } +if (kfib->header.Command ==cpu_to_le16 (TakeABreakPt)) {aac_adapter_interrupt (dev);/*
Greg Kroah-Hartman
maintainerPATCH 23/35 cdc-acm: fix wrong pipe type on rx interrupt xfers
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gavin Li <[email protected]>
commit add125054b8727103631dce116361668436ef6a7 upstream.
This fixes the "BOGUS urb xfer" warning logged by usb_submit_urb().
--- drivers/usb/class/cdc-acm.c | 5 ++--- drivers/usb/class/cdc-acm.h | 1 - 2 files changed, 2 insertions(+), 4 deletions(-)
drivers/usb/class/cdc-acm.c +2 -3
@@ -1296,7 +1296,6 @@ made_compressed_probe:spin_lock_init (&acm->write_lock);spin_lock_init (&acm->read_lock);mutex_init (&acm->mutex); - acm->rx_endpoint =usb_rcvbulkpipe (usb_dev, epread->bEndpointAddress); acm->is_int_ep =usb_endpoint_xfer_int (epread);if (acm->is_int_ep) acm->bInterval = epread->bInterval;
@@ -1345,14 +1344,14 @@ made_compressed_probe: urb->transfer_dma = rb->dma;if (acm->is_int_ep) {usb_fill_int_urb (urb, acm->dev, - acm->rx_endpoint, +usb_rcvintpipe (usb_dev, epread->bEndpointAddress), rb->base, acm->readsize, acm_read_bulk_callback, rb, acm->bInterval); }else {usb_fill_bulk_urb (urb, acm->dev, - acm->rx_endpoint, +usb_rcvbulkpipe (usb_dev, epread->bEndpointAddress), rb->base, acm->readsize, acm_read_bulk_callback, rb);
drivers/usb/class/cdc-acm.h +0 -1
@@ -95,7 +95,6 @@ struct acm {struct urb *read_urbs[ACM_NR ];struct acm_rb read_buffers[ACM_NR ];int rx_buflimit; -int rx_endpoint;spinlock_t read_lock;int write_used;/* number of non-empty write buffers */ int transmitting;
Greg Kroah-Hartman
maintainerPATCH 24/35 megaraid_sas: Fix probing cards without io port
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yinghai Lu <[email protected]>
commit e7f851684efb3377e9c93aca7fae6e76212e5680 upstream.
Found one megaraid_sas HBA probe fails,
[ 187.235190] scsi host2: Avago SAS based MegaRAID driver [ 191.112365] megaraid_sas 0000:89:00.0: BAR 0: can't reserve [io 0x0000-0x00ff] [ 191.120548] megaraid_sas 0000:89:00.0: IO memory region busy!
and the card has resource like,
[ 125.097714] pci 0000:89:00.0: [1000:005d] type 00 class 0x010400 [ 125.104446] pci 0000:89:00.0: reg 0x10: [io 0x0000-0x00ff] [ 125.110686] pci 0000:89:00.0: reg 0x14: [mem 0xce400000-0xce40ffff 64bit] [ 125.118286] pci 0000:89:00.0: reg 0x1c: [mem 0xce300000-0xce3fffff 64bit] [ 125.125891] pci 0000:89:00.0: reg 0x30: [mem 0xce200000-0xce2fffff pref]
that does not io port resource allocated from BIOS, and kernel can not assign one as io port shortage.
The driver is only looking for MEM, and should not fail.
It turns out megasas_init_fw() etc are using bar index as mask. index 1 is used as mask 1, so that pci_request_selected_regions() is trying to request BAR0 instead of BAR1.
Fix all related reference.
--- drivers/scsi/megaraid/megaraid_sas_base.c | 6 +++--- drivers/scsi/megaraid/megaraid_sas_fusion.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/scsi/megaraid/megaraid_sas_base.c +3 -3
@@ -3624,7 +3624,7 @@ static int megasas_init_fw(struct megasa/* Find first memory bar */ bar_list =pci_select_bars (instance->pdev,IORESOURCE_MEM ); instance->bar =find_first_bit (&bar_list,sizeof (unsigned long )); -if (pci_request_selected_regions (instance->pdev, instance->bar, +if (pci_request_selected_regions (instance->pdev,1 <<instance->bar,"megasas: LSI" )) {printk (KERN_DEBUG "megasas: IO memory region busy!\n" );return -EBUSY ;
@@ -3858,7 +3858,7 @@ fail_ready_state:iounmap (instance->reg_set); fail_ioremap: -pci_release_selected_regions (instance->pdev, instance->bar); +pci_release_selected_regions (instance->pdev,1 <<instance->bar);return -EINVAL ; }
@@ -3879,7 +3879,7 @@ static void megasas_release_mfi(struct miounmap (instance->reg_set); -pci_release_selected_regions (instance->pdev, instance->bar); +pci_release_selected_regions (instance->pdev,1 <<instance->bar); }/**
drivers/scsi/megaraid/megaraid_sas_fusion.c +1 -1
@@ -2175,7 +2175,7 @@ megasas_release_fusion(struct megasas_iniounmap (instance->reg_set); -pci_release_selected_regions (instance->pdev, instance->bar); +pci_release_selected_regions (instance->pdev,1 <<instance->bar); }/**
Greg Kroah-Hartman
maintainerPATCH 25/35 gpio: Fix OF build problem on UM
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Walleij <[email protected]>
commit 2527ecc9195e9c66252af24c4689e8a67cd4ccb9 upstream.
The UserMode (UM) Linux build was failing in gpiolib-of as it requires ioremap()/iounmap() to exist, which is absent from UM. The non-existence of IO memory is negatively defined as CONFIG_NO_IOMEM which means we need to depend on HAS_IOMEM.
--- drivers/gpio/Kconfig | 1 + 1 file changed, 1 insertion(+)
drivers/gpio/Kconfig +1 -0
@@ -50,6 +50,7 @@ config GPIO_DEVRES config OF_GPIO def_bool y depends on OF + depends on HAS_IOMEM config GPIO_ACPI def_bool y
Greg Kroah-Hartman
maintainerPATCH 26/35 fs/seq_file: fix out-of-bounds read
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vegard Nossum <[email protected]>
commit 088bf2ff5d12e2e32ee52a4024fec26e582f44d3 upstream.
seq_read() is a nasty piece of work, not to mention buggy.
It has (I think) an old bug which allows unprivileged userspace to read beyond the end of m->buf.
I was getting these:
BUG: KASAN: slab-out-of-bounds in seq_read+0xcd2/0x1480 at addr ffff880116889880
Read of size 2713 by task trinity-c2/1329
CPU: 2 PID: 1329 Comm: trinity-c2 Not tainted 4.8.0-rc1+ #96
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.9.3-0-ge2fc41e-prebuilt.qemu-project.org 04/01/2014
Call Trace:
kasan_object_err+0x1c/0x80
kasan_report_error+0x2cb/0x7e0
kasan_report+0x4e/0x80
check_memory_region+0x13e/0x1a0
kasan_check_read+0x11/0x20
seq_read+0xcd2/0x1480
proc_reg_read+0x10b/0x260
do_loop_readv_writev.part.5+0x140/0x2c0
do_readv_writev+0x589/0x860
vfs_readv+0x7b/0xd0
do_readv+0xd8/0x2c0
SyS_readv+0xb/0x10
do_syscall_64+0x1b3/0x4b0
entry_SYSCALL64_slow_path+0x25/0x25
Object at ffff880116889100, in cache kmalloc-4096 size: 4096
Allocated:
PID = 1329
save_stack_trace+0x26/0x80
save_stack+0x46/0xd0
kasan_kmalloc+0xad/0xe0
__kmalloc+0x1aa/0x4a0
seq_buf_alloc+0x35/0x40
seq_read+0x7d8/0x1480
proc_reg_read+0x10b/0x260
do_loop_readv_writev.part.5+0x140/0x2c0
do_readv_writev+0x589/0x860
vfs_readv+0x7b/0xd0
do_readv+0xd8/0x2c0
SyS_readv+0xb/0x10
do_syscall_64+0x1b3/0x4b0
return_from_SYSCALL_64+0x0/0x6a
Freed:
PID = 0
(stack is not available)
Memory state around the buggy address:
ffff88011688a000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff88011688a080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff88011688a100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
^
ffff88011688a180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88011688a200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
Disabling lock debugging due to kernel taintThis seems to be the same thing that Dave Jones was seeing here:
https://lkml.org/lkml/2016/8/12/334
There are multiple issues here:
1) If we enter the function with a non-empty buffer, there is an attempt to flush it. But it was not clearing m->from after doing so, which means that if we try to do this flush twice in a row without any call to traverse() in between, we are going to be reading from the wrong place -- the splat above, fixed by this patch.
2) If there's a short write to userspace because of page faults, the buffer may already contain multiple lines (i.e. pos has advanced by more than 1), but we don't save the progress that was made so the next call will output what we've already returned previously. Since that is a much less serious issue (and I have a headache after staring at seq_read() for the past 8 hours), I'll leave that for now.
--- fs/seq_file.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
fs/seq_file.c +3 -1
@@ -207,8 +207,10 @@ ssize_t seq_read(struct file *file, char size -= n; buf += n; copied += n; -if (!m->count) +if (!m->count) { + m->from =0 ; m->index++; + }if (!size) goto Done; }
Greg Kroah-Hartman
maintainerPATCH 27/35 Input: tegra-kbc - fix inverted reset logic
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Masahiro Yamada <[email protected]>
commit fae16989be77b09bab86c79233e4b511ea769cea upstream.
Commit fe6b0dfaba68 ("Input: tegra-kbc - use reset framework") accidentally converted _deassert to _assert, so there is no code to wake up this hardware.
--- drivers/input/keyboard/tegra-kbc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/keyboard/tegra-kbc.c +1 -1
@@ -376,7 +376,7 @@ static int tegra_kbc_start(struct tegra_/* Reset the KBC controller to clear all previous status.*/ reset_control_assert (kbc->rst);udelay (100 ); -reset_control_assert (kbc->rst); +reset_control_deassert (kbc->rst);udelay (100 );tegra_kbc_config_pins (kbc);
Greg Kroah-Hartman
maintainerPATCH 28/35 Input: i8042 - break load dependency between atkbd/psmouse and i8042
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Torokhov <[email protected]>
commit 4097461897df91041382ff6fcd2bfa7ee6b2448c upstream.
As explained in [email protected] we have a hard load dependency between i8042 and atkbd which prevents keyboard from working on Gen2 Hyper-V VMs.
Quoted 6 lines
hyperv_keyboardinvokesserio_interrupt(), which needs a valid serio driver likeatkbd.c.atkbd.cdepends onlibps2.cbecause it invokesps2_command().libps2.cdepends oni8042.cbecause it invokesi8042_check_port_owner(). As a result,hyperv_keyboardactually depends oni8042.c.
Quoted 6 lines
For a Generation 2 Hyper-V VM (meaning no i8042 device emulated), if a Linux VM (like Arch Linux) happens to configure
CONFIG_SERIO_I8042=mrather than =y, atkbd.ko can't load because i8042.ko can't load(due to no i8042 device emulated) and finallyhyperv_keyboardcan't work and the user can't input: https://bugs.archlinux.org/task/39820
(Ubuntu/RHEL/SUSE aren't affected since they useCONFIG_SERIO_I8042=y)
To break the dependency we move away from using i8042_check_port_owner() and instead allow serio port owner specify a mutex that clients should use to serialize PS/2 command stream.
--- drivers/input/serio/i8042.c | 16 +--------------- drivers/input/serio/libps2.c | 10 ++++------ include/linux/i8042.h | 6 ------ include/linux/serio.h | 24 +++++++++++++++++++----- 4 files changed, 24 insertions(+), 32 deletions(-)
drivers/input/serio/i8042.c +1 -15
@@ -1230,6 +1230,7 @@ static int __init i8042_create_kbd_port( serio->start = i8042_start; serio->stop = i8042_stop; serio->close = i8042_port_close; + serio->ps2_cmd_mutex = &i8042_mutex; serio->port_data = port; serio->dev.parent = &i8042_platform_device->dev;strlcpy (serio->name,"i8042 KBD port" ,sizeof (serio->name));
@@ -1321,21 +1322,6 @@ static void i8042_unregister_ports(void) } } -/* -* Checks whether port belongs to i8042 controller. -*/ -bool i8042_check_port_owner (const struct serio *port) -{ -int i; - -for (i =0 ; i <I8042_NUM_PORTS ; i++) -if (i8042_ports[i].serio == port) -return true; - -return false; -} -EXPORT_SYMBOL (i8042_check_port_owner); -static void i8042_free_irqs (void ) {if (i8042_aux_irq_registered)
drivers/input/serio/libps2.c +4 -6
@@ -56,19 +56,17 @@ EXPORT_SYMBOL(ps2_sendbyte);void ps2_begin_command (struct ps2dev *ps2dev) { -mutex_lock (&ps2dev->cmd_mutex); +struct mutex *m = ps2dev->serio->ps2_cmd_mutex ?: &ps2dev->cmd_mutex; -if (i8042_check_port_owner (ps2dev->serio)) -i8042_lock_chip (); +mutex_lock (m); }EXPORT_SYMBOL (ps2_begin_command);void ps2_end_command (struct ps2dev *ps2dev) { -if (i8042_check_port_owner (ps2dev->serio)) -i8042_unlock_chip (); +struct mutex *m = ps2dev->serio->ps2_cmd_mutex ?: &ps2dev->cmd_mutex; -mutex_unlock (&ps2dev->cmd_mutex); +mutex_unlock (m); }EXPORT_SYMBOL (ps2_end_command);
include/linux/i8042.h +0 -6
@@ -62,7 +62,6 @@ struct serio;void i8042_lock_chip (void );void i8042_unlock_chip (void );int i8042_command (unsigned char *param,int command); -bool i8042_check_port_owner (const struct serio *);int i8042_install_filter (bool (*filter)(unsigned char data,unsigned char str,struct serio *serio)); int i8042_remove_filter(bool (*filter)(unsigned char data, unsigned char str,
@@ -83,11 +82,6 @@ static inline int i8042_command(unsignedreturn -ENODEV ; } -static inline bool i8042_check_port_owner (const struct serio *serio) -{ -return false; -} -static inline int i8042_install_filter (bool (*filter)(unsigned char data,unsigned char str,struct serio *serio)) {
include/linux/serio.h +19 -5
@@ -29,7 +29,8 @@ struct serio {struct serio_device_id id; -spinlock_t lock;/* protects critical sections from port's interrupt handler */ +/* Protects critical sections from port's interrupt handler */ +spinlock_t lock;int (*write)(struct serio *,unsigned char );int (*open)(struct serio *);
@@ -38,16 +39,29 @@ struct serio {void (*stop)(struct serio *);struct serio *parent; -struct list_head child_node;/* Entry in parent->children list */ +/* Entry in parent->children list */ +struct list_head child_node;struct list_head children; -unsigned int depth;/* level of nesting in serio hierarchy */ +/* Level of nesting in serio hierarchy */ +unsigned int depth; -struct serio_driver *drv;/* accessed from interrupt, must be protected by serio->lock and serio->sem */ -struct mutex drv_mutex;/* protects serio->drv so attributes can pin driver */ +/* +* serio->drv is accessed from interrupt handlers; when modifying +* caller should acquire serio->drv_mutex and serio->lock. +*/ +struct serio_driver *drv; +/* Protects serio->drv so attributes can pin current driver */ +struct mutex drv_mutex;struct device dev;struct list_head node; + +/* +* For use by PS/2 layer when several ports share hardware and +* may get indigestion when exposed to concurrent access (i8042). +*/ +struct mutex *ps2_cmd_mutex; };#define to_serio_port (d) container_of(d, struct serio, dev)
Greg Kroah-Hartman
maintainerPATCH 29/35 Input: i8042 - set up shared ps2_cmd_mutex for AUX ports
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Torokhov <[email protected]>
commit 47af45d684b5f3ae000ad448db02ce4f13f73273 upstream.
The commit 4097461897df ("Input: i8042 - break load dependency ...") correctly set up ps2_cmd_mutex pointer for the KBD port but forgot to do the same for AUX port(s), which results in communication on KBD and AUX ports to clash with each other.
--- drivers/input/serio/i8042.c | 1 + 1 file changed, 1 insertion(+)
drivers/input/serio/i8042.c +1 -0
@@ -1258,6 +1258,7 @@ static int __init i8042_create_aux_port( serio->write = i8042_aux_write; serio->start = i8042_start; serio->stop = i8042_stop; + serio->ps2_cmd_mutex = &i8042_mutex; serio->port_data = port; serio->dev.parent = &i8042_platform_device->dev;if (idx <0 ) {
Greg Kroah-Hartman
maintainerPATCH 30/35 crypto: nx - off by one bug in nx_of_update_msc()
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Carpenter <[email protected]>
commit e514cc0a492a3f39ef71b31590a7ef67537ee04b upstream.
The props->ap[] array is defined like this:
struct alg_props ap[NX_MAX_FC][NX_MAX_MODE][3];
So we can see that if msc->fc and msc->mode are == to NX_MAX_FC or NX_MAX_MODE then we're off by one.
--- drivers/crypto/nx/nx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/crypto/nx/nx.c +1 -1
@@ -330,7 +330,7 @@ static void nx_of_update_msc(struct devi ((bytes_so_far +sizeof (struct msc_triplet )) <= lenp) && i < msc->triplets; i++) { -if (msc->fc >NX_MAX_FC || msc->mode >NX_MAX_MODE ) { +if (msc->fc >=NX_MAX_FC || msc->mode >=NX_MAX_MODE ) {dev_err (dev,"unknown function code/mode " "combo: %d/%d (ignored)\n" , msc->fc, msc->mode);
Greg Kroah-Hartman
maintainerPATCH 31/35 USB: fix typo in wMaxPacketSize validation
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alan Stern <[email protected]>
commit 6c73358c83ce870c0cf32413e5cadb3b9a39c606 upstream.
The maximum value allowed for wMaxPacketSize of a high-speed interrupt endpoint is 1024 bytes, not 1023.
--- drivers/usb/core/config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/core/config.c +1 -1
@@ -159,7 +159,7 @@ static const unsigned short high_speed_m [USB_ENDPOINT_XFER_CONTROL] = 64, [USB_ENDPOINT_XFER_ISOC] = 1024, [USB_ENDPOINT_XFER_BULK] = 512, - [USB_ENDPOINT_XFER_INT] = 1023, + [USB_ENDPOINT_XFER_INT] = 1024, };static const unsigned short super_speed_maxpacket_maxes[4 ] = { [USB_ENDPOINT_XFER_CONTROL ] =512 ,
Greg Kroah-Hartman
maintainerPATCH 32/35 USB: serial: mos7720: fix non-atomic allocation in write path
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexey Khoroshilov <[email protected]>
commit 5a5a1d614287a647b36dff3f40c2b0ceabbc83ec upstream.
There is an allocation with GFP_KERNEL flag in mos7720_write(), while it may be called from interrupt context.
Follow-up for commit 191252837626 ("USB: kobil_sct: fix non-atomic allocation in write path")
Found by Linux Driver Verification project (linuxtesting.org).
--- drivers/usb/serial/mos7720.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/serial/mos7720.c +1 -1
@@ -1239,7 +1239,7 @@ static int mos7720_write(struct tty_struif (urb->transfer_buffer ==NULL ) { urb->transfer_buffer =kmalloc (URB_TRANSFER_BUFFER_SIZE , -GFP_KERNEL ); +GFP_ATOMIC );if (!urb->transfer_buffer) goto exit; }
Greg Kroah-Hartman
maintainerPATCH 33/35 USB: serial: mos7840: fix non-atomic allocation in write path
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexey Khoroshilov <[email protected]>
commit 3b7c7e52efda0d4640060de747768360ba70a7c0 upstream.
There is an allocation with GFP_KERNEL flag in mos7840_write(), while it may be called from interrupt context.
Follow-up for commit 191252837626 ("USB: kobil_sct: fix non-atomic allocation in write path")
Found by Linux Driver Verification project (linuxtesting.org).
--- drivers/usb/serial/mos7840.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/usb/serial/mos7840.c +2 -2
@@ -1372,8 +1372,8 @@ static int mos7840_write(struct tty_stru }if (urb->transfer_buffer ==NULL ) { - urb->transfer_buffer = -kmalloc (URB_TRANSFER_BUFFER_SIZE ,GFP_KERNEL ); + urb->transfer_buffer =kmalloc (URB_TRANSFER_BUFFER_SIZE , +GFP_ATOMIC );if (!urb->transfer_buffer) goto exit; }
Greg Kroah-Hartman
maintainerPATCH 34/35 staging: comedi: daqboard2000: bug fix board type matching code
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ian Abbott <[email protected]>
commit 80e162ee9b31d77d851b10f8c5299132be1e120f upstream.
daqboard2000_find_boardinfo() is supposed to check if the DaqBoard/2000 series model is supported, based on the PCI subvendor and subdevice ID. The current code is wrong as it is comparing the PCI device's subdevice ID to an expected, fixed value for the subvendor ID. It should be comparing the PCI device's subvendor ID to this fixed value. Correct it.
--- drivers/staging/comedi/drivers/daqboard2000.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/comedi/drivers/daqboard2000.c +1 -1
@@ -658,7 +658,7 @@ static const void *daqboard2000_find_boaconst struct daq200_boardtype *board;int i; -if (pcidev->subsystem_device !=PCI_VENDOR_ID_IOTECH ) +if (pcidev->subsystem_vendor !=PCI_VENDOR_ID_IOTECH )return NULL ;for (i =0 ; i <ARRAY_SIZE (boardtypes); i++) {
Greg Kroah-Hartman
maintainerPATCH 35/35 ACPI / sysfs: fix error code in get_status()
In reply to Greg Kroah-Hartman3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Carpenter <[email protected]>
commit f18ebc211e259d4f591e39e74b2aa2de226c9a1d upstream.
The problem with ornamental, do-nothing gotos is that they lead to "forgot to set the error code" bugs. We should be returning -EINVAL here but we don't. It leads to an uninitalized variable in counter_show():
drivers/acpi/sysfs.c:603 counter_show()
error: uninitialized symbol 'status'.
--- drivers/acpi/sysfs.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/acpi/sysfs.c +3 -4
@@ -494,23 +494,22 @@ static void acpi_global_event_handler(u3static int get_status (u32 index,acpi_event_status *status,acpi_handle *handle) { -int result =0 ; +int result;if (index >= num_gpes +ACPI_NUM_FIXED_EVENTS ) - goto end; +return -EINVAL ;if (index < num_gpes) { result =acpi_get_gpe_device (index, handle);if (result) {ACPI_EXCEPTION ((AE_INFO ,AE_NOT_FOUND ,"Invalid GPE 0x%x" , index)); - goto end; +return result; } result =acpi_get_gpe_status (*handle, index, status); }else if (index < (num_gpes +ACPI_NUM_FIXED_EVENTS )) result =acpi_get_event_status (index - num_gpes, status); -end:return result; }
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 3.14.78 release. There are 35 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed Sep 7 16:39:50 UTC 2016. Anything received after that time might be too late.
Build results:
total: 131 pass: 131 fail: 0 Qemu test results: total: 89 pass: 89 fail: 0
Details are available at http://kerneltests.org/builders.
Guenter
Quoted 14 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 3.14.78 release. There are 35 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed Sep 7 16:39:50 UTC 2016. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
kernel.org/pub/linux/kernel/v3.x/stable-review/patch-3.14.78-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-3.14.y
and the diffstat can be found below.
Quoted 5 lines
thanks,
greg k-h
-------------
Compiled and booted on my test system. No dmesg regressions.
thanks,
-- Shuah
Signature · 5 lines
Shuah Khan Sr. Linux Kernel Developer Open Source Innovation Group Samsung Research America(Silicon Valley) [email protected]