[PATCH 5.3 005/112] USB: usb-skeleton: fix runtime PM after driver unbind

2019-10-16 Thread Greg Kroah-Hartman
From: Johan Hovold commit 5c290a5e42c3387e82de86965784d30e6c5270fd upstream. Since commit c2b71462d294 ("USB: core: Fix bug caused by duplicate interface PM usage counter") USB drivers must always balance their runtime PM gets and puts, including when the driver has already been unbound from

[PATCH 5.3 092/112] RDMA/vmw_pvrdma: Free SRQ only once

2019-10-16 Thread Greg Kroah-Hartman
From: Adit Ranadive commit 18545e8b6871d21aa3386dc42867138da9948a33 upstream. An extra kfree cleanup was missed since these are now deallocated by core. Link: https://lore.kernel.org/r/1568848066-12449-1-git-send-email-ad...@vmware.com Cc: Fixes: 68e326dea1db ("RDMA: Handle SRQ allocations

[PATCH 5.3 085/112] btrfs: fix balance convert to single on 32-bit host CPUs

2019-10-16 Thread Greg Kroah-Hartman
From: Zygo Blaxell commit 7a54789074a54f64addf5b49bf1994f478337a83 upstream. Currently, the command: btrfs balance start -dconvert=single,soft . on a Raspberry Pi produces the following kernel message: BTRFS error (device mmcblk0p2): balance: invalid convert data profile

[PATCH 5.3 022/112] USB: chaoskey: fix use-after-free on release

2019-10-16 Thread Greg Kroah-Hartman
From: Johan Hovold commit 93ddb1f56ae102f14f9e46a9a9c8017faa970003 upstream. The driver was accessing its struct usb_interface in its release() callback without holding a reference. This would lead to a use-after-free whenever the device was disconnected while the character device was still

[PATCH 5.3 094/112] arm64: topology: Use PPTT to determine if PE is a thread

2019-10-16 Thread Greg Kroah-Hartman
From: Jeremy Linton Commit 98dc19902a0b2e5348e43d6a2c39a0a7d0fc639e upstream. ACPI 6.3 adds a thread flag to represent if a CPU/PE is actually a thread. Given that the MPIDR_MT bit may not represent this information consistently on homogeneous machines we should prefer the PPTT flag if its

[PATCH 5.3 089/112] NFS: Fix O_DIRECT accounting of number of bytes read/written

2019-10-16 Thread Greg Kroah-Hartman
From: Trond Myklebust commit 031d73ed768a40684f3ca21992265ffdb6a270bf upstream. When a series of O_DIRECT reads or writes are truncated, either due to eof or due to an error, then we should return the number of contiguous bytes that were received/sent starting at the offset specified by the

[PATCH 5.3 009/112] xhci: Check all endpoints for LPM timeout

2019-10-16 Thread Greg Kroah-Hartman
From: Jan Schmidt commit d500c63f80f2ea08ee300e57da5f2af1c13875f5 upstream. If an endpoint is encountered that returns USB3_LPM_DEVICE_INITIATED, keep checking further endpoints, as there might be periodic endpoints later that return USB3_LPM_DISABLED due to shorter service intervals. Without

[PATCH 5.3 078/112] mm/vmpressure.c: fix a signedness bug in vmpressure_register_event()

2019-10-16 Thread Greg Kroah-Hartman
From: Dan Carpenter commit 518a86713078168acd67cf50bc0b45d54b4cce6c upstream. The "mode" and "level" variables are enums and in this context GCC will treat them as unsigned ints so the error handling is never triggered. I also removed the bogus initializer because it isn't required any more

[PATCH 5.3 081/112] gpio: fix getting nonexclusive gpiods from DT

2019-10-16 Thread Greg Kroah-Hartman
From: Marco Felsch [ Upstream commit be7ae45cfea97e787234e00e1a9eb341acacd84e ] Since commit ec757001c818 ("gpio: Enable nonexclusive gpiods from DT nodes") we are able to get GPIOD_FLAGS_BIT_NONEXCLUSIVE marked gpios. Currently the gpiolib uses the wrong flags variable for the check. We need

[PATCH 5.3 082/112] gpiolib: dont clear FLAG_IS_OUT when emulating open-drain/open-source

2019-10-16 Thread Greg Kroah-Hartman
From: Bartosz Golaszewski [ Upstream commit e735244e2cf068f98b6384681a38993e0517a838 ] When emulating open-drain/open-source by not actively driving the output lines - we're simply changing their mode to input. This is wrong as it will then make it impossible to change the value of such line -

[PATCH 5.3 019/112] USB: iowarrior: fix use-after-free on release

2019-10-16 Thread Greg Kroah-Hartman
From: Johan Hovold commit 80cd5479b525093a56ef768553045741af61b250 upstream. The driver was accessing its struct usb_interface from its release() callback without holding a reference. This would lead to a use-after-free whenever debugging was enabled and the device was disconnected while its

[PATCH 5.3 012/112] xhci: Prevent deadlock when xhci adapter breaks during init

2019-10-16 Thread Greg Kroah-Hartman
From: Bill Kuzeja commit 8de66b0e6a56ff10dd00d2b0f2ae52e300178587 upstream. The system can hit a deadlock if an xhci adapter breaks while initializing. The deadlock is between two threads: thread 1 is tearing down the adapter and is stuck in usb_unlocked_disable_lpm waiting to lock the

[PATCH 5.3 067/112] perf inject jit: Fix JIT_CODE_MOVE filename

