[PATCH 4.14 38/65] 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 4.14 50/65] firmware: google: increment VPD key_len properly

2019-10-16 Thread Greg Kroah-Hartman
From: Brian Norris [ Upstream commit 442f1e746e8187b9deb1590176f6b0ff19686b11 ] Commit 4b708b7b1a2c ("firmware: google: check if size is valid when decoding VPD data") adds length checks, but the new vpd_decode_entry() function botched the logic -- it adds the key length twice, instead of

[PATCH 4.14 58/65] 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.14 51/65] 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 4.14 40/65] 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.14 47/65] 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.14 62/65] ftrace: Get a reference counter for the trace_array on filter files

2019-10-16 Thread Greg Kroah-Hartman
From: Steven Rostedt (VMware) commit 9ef16693aff8137faa21d16ffe65bb9832d24d71 upstream. The ftrace set_ftrace_filter and set_ftrace_notrace files are specific for an instance now. They need to take a reference to the instance otherwise there could be a race between accessing the files and

[PATCH 4.14 63/65] tracing: Get trace_array reference for available_tracers files

2019-10-16 Thread Greg Kroah-Hartman
From: Steven Rostedt (VMware) commit 194c2c74f5532e62c218adeb8e2b683119503907 upstream. As instances may have different tracers available, we need to look at the trace_array descriptor that shows the list of the available tracers for the instance. But there's a race between opening the file and

[PATCH 4.14 39/65] 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.14 59/65] 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 4.14 41/65] 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 65/65] xfs: clear sb->s_fs_info on mount failure

2019-10-16 Thread Greg Kroah-Hartman
From: Dave Chinner commit c9fbd7bbc23dbdd73364be4d045e5d3612cf6e82 upstream. We recently had an oops reported on a 4.14 kernel in xfs_reclaim_inodes_count() where sb->s_fs_info pointed to garbage and so the m_perag_tree lookup walked into lala land. Essentially, the machine was under memory

[PATCH 4.14 48/65] 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 02/81] f2fs: use EINVAL for superblock with invalid magic

2019-10-16 Thread Greg Kroah-Hartman
From: Icenowy Zheng [ Upstream commit 38fb6d0ea34299d97b031ed64fe994158b6f8eb3 ] The kernel mount_block_root() function expects -EACESS or -EINVAL for a unmountable filesystem when trying to mount the root with different filesystem types. However, in 5.3-rc1 the behavior when F2FS code cannot

[PATCH 4.14 52/65] Staging: fbtft: fix memory leak in fbtft_framebuffer_alloc

2019-10-16 Thread Greg Kroah-Hartman
From: Navid Emamdoost [ Upstream commit 5bdea6060618cfcf1459dca137e89aee038ac8b9 ] 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 12/81] usb: xhci: wait for CNR controller not ready bit in xhci resume

2019-10-16 Thread Greg Kroah-Hartman
From: Rick Tseng commit a70bcbc322837eda1ab5994d12db941dc9733a7d upstream. NVIDIA 3.1 xHCI card would lose power when moving power state into D3Cold. Thus we need to wait for CNR bit to clear in xhci resume, just as in xhci init. [Minor changes to comment and commit message -Mathias] Cc:

[PATCH 4.19 34/81] 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 4.14 36/65] 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 4.14 57/65] 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 28/81] USB: serial: option: add support for Cinterion CLS8 devices

2019-10-16 Thread Greg Kroah-Hartman
From: Reinhard Speyerer commit dfbac2f4da6a0c4a8f6b4d715a4077a7b8df53ad upstream. Add support for the serial ports of Cinterion CLS8 devices. T: Bus=01 Lev=03 Prnt=05 Port=01 Cnt=02 Dev#= 25 Spd=480 MxCh= 0 D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1 P: Vendor=1e2d

[PATCH 4.19 03/81] 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 25/81] 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 4.19 26/81] 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

[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

[PATCH 4.19 31/81] USB: microtek: fix info-leak at probe

2019-10-16 Thread Greg Kroah-Hartman
From: Johan Hovold commit 177238c3d47d54b2ed8f0da7a4290db492f4a057 upstream. Add missing bulk-in endpoint sanity check to prevent uninitialised stack data from being reported to the system log and used as endpoint addresses. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Cc: stable Reported-by:

[PATCH 4.19 32/81] USB: dummy-hcd: fix power budget for SuperSpeed mode

2019-10-16 Thread Greg Kroah-Hartman
From: jacky@sony.com commit 2636d49b64671d3d90ecc4daf971b58df3956519 upstream. The power budget for SuperSpeed mode should be 900 mA according to USB specification, so set the power budget to 900mA for dummy_start_ss which is only used for SuperSpeed mode. If the max power consumption of

[PATCH 4.19 30/81] 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 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.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 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.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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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:

<    1   2   3   4   5   6   7   8   9   10   >