2019-10-16 Thread Greg Kroah-Hartman
From: Steve MacLean commit b59711e9b0d22fd47abfa00602fd8c365cdd3ab7 upstream. During perf inject --jit, JIT_CODE_MOVE records were injecting MMAP records with an incorrect filename. Specifically it was missing the ".so" suffix. Further the JIT_CODE_LOAD record were silently truncating the

[PATCH 5.3 017/112] USB: adutux: fix use-after-free on release

2019-10-16 Thread Greg Kroah-Hartman
From: Johan Hovold commit 123a0f125fa3d2104043697baa62899d9e549272 upstream. The driver was accessing its struct usb_device in its release() callback without holding a reference. This would lead to a use-after-free whenever the device was disconnected while the character device was still open.

[PATCH 5.3 027/112] USB: serial: ftdi_sio: add device IDs for Sienna and Echelon PL-20

2019-10-16 Thread Greg Kroah-Hartman
From: Beni Mahler commit 357f16d9e0194cdbc36531ff88b453481560b76a upstream. Both devices added here have a FTDI chip inside. The device from Echelon is called 'Network Interface' it is actually a LON network gateway. ID 0403:8348 Future Technology Devices International, Ltd

Re: [PATCH -next] iommu/amd: fix a warning in increase_address_space

2019-10-16 Thread Jerry Snitselaar
On Wed Oct 16 19, Qian Cai wrote: After the commit 754265bcab78 ("iommu/amd: Fix race in increase_address_space()"), it could still possible trigger a race condition under some heavy memory pressure below. The race to trigger a warning is, CPU0: CPU1: in alloc_pte():

[PATCH 5.3 026/112] USB: serial: keyspan: fix NULL-derefs on open() and write()

2019-10-16 Thread Greg Kroah-Hartman
From: Johan Hovold commit 7d7e21fafdbc7fcf0854b877bd0975b487ed2717 upstream. Fix NULL-pointer dereferences on open() and write() which can be triggered by a malicious USB device. The current URB allocation helper would fail to initialise the newly allocated URB if the device has unexpected

[PATCH 5.3 061/112] iio: accel: adxl372: Perform a reset at start up

2019-10-16 Thread Greg Kroah-Hartman
From: Stefan Popa commit d9a997bd4d762d5bd8cc548d762902f58b5e0a74 upstream. We need to perform a reset a start up to make sure that the chip is in a consistent state. This reset also disables all the interrupts which should only be enabled together with the iio buffer. Not doing this, was

[PATCH 5.3 059/112] iio: accel: adxl372: Fix/remove limitation for FIFO samples

2019-10-16 Thread Greg Kroah-Hartman
From: Stefan Popa commit d202ce4787e446556c6b9d01f84734c3f8174ba3 upstream. Currently, the driver sets the FIFO_SAMPLES register with the number of sample sets (maximum of 170 for 3 axis data, 256 for 2-axis and 512 for single axis). However, the FIFO_SAMPLES register should store the number of

[PATCH 5.3 010/112] xhci: Fix USB 3.1 capability detection on early xHCI 1.1 spec based hosts

2019-10-16 Thread Greg Kroah-Hartman
From: Mathias Nyman commit 47f50d61076523e1a0d5a070062c2311320eeca8 upstream. Early xHCI 1.1 spec did not mention USB 3.1 capable hosts should set sbrn to 0x31, or that the minor revision is a two digit BCD containing minor and sub-minor numbers. This was later clarified in xHCI 1.2. Some USB

[PATCH 5.3 060/112] iio: accel: adxl372: Fix push to buffers lost samples

2019-10-16 Thread Greg Kroah-Hartman
From: Stefan Popa commit 62df81b74393079debf04961c48cb22268fc5fab upstream. One in two sample sets was lost by multiplying fifo_set_size with sizeof(u16). Also, the double number of available samples were pushed to the iio buffers. Signed-off-by: Stefan Popa Fixes: f4f55ce38e5f ("iio:adxl372:

[PATCH 4.19 45/81] iio: adc: hx711: fix bug in sampling of data

2019-10-16 Thread Greg Kroah-Hartman
From: Andreas Klinger commit 4043ecfb5fc4355a090111e14faf7945ff0fdbd5 upstream. Fix bug in sampling function hx711_cycle() when interrupt occures while PD_SCK is high. If PD_SCK is high for at least 60 us power down mode of the sensor is entered which in turn leads to a wrong measurement.

[PATCH 5.3 058/112] iio: light: add missing vcnl4040 of_compatible

2019-10-16 Thread Greg Kroah-Hartman
From: Marco Felsch commit 7fd1c2606508eb384992251e87d50591393a48d0 upstream. Commit 5a441aade5b3 ("iio: light: vcnl4000 add support for the VCNL4040 proximity and light sensor") added the support for the vcnl4040 but forgot to add the of_compatible. Fix this by adding it now. Signed-off-by:

[PATCH 4.19 72/81] media: stkwebcam: fix runtime PM after driver unbind

2019-10-16 Thread Greg Kroah-Hartman
From: Johan Hovold commit 30045f2174aab7fb4db7a9cf902d0aa6c75856a7 upstream. Since commit c2b71462d294 ("USB: core: Fix bug caused by duplicate interface PM usage counter") USB drivers must always balance their runtime PM gets and puts, including when the driver has already been unbound from

[PATCH 5.3 057/112] iio: light: opt3001: fix mutex unlock race

2019-10-16 Thread Greg Kroah-Hartman
From: David Frey commit 82f3015635249a8c8c45bac303fd84905066f04f upstream. When an end-of-conversion interrupt is received after performing a single-shot reading of the light sensor, the driver was waking up the result ready queue before checking opt->ok_to_ignore_lock to determine if it should

[PATCH 4.19 80/81] PCI: vmd: Fix config addressing when using bus offsets

2019-10-16 Thread Greg Kroah-Hartman
From: Jon Derrick commit e3dffa4f6c3612dea337c9c59191bd418afc941b upstream. VMD maps child device config spaces to the VMD Config BAR linearly regardless of the starting bus offset. Because of this, the config address decode must ignore starting bus offsets when mapping the BDF to the config

[PATCH 5.3 053/112] iio: adc: ad799x: fix probe error handling

2019-10-16 Thread Greg Kroah-Hartman
From: Marco Felsch commit c62dd44901cfff12acc5792bf3d2dec20bcaf392 upstream. Since commit 0f7ddcc1bff1 ("iio:adc:ad799x: Write default config on probe and reset alert status on probe") the error path is wrong since it leaves the vref regulator on. Fix this by disabling both regulators. Fixes:

[PATCH 4.19 41/81] mei: avoid FW version request on Ibex Peak and earlier

2019-10-16 Thread Greg Kroah-Hartman
From: Alexander Usyskin commit f8204f0ddd62966a0e79c2804963a21e3540dd82 upstream. The fixed MKHI client on PCH 6 gen platforms does not support fw version retrieval. The error is not fatal, but it fills up the kernel logs and slows down the driver start. This patch disables requesting FW

[PATCH 5.3 054/112] iio: adc: axp288: Override TS pin bias current for some models

2019-10-16 Thread Greg Kroah-Hartman
From: Hans de Goede commit 972917419a0ba25afbf69d5d8c9fa644d676f887 upstream. Since commit 9bcf15f75cac ("iio: adc: axp288: Fix TS-pin handling") we preserve the bias current set by the firmware at boot. This fixes issues we were seeing on various models, but it seems our old hardcoded 80ųA

[PATCH 4.19 81/81] perf/hw_breakpoint: Fix arch_hw_breakpoint use-before-initialization

2019-10-16 Thread Greg Kroah-Hartman
From: Mark-PK Tsai commit 310aa0a25b338b3100c94880c9a69bec8ce8c3ae upstream. If we disable the compiler's auto-initialization feature, if -fplugin-arg-structleak_plugin-byref or -ftrivial-auto-var-init=pattern are disabled, arch_hw_breakpoint may be used before initialization after:

[PATCH 5.3 048/112] staging: bcm2835-audio: Fix draining behavior regression

2019-10-16 Thread Greg Kroah-Hartman
From: Takashi Iwai commit 2eed19b99c8e95ff87afe6c140ed895c3fac5937 upstream. The PCM draining behavior got broken since the recent refactoring, and this turned out to be the incorrect expectation of the firmware behavior regarding "draining". While I expected the "drain" flag at the stop

[PATCH 5.3 046/112] gpio: eic: sprd: Fix the incorrect EIC offset when toggling

2019-10-16 Thread Greg Kroah-Hartman
From: Bruce Chen commit e91aafcb51f3c5001ae76c3ee027beb0b8506447 upstream. When toggling the level trigger to emulate the edge trigger, the EIC offset is incorrect without adding the corresponding bank index, thus fix it. Fixes: 7bf0d7f62282 ("gpio: eic: Add edge trigger emulation for EIC")

[PATCH 5.3 047/112] staging/fbtft: Depend on OF

2019-10-16 Thread Greg Kroah-Hartman
From: Noralf Trønnes commit 63f2b1677fba11c5bd02089f25c13421948905f5 upstream. Commit c440eee1a7a1 ("Staging: fbtft: Switch to the gpio descriptor interface") removed setting gpios via platform data. This means that fbtft will now only work with Device Tree so set the dependency. This also

[PATCH 4.19 59/81] gpiolib: dont clear FLAG_IS_OUT when emulating open-drain/open-source

2019-10-16 Thread Greg Kroah-Hartman
From: Bartosz Golaszewski [ Upstream commit e735244e2cf068f98b6384681a38993e0517a838 ] When emulating open-drain/open-source by not actively driving the output lines - we're simply changing their mode to input. This is wrong as it will then make it impossible to change the value of such line -

[PATCH 5.3 035/112] usb: renesas_usbhs: gadget: Fix usb_ep_set_{halt,wedge}() behavior

2019-10-16 Thread Greg Kroah-Hartman
From: Yoshihiro Shimoda commit 4d599cd3a097a85a5c68a2c82b9a48cddf9953ec upstream. According to usb_ep_set_halt()'s description, __usbhsg_ep_set_halt_wedge() should return -EAGAIN if the IN endpoint has any queue or data. Otherwise, this driver is possible to cause just STALL without sending a

[PATCH 5.3 007/112] xhci: Fix false warning message about wrong bounce buffer write length

2019-10-16 Thread Greg Kroah-Hartman
From: Mathias Nyman commit c03101ff4f74bb30679c1a03d551ecbef1024bf6 upstream. The check printing out the "WARN Wrong bounce buffer write length:" uses incorrect values when comparing bytes written from scatterlist to bounce buffer. Actual copied lengths are fine. The used seg->bounce_len will

[PATCH 5.3 023/112] USB: ldusb: fix NULL-derefs on driver unbind

2019-10-16 Thread Greg Kroah-Hartman
From: Johan Hovold commit 58ecf131e74620305175a7aa103f81350bb37570 upstream. The driver was using its struct usb_interface pointer as an inverted disconnected flag, but was setting it to NULL before making sure all completion handlers had run. This could lead to a NULL-pointer dereference in a

[PATCH 5.3 039/112] USB: legousbtower: fix slab info leak at probe

2019-10-16 Thread Greg Kroah-Hartman
From: Johan Hovold commit 1d427be4a39defadda6dd8f4659bc17f7591740f upstream. Make sure to check for short transfers when retrieving the version information at probe to avoid leaking uninitialised slab data when logging it. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Cc: stable Signed-off-by:

[PATCH 5.3 037/112] usb: typec: ucsi: ccg: Remove run_isr flag

2019-10-16 Thread Greg Kroah-Hartman
From: Heikki Krogerus commit 8530e4e20ec2355c273f4dba9002969e68275e5f upstream. The "run_isr" flag is used for preventing the driver from calling the interrupt service routine in its runtime resume callback when the driver is expecting completion to a command, but what that basically does is

[PATCH 5.3 006/112] USB: usb-skeleton: fix NULL-deref on disconnect

2019-10-16 Thread Greg Kroah-Hartman
From: Johan Hovold commit bed5ef230943863b9abf5eae226a20fad9a8ff71 upstream. The driver was using its struct usb_interface pointer as an inverted disconnected flag and was setting it to NULL before making sure all completion handlers had run. This could lead to NULL-pointer dereferences in the

[PATCH 5.3 031/112] USB: usblcd: fix I/O after disconnect

2019-10-16 Thread Greg Kroah-Hartman
From: Johan Hovold commit eb7f5a490c5edfe8126f64bc58b9ba2edef0a425 upstream. Make sure to stop all I/O on disconnect by adding a disconnected flag which is used to prevent new I/O from being started and by stopping all ongoing I/O before returning. This also fixes a potential use-after-free on

[PATCH 4.19 39/81] USB: legousbtower: fix use-after-free on release

2019-10-16 Thread Greg Kroah-Hartman
From: Johan Hovold commit 726b55d0e22ca72c69c947af87785c830289ddbc upstream. The driver was accessing its struct usb_device in its release() callback without holding a reference. This would lead to a use-after-free whenever the device was disconnected while the character device was still open.

[PATCH 5.3 042/112] USB: legousbtower: fix open after failed reset request

2019-10-16 Thread Greg Kroah-Hartman
From: Johan Hovold commit 0b074f6986751361ff442bc1127c1648567aa8d6 upstream. The driver would return with a nonzero open count in case the reset control request failed. This would prevent any further attempts to open the char dev until the device was disconnected. Fix this by incrementing the

[PATCH 5.3 034/112] usb: renesas_usbhs: gadget: Do not discard queues in usb_ep_set_{halt,wedge}()

2019-10-16 Thread Greg Kroah-Hartman
From: Yoshihiro Shimoda commit 1aae1394294cb71c6aa0bc904a94a7f2f1e75936 upstream. The commit 97664a207bc2 ("usb: renesas_usbhs: shrink spin lock area") had added a usbhsg_pipe_disable() calling into __usbhsg_ep_set_halt_wedge() accidentally. But, this driver should not call the

[PATCH 5.3 038/112] usb: typec: ucsi: displayport: Fix for the mode entering routine

2019-10-16 Thread Greg Kroah-Hartman
From: Heikki Krogerus commit f2372b87c386871b16d7dbda680d98d4092ab708 upstream. Making sure that ucsi_displayport_enter() function does not return an error if the displayport alternate mode has already been entered. It's normal that the firmware (or controller) has already entered the alternate

[PATCH 5.3 040/112] USB: legousbtower: fix deadlock on disconnect

2019-10-16 Thread Greg Kroah-Hartman
From: Johan Hovold commit 33a7813219f208f4952ece60ee255fd983272dec upstream. Fix a potential deadlock if disconnect races with open. Since commit d4ead16f50f9 ("USB: prevent char device open/deregister race") core holds an rw-semaphore while open is called and when releasing the minor number

[PATCH 4.19 70/81] arm64: topology: Use PPTT to determine if PE is a thread

2019-10-16 Thread Greg Kroah-Hartman
From: Jeremy Linton Commit 98dc19902a0b2e5348e43d6a2c39a0a7d0fc639e upstream. ACPI 6.3 adds a thread flag to represent if a CPU/PE is actually a thread. Given that the MPIDR_MT bit may not represent this information consistently on homogeneous machines we should prefer the PPTT flag if its

[PATCH 4.19 08/81] xhci: Fix false warning message about wrong bounce buffer write length

2019-10-16 Thread Greg Kroah-Hartman
From: Mathias Nyman commit c03101ff4f74bb30679c1a03d551ecbef1024bf6 upstream. The check printing out the "WARN Wrong bounce buffer write length:" uses incorrect values when comparing bytes written from scatterlist to bounce buffer. Actual copied lengths are fine. The used seg->bounce_len will

[PATCH 5.3 020/112] USB: iowarrior: fix use-after-free after driver unbind

2019-10-16 Thread Greg Kroah-Hartman
From: Johan Hovold commit b5f8d46867ca233d773408ffbe691a8062ed718f upstream. Make sure to stop also the asynchronous write URBs on disconnect() to avoid use-after-free in the completion handler after driver unbind. Fixes: 946b960d13c1 ("USB: add driver for iowarrior devices.") Cc: stable

[PATCH 5.3 016/112] USB: adutux: fix NULL-derefs on disconnect

2019-10-16 Thread Greg Kroah-Hartman
From: Johan Hovold commit b2fa7baee744fde746c17bc1860b9c6f5c2eebb7 upstream. The driver was using its struct usb_device pointer as an inverted disconnected flag, but was setting it to NULL before making sure all completion handlers had run. This could lead to a NULL-pointer dereference in a

[PATCH 5.3 014/112] xhci: Fix NULL pointer dereference in xhci_clear_tt_buffer_complete()

2019-10-16 Thread Greg Kroah-Hartman
From: Mathias Nyman commit cfbb8a84c2d2ef49bccacb511002bca4f6053555 upstream. udev stored in ep->hcpriv might be NULL if tt buffer is cleared due to a halted control endpoint during device enumeration xhci_clear_tt_buffer_complete is called by hub_tt_work() once it's scheduled, and by then

[PATCH 5.3 018/112] USB: iowarrior: fix use-after-free on disconnect

2019-10-16 Thread Greg Kroah-Hartman
From: Johan Hovold commit edc4746f253d907d048de680a621e121517f484b upstream. A recent fix addressing a deadlock on disconnect introduced a new bug by moving the present flag out of the critical section protected by the driver-data mutex. This could lead to a racing release() freeing the driver

[PATCH 5.3 015/112] USB: adutux: fix use-after-free on disconnect

2019-10-16 Thread Greg Kroah-Hartman
From: Johan Hovold commit 44efc269db7929f6275a1fa927ef082e533ecde0 upstream. The driver was clearing its struct usb_device pointer, which it used as an inverted disconnected flag, before deregistering the character device and without serialising against racing release(). This could lead to a

[PATCH 4.19 37/81] USB: legousbtower: fix potential NULL-deref on disconnect

2019-10-16 Thread Greg Kroah-Hartman
From: Johan Hovold commit cd81e6fa8e033e7bcd59415b4a65672b4780030b upstream. The driver is using its struct usb_device pointer as an inverted disconnected flag, but was setting it to NULL before making sure all completion handlers had run. This could lead to a NULL-pointer dereference in a

[PATCH 5.3 002/112] USB: rio500: Remove Rio 500 kernel driver

2019-10-16 Thread Greg Kroah-Hartman
From: Bastien Nocera commit 015664d15270a112c2371d812f03f7c579b35a73 upstream. The Rio500 kernel driver has not been used by Rio500 owners since 2001 not long after the rio500 project added support for a user-space USB stack through the very first versions of usbdevfs and then libusb. Support

[PATCH 4.19 36/81] USB: legousbtower: fix deadlock on disconnect

2019-10-16 Thread Greg Kroah-Hartman
From: Johan Hovold commit 33a7813219f208f4952ece60ee255fd983272dec upstream. Fix a potential deadlock if disconnect races with open. Since commit d4ead16f50f9 ("USB: prevent char device open/deregister race") core holds an rw-semaphore while open is called and when releasing the minor number

[PATCH 4.19 44/81] staging: vt6655: Fix memory leak in vt6655_probe

2019-10-16 Thread Greg Kroah-Hartman
From: Navid Emamdoost commit 80b15db5e1e9c3300de299b2d43d1aafb593e6ac upstream. In vt6655_probe, if vnt_init() fails the cleanup code needs to be called like other error handling cases. The call to device_free_info() is added. Fixes: 67013f2c0e58 ("staging: vt6655: mac80211 conversion add main

[PATCH 4.19 22/81] USB: chaoskey: fix use-after-free on release

2019-10-16 Thread Greg Kroah-Hartman
From: Johan Hovold commit 93ddb1f56ae102f14f9e46a9a9c8017faa970003 upstream. The driver was accessing its struct usb_interface in its release() callback without holding a reference. This would lead to a use-after-free whenever the device was disconnected while the character device was still

[PATCH 4.19 43/81] Staging: fbtft: fix memory leak in fbtft_framebuffer_alloc

2019-10-16 Thread Greg Kroah-Hartman
From: Navid Emamdoost commit 5bdea6060618cfcf1459dca137e89aee038ac8b9 upstream. In fbtft_framebuffer_alloc the error handling path should take care of releasing frame buffer after it is allocated via framebuffer_alloc, too. Therefore, in two failure cases the goto destination is changed to

[PATCH 4.19 78/81] hwmon: Fix HWMON_P_MIN_ALARM mask

2019-10-16 Thread Greg Kroah-Hartman
From: Nuno Sá commit 30945d31e5761436d9eba6b8cff468a5f7c9c266 upstream. Both HWMON_P_MIN_ALARM and HWMON_P_MAX_ALARM were using BIT(hwmon_power_max_alarm). Fixes: aa7f29b07c870 ("hwmon: Add support for power min, lcrit, min_alarm and lcrit_alarm") CC: Signed-off-by: Nuno Sá Link:

[PATCH 4.19 40/81] mei: me: add comet point (lake) LP device ids

2019-10-16 Thread Greg Kroah-Hartman
From: Tomas Winkler commit 4d86dfd38285c83a6df01093b8547f742e3b2470 upstream. Add Comet Point devices IDs for Comet Lake U platforms. Cc: Signed-off-by: Tomas Winkler Link: https://lore.kernel.org/r/20191001235958.19979-1-tomas.wink...@intel.com Signed-off-by: Greg Kroah-Hartman ---

[PATCH 4.19 42/81] gpio: eic: sprd: Fix the incorrect EIC offset when toggling

2019-10-16 Thread Greg Kroah-Hartman
From: Bruce Chen commit e91aafcb51f3c5001ae76c3ee027beb0b8506447 upstream. When toggling the level trigger to emulate the edge trigger, the EIC offset is incorrect without adding the corresponding bank index, thus fix it. Fixes: 7bf0d7f62282 ("gpio: eic: Add edge trigger emulation for EIC")

[PATCH 4.19 74/81] tracing/hwlat: Report total time spent in all NMIs during the sample

2019-10-16 Thread Greg Kroah-Hartman
From: Srivatsa S. Bhat (VMware) commit 98dc19c11470ee6048aba723d77079ad2cda8a52 upstream. nmi_total_ts is supposed to record the total time spent in *all* NMIs that occur on the given CPU during the (active portion of the) sampling window. However, the code seems to be overwriting this variable

[PATCH 4.19 68/81] ACPICA: ACPI 6.3: PPTT add additional fields in Processor Structure Flags

2019-10-16 Thread Greg Kroah-Hartman
From: Erik Schmauss Commit b5eab512e7cffb2bb37c4b342b5594e9e75fd486 upstream. ACPICA commit c736ea34add19a3a07e0e398711847cd6b95affd Link: https://github.com/acpica/acpica/commit/c736ea34 Signed-off-by: Erik Schmauss Signed-off-by: Bob Moore Signed-off-by: Rafael J. Wysocki Signed-off-by:

[PATCH 4.19 69/81] ACPI/PPTT: Add support for ACPI 6.3 thread flag

2019-10-16 Thread Greg Kroah-Hartman
From: Jeremy Linton Commit bbd1b70639f785a970d998f35155c713f975e3ac upstream. ACPI 6.3 adds a flag to the CPU node to indicate whether the given PE is a thread. Add a function to return that information for a given linux logical CPU. Signed-off-by: Jeremy Linton Reviewed-by: Sudeep Holla

[PATCH 4.19 73/81] arm64/sve: Fix wrong free for task->thread.sve_state

2019-10-16 Thread Greg Kroah-Hartman
From: Masayoshi Mizuma commit 4585fc59c0e813188d6a4c5de1f6976fce461fc2 upstream. The system which has SVE feature crashed because of the memory pointed by task->thread.sve_state was destroyed by someone. That is because sve_state is freed while the forking the child process. The child process

[PATCH 4.19 71/81] Fix the locking in dcache_readdir() and friends

2019-10-16 Thread Greg Kroah-Hartman
From: Al Viro commit d4f4de5e5ef8efde85febb6876cd3c8ab1631999 upstream. There are two problems in dcache_readdir() - one is that lockless traversal of the list needs non-trivial cooperation of d_alloc() (at least a switch to list_add_rcu(), and probably more than just that) and another is that

[PATCH 4.19 65/81] NFS: Fix O_DIRECT accounting of number of bytes read/written

2019-10-16 Thread Greg Kroah-Hartman
From: Trond Myklebust commit 031d73ed768a40684f3ca21992265ffdb6a270bf upstream. When a series of O_DIRECT reads or writes are truncated, either due to eof or due to an error, then we should return the number of contiguous bytes that were received/sent starting at the offset specified by the

[PATCH 4.19 64/81] btrfs: fix uninitialized ret in ref-verify

2019-10-16 Thread Greg Kroah-Hartman
From: Josef Bacik commit c5f4987e86f6692fdb12533ea1fc7a7bb98e555a upstream. Coverity caught a case where we could return with a uninitialized value in ret in process_leaf. This is actually pretty likely because we could very easily run into a block group item key and have a garbage value in

[PATCH 4.19 19/81] USB: iowarrior: fix use-after-free on release

2019-10-16 Thread Greg Kroah-Hartman
From: Johan Hovold commit 80cd5479b525093a56ef768553045741af61b250 upstream. The driver was accessing its struct usb_interface from its release() callback without holding a reference. This would lead to a use-after-free whenever debugging was enabled and the device was disconnected while its

[PATCH 4.19 62/81] cifs: use cifsInodeInfo->open_file_lock while iterating to avoid a panic

2019-10-16 Thread Greg Kroah-Hartman
From: Dave Wysochanski Commit 487317c99477 ("cifs: add spinlock for the openFileList to cifsInodeInfo") added cifsInodeInfo->open_file_lock spin_lock to protect the openFileList, but missed a few places where cifs_inode->openFileList was enumerated. Change these remaining tcon->open_file_lock

[PATCH 4.19 67/81] MIPS: elf_hwcap: Export userspace ASEs

2019-10-16 Thread Greg Kroah-Hartman
From: Jiaxun Yang commit 38dffe1e4dde1d3174fdce09d67370412843ebb5 upstream. A Golang developer reported MIPS hwcap isn't reflecting instructions that the processor actually supported so programs can't apply optimized code at runtime. Thus we export the ASEs that can be used in userspace

[PATCH 4.19 66/81] MIPS: Disable Loongson MMI instructions for kernel build

2019-10-16 Thread Greg Kroah-Hartman
From: Paul Burton commit 2f2b4fd674cadd8c6b40eb629e140a14db4068fd upstream. GCC 9.x automatically enables support for Loongson MMI instructions when using some -march= flags, and then errors out when -msoft-float is specified with: cc1: error: ‘-mloongson-mmi’ must be used with

[PATCH 4.19 56/81] kernel/sysctl.c: do not override max_threads provided by userspace

2019-10-16 Thread Greg Kroah-Hartman
From: Michal Hocko commit b0f53dbc4bc4c371f38b14c391095a3bb8a0bb40 upstream. Partially revert 16db3d3f1170 ("kernel/sysctl.c: threads-max observe limits") because the patch is causing a regression to any workload which needs to override the auto-tuning of the limit provided by kernel.

[PATCH 4.19 51/81] perf inject jit: Fix JIT_CODE_MOVE filename

2019-10-16 Thread Greg Kroah-Hartman
From: Steve MacLean commit b59711e9b0d22fd47abfa00602fd8c365cdd3ab7 upstream. During perf inject --jit, JIT_CODE_MOVE records were injecting MMAP records with an incorrect filename. Specifically it was missing the ".so" suffix. Further the JIT_CODE_LOAD record were silently truncating the

[PATCH 4.19 49/81] efivar/ssdt: Dont iterate over EFI vars if no SSDT override was specified

2019-10-16 Thread Greg Kroah-Hartman
From: Ard Biesheuvel commit c05f8f92b701576b615f30aac31fabdc0648649b upstream. The kernel command line option efivar_ssdt= allows the name to be specified of an EFI variable containing an ACPI SSDT table that should be loaded into memory by the OS, and treated as if it was provided by the

[PATCH 4.19 38/81] USB: legousbtower: fix open after failed reset request

2019-10-16 Thread Greg Kroah-Hartman
From: Johan Hovold commit 0b074f6986751361ff442bc1127c1648567aa8d6 upstream. The driver would return with a nonzero open count in case the reset control request failed. This would prevent any further attempts to open the char dev until the device was disconnected. Fix this by incrementing the

[PATCH 4.19 16/81] USB: adutux: fix NULL-derefs on disconnect

2019-10-16 Thread Greg Kroah-Hartman
From: Johan Hovold commit b2fa7baee744fde746c17bc1860b9c6f5c2eebb7 upstream. The driver was using its struct usb_device pointer as an inverted disconnected flag, but was setting it to NULL before making sure all completion handlers had run. This could lead to a NULL-pointer dereference in a

[PATCH 4.19 50/81] perf llvm: Dont access out-of-scope array

2019-10-16 Thread Greg Kroah-Hartman
From: Ian Rogers commit 7d4c85b7035eb2f9ab217ce649dcd1bfaf0cacd3 upstream. The 'test_dir' variable is assigned to the 'release' array which is out-of-scope 3 lines later. Extend the scope of the 'release' array so that an out-of-scope array isn't accessed. Bug detected by clang's address

[PATCH 4.19 60/81] iio: adc: stm32-adc: move registers definitions

2019-10-16 Thread Greg Kroah-Hartman
From: Fabrice Gasnier [ Upstream commit 31922f62bb527d749b99dbc776e514bcba29b7fe ] Move STM32 ADC registers definitions to common header. This is precursor patch to: - iio: adc: stm32-adc: fix a race when using several adcs with dma and irq It keeps registers definitions as a whole block, to

[PATCH 4.19 57/81] mm/vmpressure.c: fix a signedness bug in vmpressure_register_event()

2019-10-16 Thread Greg Kroah-Hartman
From: Dan Carpenter commit 518a86713078168acd67cf50bc0b45d54b4cce6c upstream. The "mode" and "level" variables are enums and in this context GCC will treat them as unsigned ints so the error handling is never triggered. I also removed the bogus initializer because it isn't required any more

[PATCH 4.19 18/81] USB: iowarrior: fix use-after-free on disconnect

2019-10-16 Thread Greg Kroah-Hartman
From: Johan Hovold commit edc4746f253d907d048de680a621e121517f484b upstream. A recent fix addressing a deadlock on disconnect introduced a new bug by moving the present flag out of the critical section protected by the driver-data mutex. This could lead to a racing release() freeing the driver

[PATCH 4.19 15/81] USB: adutux: fix use-after-free on disconnect

2019-10-16 Thread Greg Kroah-Hartman
From: Johan Hovold commit 44efc269db7929f6275a1fa927ef082e533ecde0 upstream. The driver was clearing its struct usb_device pointer, which it used as an inverted disconnected flag, before deregistering the character device and without serialising against racing release(). This could lead to a

[PATCH linux-kselftest/test v3] lib/list-test: add a test for the 'list' doubly linked list

2019-10-16 Thread David Gow
Add a KUnit test for the kernel doubly linked list implementation in include/linux/list.h Each test case (list_test_x) is focused on testing the behaviour of the list function/macro 'x'. None of the tests pass invalid lists to these macros, and so should behave identically with DEBUG_LIST enabled

[PATCH 4.19 54/81] CIFS: Force revalidate inode when dentry is stale

2019-10-16 Thread Greg Kroah-Hartman
From: Pavel Shilovsky commit c82e5ac7fe3570a269c0929bf7899f62048e7dbc upstream. Currently the client indicates that a dentry is stale when inode numbers or type types between a local inode and a remote file don't match. If this is the case attributes is not being copied from remote to local,

[PATCH 4.19 55/81] CIFS: Force reval dentry if LOOKUP_REVAL flag is set

2019-10-16 Thread Greg Kroah-Hartman
From: Pavel Shilovsky commit 0b3d0ef9840f7be202393ca9116b857f6f793715 upstream. Mark inode for force revalidation if LOOKUP_REVAL flag is set. This tells the client to actually send a QueryInfo request to the server to obtain the latest metadata in case a directory or a file were changed

[PATCH 4.19 52/81] blk-wbt: fix performance regression in wbt scale_up/scale_down

2019-10-16 Thread Greg Kroah-Hartman
From: Harshad Shirwadkar commit b84477d3ebb96294f87dc3161e53fa8fe22d9bfd upstream. scale_up wakes up waiters after scaling up. But after scaling max, it should not wake up more waiters as waiters will not have anything to do. This patch fixes this by making scale_up (and also scale_down) return

[PATCH 4.14 42/65] iio: light: opt3001: fix mutex unlock race

2019-10-16 Thread Greg Kroah-Hartman
From: David Frey commit 82f3015635249a8c8c45bac303fd84905066f04f upstream. When an end-of-conversion interrupt is received after performing a single-shot reading of the light sensor, the driver was waking up the result ready queue before checking opt->ok_to_ignore_lock to determine if it should

[PATCH 4.19 09/81] xhci: Prevent device initiated U1/U2 link pm if exit latency is too long

2019-10-16 Thread Greg Kroah-Hartman
From: Mathias Nyman commit cd9d9491e835a845c1a98b8471f88d26285e0bb9 upstream. If host/hub initiated link pm is prevented by a driver flag we still must ensure that periodic endpoints have longer service intervals than link pm exit latency before allowing device initiated link pm. Fix this by

[PATCH 4.19 00/81] 4.19.80-stable review

2019-10-16 Thread Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.19.80 release. There are 81 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 Fri 18 Oct 2019 09:43:41 PM UTC. Anything

[PATCH 4.19 47/81] iio: adc: axp288: Override TS pin bias current for some models

2019-10-16 Thread Greg Kroah-Hartman
From: Hans de Goede commit 972917419a0ba25afbf69d5d8c9fa644d676f887 upstream. Since commit 9bcf15f75cac ("iio: adc: axp288: Fix TS-pin handling") we preserve the bias current set by the firmware at boot. This fixes issues we were seeing on various models, but it seems our old hardcoded 80ųA

[PATCH 4.14 43/65] efivar/ssdt: Dont iterate over EFI vars if no SSDT override was specified

2019-10-16 Thread Greg Kroah-Hartman
From: Ard Biesheuvel commit c05f8f92b701576b615f30aac31fabdc0648649b upstream. The kernel command line option efivar_ssdt= allows the name to be specified of an EFI variable containing an ACPI SSDT table that should be loaded into memory by the OS, and treated as if it was provided by the

[PATCH 4.19 05/81] USB: yurex: fix NULL-derefs on disconnect

2019-10-16 Thread Greg Kroah-Hartman
From: Johan Hovold commit aafb00a977cf7d81821f7c9d12e04c558c22dc3c upstream. The driver was using its struct usb_interface pointer as an inverted disconnected flag, but was setting it to NULL without making sure all code paths that used it were done with it. Before commit ef61eb43ada6 ("USB:

[PATCH 4.19 06/81] USB: usb-skeleton: fix runtime PM after driver unbind

2019-10-16 Thread Greg Kroah-Hartman
From: Johan Hovold commit 5c290a5e42c3387e82de86965784d30e6c5270fd upstream. Since commit c2b71462d294 ("USB: core: Fix bug caused by duplicate interface PM usage counter") USB drivers must always balance their runtime PM gets and puts, including when the driver has already been unbound from

[PATCH 4.19 07/81] USB: usb-skeleton: fix NULL-deref on disconnect

2019-10-16 Thread Greg Kroah-Hartman
From: Johan Hovold commit bed5ef230943863b9abf5eae226a20fad9a8ff71 upstream. The driver was using its struct usb_interface pointer as an inverted disconnected flag and was setting it to NULL before making sure all completion handlers had run. This could lead to NULL-pointer dereferences in the

[PATCH 4.14 53/65] iio: hx711: add delay until DOUT is ready

2019-10-16 Thread Greg Kroah-Hartman
From: Andreas Klinger [ Upstream commit 461631face58054c72b1f1453f2d66d71b1974e7 ] On a system with parasitic capacitance it turned out that DOUT is not ready after 100 ns after PD_SCK has raised. A measurement showed almost 1000 ns until DOUT has reached its correct value. With this patch its

[PATCH 4.19 01/81] panic: ensure preemption is disabled during panic()

2019-10-16 Thread Greg Kroah-Hartman
From: Will Deacon commit 20bb759a66be52cf4a9ddd17fddaf509e11490cd upstream. Calling 'panic()' on a kernel with CONFIG_PREEMPT=y can leave the calling CPU in an infinite loop, but with interrupts and preemption enabled. From this state, userspace can continue to be scheduled, despite the system

Re: [PATCH 5.3 112/112] ASoC: sgtl5000: add ADC mute control

2019-10-16 Thread Greg Kroah-Hartman
On Wed, Oct 16, 2019 at 11:00:44PM +0100, Mark Brown wrote: > On Wed, Oct 16, 2019 at 02:51:44PM -0700, Greg Kroah-Hartman wrote: > > From: Oleksandr Suvorov > > > > commit 694b14554d75f2a1ae111202e71860d58b434a21 upstream. > > > > This control mute/unmute the ADC input of SGTL5000 > > using

[PATCH 4.14 56/65] NFS: Fix O_DIRECT accounting of number of bytes read/written

2019-10-16 Thread Greg Kroah-Hartman
From: Trond Myklebust commit 031d73ed768a40684f3ca21992265ffdb6a270bf upstream. When a series of O_DIRECT reads or writes are truncated, either due to eof or due to an error, then we should return the number of contiguous bytes that were received/sent starting at the offset specified by the

[PATCH 4.14 44/65] perf llvm: Dont access out-of-scope array

2019-10-16 Thread Greg Kroah-Hartman
From: Ian Rogers commit 7d4c85b7035eb2f9ab217ce649dcd1bfaf0cacd3 upstream. The 'test_dir' variable is assigned to the 'release' array which is out-of-scope 3 lines later. Extend the scope of the 'release' array so that an out-of-scope array isn't accessed. Bug detected by clang's address

<    3   4   5   6   7   8   9   10   11   12   >