[PATCH 4.14 27/40] KVM: arm/arm64: Only skip MMIO insn once

2019-09-08 Thread Greg Kroah-Hartman
[ Upstream commit 2113c5f62b7423e4a72b890bd479704aa85c81ba ] If after an MMIO exit to userspace a VCPU is immediately run with an immediate_exit request, such as when a signal is delivered or an MMIO emulation completion is needed, then the VCPU completes the MMIO emulation and immediately

[PATCH 4.14 25/40] ceph: fix buffer free while holding i_ceph_lock in __ceph_build_xattrs_blob()

2019-09-08 Thread Greg Kroah-Hartman
[ Upstream commit 12fe3dda7ed89c95cc0ef7abc001ad1ad3e092f8 ] Calling ceph_buffer_put() in __ceph_build_xattrs_blob() may result in freeing the i_xattrs.blob buffer while holding the i_ceph_lock. This can be fixed by having this function returning the old blob buffer and have the callers of this

[PATCH 4.14 08/40] drm/mediatek: use correct device to import PRIME buffers

2019-09-08 Thread Greg Kroah-Hartman
[ Upstream commit 4c6f3196e6ea111c456c6086dc3f57d4706b0b2d ] PRIME buffers should be imported using the DMA device. To this end, use a custom import function that mimics drm_gem_prime_import_dev(), but passes the correct device. Fixes: 119f5173628aa ("drm/mediatek: Add DRM Driver for Mediatek

[PATCH 4.14 34/40] net_sched: fix a NULL pointer deref in ipt action

2019-09-08 Thread Greg Kroah-Hartman
From: Cong Wang [ Upstream commit 981471bd3abf4d572097645d765391533aac327d ] The net pointer in struct xt_tgdtor_param is not explicitly initialized therefore is still NULL when dereferencing it. So we have to find a way to pass the correct net pointer to ipt_destroy_target(). The best way I

[PATCH 4.19 15/57] tools: bpftool: fix error message (prog -> object)

2019-09-08 Thread Greg Kroah-Hartman
[ Upstream commit b3e78adcbf991a4e8b2ebb23c9889e968ec76c5f ] Change an error message to work for any object being pinned not just programs. Fixes: 71bb428fe2c1 ("tools: bpf: add bpftool") Signed-off-by: Jakub Kicinski Reviewed-by: Quentin Monnet Signed-off-by: Daniel Borkmann Signed-off-by:

[PATCH 4.19 20/57] ibmveth: Convert multicast list size for little-endian system

2019-09-08 Thread Greg Kroah-Hartman
[ Upstream commit 66cf4710b23ab2adda11155684a2c8826f4fe732 ] The ibm,mac-address-filters property defines the maximum number of addresses the hypervisor's multicast filter list can support. It is encoded as a big-endian integer in the OF device tree, but the virtual ethernet driver does not

[PATCH 4.19 24/57] drm/mediatek: set DMA max segment size

2019-09-08 Thread Greg Kroah-Hartman
[ Upstream commit 07098e820b9a89c570b91b1f21762f62b288 ] This driver requires imported PRIME buffers to appear contiguously in its IO address space. Make sure this is the case by setting the maximum DMA segment size to a more suitable value than the default 64KB. Signed-off-by: Alexandre

[PATCH 4.19 10/57] spi: bcm2835aux: unifying code between polling and interrupt driven code

2019-09-08 Thread Greg Kroah-Hartman
[ Upstream commit 7188a6f0eee3f1fae5d826cfc6d569657ff950ec ] Sharing more code between polling and interrupt-driven mode. Signed-off-by: Martin Sperl Acked-by: Stefan Wahren Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- drivers/spi/spi-bcm2835aux.c | 51

Re: [patch for-5.3 0/4] revert immediate fallback to remote hugepages

2019-09-08 Thread Vlastimil Babka
On 9/8/19 3:50 AM, David Rientjes wrote: > On Sat, 7 Sep 2019, Linus Torvalds wrote: > >>> Andrea acknowledges the swap storm that he reported would be fixed with >>> the last two patches in this series >> >> The problem is that even you aren't arguing that those patches should >> go into 5.3. >>

[PATCH 4.19 16/57] hv_netvsc: Fix a warning of suspicious RCU usage

2019-09-08 Thread Greg Kroah-Hartman
[ Upstream commit 6d0d779dca73cd5acb649c54f81401f93098b298 ] This fixes a warning of "suspicious rcu_dereference_check() usage" when nload runs. Fixes: 776e726bfb34 ("netvsc: fix RCU warning in get_stats") Signed-off-by: Dexuan Cui Signed-off-by: David S. Miller Signed-off-by: Sasha Levin ---

[PATCH 4.19 21/57] gpio: Fix build error of function redefinition

2019-09-08 Thread Greg Kroah-Hartman
[ Upstream commit 68e03b85474a51ec1921b4d13204782594ef7223 ] when do randbuilding, I got this error: In file included from drivers/hwmon/pmbus/ucd9000.c:19:0: ./include/linux/gpio/driver.h:576:1: error: redefinition of gpiochip_add_pin_range gpiochip_add_pin_range(struct gpio_chip *chip, const

[PATCH 4.19 23/57] drm/mediatek: use correct device to import PRIME buffers

2019-09-08 Thread Greg Kroah-Hartman
[ Upstream commit 4c6f3196e6ea111c456c6086dc3f57d4706b0b2d ] PRIME buffers should be imported using the DMA device. To this end, use a custom import function that mimics drm_gem_prime_import_dev(), but passes the correct device. Fixes: 119f5173628aa ("drm/mediatek: Add DRM Driver for Mediatek

[PATCH 4.19 17/57] net: tc35815: Explicitly check NET_IP_ALIGN is not zero in tc35815_rx

2019-09-08 Thread Greg Kroah-Hartman
[ Upstream commit 125b7e0949d4e72b15c2b1a1590f8cece985a918 ] clang warns: drivers/net/ethernet/toshiba/tc35815.c:1507:30: warning: use of logical '&&' with constant operand [-Wconstant-logical-operand] if (!HAVE_DMA_RXALIGN(lp) && NET_IP_ALIGN)

[PATCH 4.19 19/57] Bluetooth: hidp: Let hidp_send_message return number of queued bytes

2019-09-08 Thread Greg Kroah-Hartman
[ Upstream commit 48d9cc9d85dde37c87abb7ac9bbec6598ba44b56 ] Let hidp_send_message return the number of successfully queued bytes instead of an unconditional 0. With the return value fixed to 0, other drivers relying on hidp, such as hidraw, can not return meaningful values from their respective

[PATCH 4.19 04/57] net_sched: fix a NULL pointer deref in ipt action

2019-09-08 Thread Greg Kroah-Hartman
From: Cong Wang [ Upstream commit 981471bd3abf4d572097645d765391533aac327d ] The net pointer in struct xt_tgdtor_param is not explicitly initialized therefore is still NULL when dereferencing it. So we have to find a way to pass the correct net pointer to ipt_destroy_target(). The best way I

[PATCH 4.19 30/57] lan78xx: Fix memory leaks

2019-09-08 Thread Greg Kroah-Hartman
[ Upstream commit b9cbf8a64865b50fd0f4a3915fa00ac7365cdf8f ] In lan78xx_probe(), a new urb is allocated through usb_alloc_urb() and saved to 'dev->urb_intr'. However, in the following execution, if an error occurs, 'dev->urb_intr' is not deallocated, leading to memory leaks. To fix this issue,

[PATCH 4.19 29/57] net: myri10ge: fix memory leaks

2019-09-08 Thread Greg Kroah-Hartman
[ Upstream commit 20fb7c7a39b5c719e2e619673b5f5729ee7d2306 ] In myri10ge_probe(), myri10ge_alloc_slices() is invoked to allocate slices related structures. Later on, myri10ge_request_irq() is used to get an irq. However, if this process fails, the allocated slices related structures are not

[PATCH 4.19 33/57] net: kalmia: fix memory leaks

2019-09-08 Thread Greg Kroah-Hartman
[ Upstream commit f1472cb09f11ddb41d4be84f0650835cb65a9073 ] In kalmia_init_and_get_ethernet_addr(), 'usb_buf' is allocated through kmalloc(). In the following execution, if the 'status' returned by kalmia_send_init_packet() is not 0, 'usb_buf' is not deallocated, leading to memory leaks. To fix

[PATCH 4.19 06/57] tcp: inherit timestamp on mtu probe

2019-09-08 Thread Greg Kroah-Hartman
From: Willem de Bruijn [ Upstream commit 888a5c53c0d8be6e98bc85b677f179f77a647873 ] TCP associates tx timestamp requests with a byte in the bytestream. If merging skbs in tcp_mtu_probe, migrate the tstamp request. Similar to MSG_EOR, do not allow moving a timestamp from any segment in the

[PATCH 4.19 08/57] net/rds: Fix info leak in rds6_inc_info_copy()

2019-09-08 Thread Greg Kroah-Hartman
From: Ka-Cheong Poon [ Upstream commit 7d0a06586b2686ba80c4a2da5f91cb10ffbea736 ] The rds6_inc_info_copy() function has a couple struct members which are leaking stack information. The ->tos field should hold actual information and the ->flags field needs to be zeroed out. Fixes: 3eb450367d08

[PATCH 4.19 44/57] IB/mlx4: Fix memory leaks

2019-09-08 Thread Greg Kroah-Hartman
[ Upstream commit 5c1baaa82cea2c815a5180ded402a7cd455d1810 ] In mlx4_ib_alloc_pv_bufs(), 'tun_qp->tx_ring' is allocated through kcalloc(). However, it is not always deallocated in the following execution if an error occurs, leading to memory leaks. To fix this issue, free 'tun_qp->tx_ring'

[PATCH 4.19 51/57] ceph: fix buffer free while holding i_ceph_lock in fill_inode()

2019-09-08 Thread Greg Kroah-Hartman
[ Upstream commit af8a85a41734f37b67ba8ce69d56b685bee4ac48 ] Calling ceph_buffer_put() in fill_inode() may result in freeing the i_xattrs.blob buffer while holding the i_ceph_lock. This can be fixed by postponing the call until later, when the lock is released. The following backtrace was

[PATCH 4.19 45/57] infiniband: hfi1: fix a memory leak bug

2019-09-08 Thread Greg Kroah-Hartman
[ Upstream commit b08afa064c320e5d85cdc27228426b696c4c8dae ] In fault_opcodes_read(), 'data' is not deallocated if debugfs_file_get() fails, leading to a memory leak. To fix this bug, introduce the 'free_data' label to free 'data' before returning the error. Signed-off-by: Wenwen Wang

[PATCH 4.19 49/57] ceph: fix buffer free while holding i_ceph_lock in __ceph_setxattr()

2019-09-08 Thread Greg Kroah-Hartman
[ Upstream commit 86968ef21596515958d5f0a40233d02be78ecec0 ] Calling ceph_buffer_put() in __ceph_setxattr() may end up freeing the i_xattrs.prealloc_blob buffer while holding the i_ceph_lock. This can be fixed by postponing the call until later, when the lock is released. The following

[PATCH 4.19 47/57] selftests: kvm: fix state save/load on processors without XSAVE

2019-09-08 Thread Greg Kroah-Hartman
[ Upstream commit 54577e5018a8c0cb79c9a0fa118a55c68715d398 ] state_test and smm_test are failing on older processors that do not have xcr0. This is because on those processor KVM does provide support for KVM_GET/SET_XSAVE (to avoid having to rely on the older KVM_GET/SET_FPU) but not for

[PATCH] staging: exfat: add millisecond support

2019-09-08 Thread Valentin Vidic
Drop duplicated date_time_t struct and add millisecond handling for create and modify time. Also drop millisecond field for access time since it is not defined in the the spec. Signed-off-by: Valentin Vidic --- drivers/staging/exfat/exfat.h | 38 +++--- drivers/staging/exfat/exfat_core.c

[PATCH 4.19 34/57] ibmvnic: Unmap DMA address of TX descriptor buffers after use

2019-09-08 Thread Greg Kroah-Hartman
[ Upstream commit 80f0fe0934cd3daa13a5e4d48a103f469115b160 ] There's no need to wait until a completion is received to unmap TX descriptor buffers that have been passed to the hypervisor. Instead unmap it when the hypervisor call has completed. This patch avoids the possibility that a buffer will

[PATCH 4.19 38/57] kprobes: Fix potential deadlock in kprobe_optimizer()

2019-09-08 Thread Greg Kroah-Hartman
[ Upstream commit f1c6ece23729257fb46562ff9224cf5f61b818da ] lockdep reports the following deadlock scenario: WARNING: possible circular locking dependency detected kworker/1:1/48 is trying to acquire lock: 8d7a62b2 (text_mutex){+.+.}, at: kprobe_optimizer+0x163/0x290 but task is

[PATCH 4.19 32/57] cx82310_eth: fix a memory leak bug

2019-09-08 Thread Greg Kroah-Hartman
[ Upstream commit 1eca92eef18719027d394bf1a2d276f43e7cf886 ] In cx82310_bind(), 'dev->partial_data' is allocated through kmalloc(). Then, the execution waits for the firmware to become ready. If the firmware is not ready in time, the execution is terminated. However, the allocated

[PATCH 4.19 41/57] Input: hyperv-keyboard: Use in-place iterator API in the channel callback

2019-09-08 Thread Greg Kroah-Hartman
[ Upstream commit d09bc83640d524b8467a660db7b1d15e6562a1de ] Simplify the ring buffer handling with the in-place API. Also avoid the dynamic allocation and the memory leak in the channel callback function. Signed-off-by: Dexuan Cui Acked-by: Dmitry Torokhov Signed-off-by: Sasha Levin ---

[PATCH 5.2 16/94] net: dsa: tag_8021q: Future-proof the reserved fields in the custom VID

2019-09-08 Thread Greg Kroah-Hartman
From: Vladimir Oltean [ Upstream commit bcccb0a535bb99616e4b992568371efab1ab14e8 ] After witnessing the discussion in https://lkml.org/lkml/2019/8/14/151 w.r.t. ioctl extensibility, it became clear that such an issue might prevent that the 3 RSV bits inside the DSA 802.1Q tag might also suffer

[PATCH 4.19 54/57] KVM: arm/arm64: VGIC: Properly initialise private IRQ affinity

2019-09-08 Thread Greg Kroah-Hartman
[ Upstream commit 2e16f3e926ed48373c98edea85c6ad0ef69425d1 ] At the moment we initialise the target *mask* of a virtual IRQ to the VCPU it belongs to, even though this mask is only defined for GICv2 and quickly runs out of bits for many GICv3 guests. This behaviour triggers an UBSAN complaint for

[PATCH 4.19 57/57] Revert "x86/apic: Include the LDR when clearing out APIC registers"

2019-09-08 Thread Greg Kroah-Hartman
[ Upstream commit 950b07c14e8c59444e2359f15fd70ed5112e11a0 ] This reverts commit 558682b5291937a70748d36fd9ba757fb25b99ae. Chris Wilson reports that it breaks his CPU hotplug test scripts. In particular, it breaks offlining and then re-onlining the boot CPU, which we treat specially (and the

[PATCH 4.19 39/57] HID: cp2112: prevent sleeping function called from invalid context

2019-09-08 Thread Greg Kroah-Hartman
[ Upstream commit 2d05dba2b25ecb0f8fc3a0b4eb2232da6454a47b ] When calling request_threaded_irq() with a CP2112, the function cp2112_gpio_irq_startup() is called in a IRQ context. Therefore we can not sleep, and we can not call cp2112_gpio_direction_input() there. Move the call to

[PATCH 5.2 02/94] net: fix skb use after free in netpoll

2019-09-08 Thread Greg Kroah-Hartman
From: Feng Sun [ Upstream commit 2c1644cf6d46a8267d79ed95cb9b563839346562 ] After commit baeababb5b85d5c4e6c917efe2a1504179438d3b ("tun: return NET_XMIT_DROP for dropped packets"), when tun_net_xmit drop packets, it will free skb and return NET_XMIT_DROP, netpoll_send_skb_on_dev will run into

[PATCH 5.2 05/94] net: stmmac: dwmac-rk: Dont fail if phy regulator is absent

2019-09-08 Thread Greg Kroah-Hartman
From: Chen-Yu Tsai [ Upstream commit 3b25528e1e355c803e73aa326ce657b5606cda73 ] The devicetree binding lists the phy phy as optional. As such, the driver should not bail out if it can't find a regulator. Instead it should just skip the remaining regulator related code and continue on normally.

[PATCH 5.2 21/94] libbpf: fix erroneous multi-closing of BTF FD

2019-09-08 Thread Greg Kroah-Hartman
[ Upstream commit 5d01ab7bac467edfc530e6ccf953921def935c62 ] Libbpf stores associated BTF FD per each instance of bpf_program. When program is unloaded, that FD is closed. This is wrong, because leads to a race and possibly closing of unrelated files, if application simultaneously opens new files

[PATCH 5.2 30/94] netfilter: nf_flow_table: conntrack picks up expired flows

2019-09-08 Thread Greg Kroah-Hartman
[ Upstream commit 3e68db2f6422d711550a32cbc87abd97bb6efab3 ] Update conntrack entry to pick up expired flows, otherwise the conntrack entry gets stuck with the internal offload timeout (one day). The TCP state also needs to be adjusted to ESTABLISHED state and tracking is set to liberal mode in

[PATCH 5.2 32/94] tools: bpftool: fix error message (prog -> object)

2019-09-08 Thread Greg Kroah-Hartman
[ Upstream commit b3e78adcbf991a4e8b2ebb23c9889e968ec76c5f ] Change an error message to work for any object being pinned not just programs. Fixes: 71bb428fe2c1 ("tools: bpf: add bpftool") Signed-off-by: Jakub Kicinski Reviewed-by: Quentin Monnet Signed-off-by: Daniel Borkmann Signed-off-by:

[PATCH 5.2 33/94] ixgbe: fix possible deadlock in ixgbe_service_task()

2019-09-08 Thread Greg Kroah-Hartman
[ Upstream commit 8b6381600d59871fbe44d36522272f961ab42410 ] ixgbe_service_task() calls unregister_netdev() under rtnl_lock(). But unregister_netdev() internally calls rtnl_lock(). So deadlock would occur. Fixes: 59dd45d550c5 ("ixgbe: firmware recovery mode") Signed-off-by: Taehee Yoo

[PATCH 5.2 27/94] clk: samsung: exynos542x: Move MSCL subsystem clocks to its sub-CMU

2019-09-08 Thread Greg Kroah-Hartman
[ Upstream commit baf7b79e1ad79a41fafd8ab8597b9a96962d822d ] M2M scaler clocks require special handling of their parent bus clock during power domain on/off sequences. MSCL clocks were not initially added to the sub-CMU handler, because that time there was no driver for the M2M scaler device and

[PATCH 5.2 40/94] ibmveth: Convert multicast list size for little-endian system

2019-09-08 Thread Greg Kroah-Hartman
[ Upstream commit 66cf4710b23ab2adda11155684a2c8826f4fe732 ] The ibm,mac-address-filters property defines the maximum number of addresses the hypervisor's multicast filter list can support. It is encoded as a big-endian integer in the OF device tree, but the virtual ethernet driver does not

[PATCH 5.2 45/94] scsi: qla2xxx: Fix gnl.l memory leak on adapter init failure

2019-09-08 Thread Greg Kroah-Hartman
[ Upstream commit 26fa656e9a0cbccddf7db132ea020d2169dbe46e ] If HBA initialization fails unexpectedly (exiting via probe_failed:), we may fail to free vha->gnl.l. So that we don't attempt to double free, set this pointer to NULL after a free and check for NULL at probe_failed: so we know whether

[PATCH 5.2 36/94] Bluetooth: btqca: Add a short delay before downloading the NVM

2019-09-08 Thread Greg Kroah-Hartman
[ Upstream commit 8059ba0bd0e4694e51c2ee6438a77b325f06c0d5 ] On WCN3990 downloading the NVM sometimes fails with a "TLV response size mismatch" error: [ 174.949955] Bluetooth: btqca.c:qca_download_firmware() hci0: QCA Downloading qca/crnv21.bin [ 174.958718] Bluetooth:

[PATCH 5.2 37/94] Bluetooth: hci_qca: Send VS pre shutdown command.

2019-09-08 Thread Greg Kroah-Hartman
[ Upstream commit a2780889e247561744dd8efbd3478a1999b72ae3 ] WCN399x chips are coex chips, it needs a VS pre shutdown command while turning off the BT. So that chip can inform BT is OFF to other active clients. Signed-off-by: Harish Bandi Signed-off-by: Marcel Holtmann Signed-off-by: Sasha

[PATCH 5.2 42/94] netfilter: nft_flow_offload: skip tcp rst and fin packets

2019-09-08 Thread Greg Kroah-Hartman
[ Upstream commit dfe42be15fde16232340b8b2a57c359f51cc10d9 ] TCP rst and fin packets do not qualify to place a flow into the flowtable. Most likely there will be no more packets after connection closure. Without this patch, this flow entry expires and connection tracking picks up the entry in

[PATCH 5.2 46/94] scsi: target: tcmu: avoid use-after-free after command timeout

2019-09-08 Thread Greg Kroah-Hartman
[ Upstream commit a86a75865ff4d8c05f355d1750a5250aec89ab15 ] In tcmu_handle_completion() function, the variable called read_len is always initialized with a value taken from se_cmd structure. If this function is called to complete an expired (timed out) out command, the session command pointed by

[PATCH 5.2 12/94] taprio: Fix kernel panic in taprio_destroy

2019-09-08 Thread Greg Kroah-Hartman
From: Vladimir Oltean taprio_init may fail earlier than this line: list_add(>taprio_list, _list); i.e. due to the net device not being multi queue. Attempting to remove q from the global taprio_list when it is not part of it will result in a kernel panic. Fix it by matching list_add

[PATCH 5.2 61/94] wimax/i2400m: fix a memory leak bug

2019-09-08 Thread Greg Kroah-Hartman
[ Upstream commit 44ef3a03252844a8753479b0cea7f29e4a804bdc ] In i2400m_barker_db_init(), 'options_orig' is allocated through kstrdup() to hold the original command line options. Then, the options are parsed. However, if an error occurs during the parsing process, 'options_orig' is not

[PATCH 5.2 13/94] taprio: Set default link speed to 10 Mbps in taprio_set_picos_per_byte

2019-09-08 Thread Greg Kroah-Hartman
From: Vladimir Oltean The taprio budget needs to be adapted at runtime according to interface link speed. But that handling is problematic. For one thing, installing a qdisc on an interface that doesn't have carrier is not illegal. But taprio prints the following stack trace: [ 31.851373]

[PATCH 5.2 15/94] Add genphy_c45_config_aneg() function to phy-c45.c

2019-09-08 Thread Greg Kroah-Hartman
From: Marco Hartmann [ Upstream commit 2ebb991641d3f64b70fec0156e2b6933810177e9 ] Commit 34786005eca3 ("net: phy: prevent PHYs w/o Clause 22 regs from calling genphy_config_aneg") introduced a check that aborts phy_config_aneg() if the phy is a C45 phy. This causes phy_state_machine() to call

[PATCH 5.2 49/94] selftests: kvm: provide common function to enable eVMCS

2019-09-08 Thread Greg Kroah-Hartman
[ Upstream commit 65efa61dc0d536d5f0602c33ee805a57cc07e9dc ] There are two tests already enabling eVMCS and a third is coming. Add a function that enables the capability and tests the result. Signed-off-by: Paolo Bonzini Signed-off-by: Sasha Levin ---

[PATCH 5.2 44/94] drm/mediatek: set DMA max segment size

2019-09-08 Thread Greg Kroah-Hartman
[ Upstream commit 07098e820b9a89c570b91b1f21762f62b288 ] This driver requires imported PRIME buffers to appear contiguously in its IO address space. Make sure this is the case by setting the maximum DMA segment size to a more suitable value than the default 64KB. Signed-off-by: Alexandre

[PATCH 5.2 75/94] infiniband: hfi1: fix a memory leak bug

2019-09-08 Thread Greg Kroah-Hartman
[ Upstream commit b08afa064c320e5d85cdc27228426b696c4c8dae ] In fault_opcodes_read(), 'data' is not deallocated if debugfs_file_get() fails, leading to a memory leak. To fix this bug, introduce the 'free_data' label to free 'data' before returning the error. Signed-off-by: Wenwen Wang

[PATCH 5.2 06/94] tcp: inherit timestamp on mtu probe

2019-09-08 Thread Greg Kroah-Hartman
From: Willem de Bruijn [ Upstream commit 888a5c53c0d8be6e98bc85b677f179f77a647873 ] TCP associates tx timestamp requests with a byte in the bytestream. If merging skbs in tcp_mtu_probe, migrate the tstamp request. Similar to MSG_EOR, do not allow moving a timestamp from any segment in the

[PATCH 5.2 76/94] infiniband: hfi1: fix memory leaks

2019-09-08 Thread Greg Kroah-Hartman
[ Upstream commit 2323d7baab2b18d87d9bc267452e387aa9f0060a ] In fault_opcodes_write(), 'data' is allocated through kcalloc(). However, it is not deallocated in the following execution if an error occurs, leading to memory leaks. To fix this issue, introduce the 'free_data' label to free 'data'

[PATCH 5.2 66/94] HID: cp2112: prevent sleeping function called from invalid context

2019-09-08 Thread Greg Kroah-Hartman
[ Upstream commit 2d05dba2b25ecb0f8fc3a0b4eb2232da6454a47b ] When calling request_threaded_irq() with a CP2112, the function cp2112_gpio_irq_startup() is called in a IRQ context. Therefore we can not sleep, and we can not call cp2112_gpio_direction_input() there. Move the call to

[PATCH 5.2 67/94] x86/boot/compressed/64: Fix boot on machines with broken E820 table

2019-09-08 Thread Greg Kroah-Hartman
[ Upstream commit 0a46fff2f9108c2c44218380a43a736cf4612541 ] BIOS on Samsung 500C Chromebook reports very rudimentary E820 table that consists of 2 entries: BIOS-e820: [mem 0x-0x0fff] usable BIOS-e820: [mem 0xf000-0x] reserved It

[PATCH 5.2 64/94] kprobes: Fix potential deadlock in kprobe_optimizer()

2019-09-08 Thread Greg Kroah-Hartman
[ Upstream commit f1c6ece23729257fb46562ff9224cf5f61b818da ] lockdep reports the following deadlock scenario: WARNING: possible circular locking dependency detected kworker/1:1/48 is trying to acquire lock: 8d7a62b2 (text_mutex){+.+.}, at: kprobe_optimizer+0x163/0x290 but task is

[PATCH 5.2 53/94] clk: Fix falling back to legacy parent string matching

2019-09-08 Thread Greg Kroah-Hartman
[ Upstream commit 4f8c6aba37da199155a121c6cdc38505a9eb0259 ] Calls to clk_core_get() will return ERR_PTR(-EINVAL) if we've started migrating a clk driver to use the DT based style of specifying parents but we haven't made any DT updates yet. This happens when we pass a non-NULL value as the

[PATCH 5.2 71/94] nvme-multipath: fix possible I/O hang when paths are updated

2019-09-08 Thread Greg Kroah-Hartman
[ Upstream commit 504db087aaccdb32af61539916409f7dca31ceb5 ] nvme_state_set_live() making a path available triggers requeue_work in order to resubmit requests that ended up on requeue_list when no paths were available. This requeue_work may race with concurrent nvme_ns_head_make_request() that

[PATCH 5.2 77/94] selftests: kvm: fix state save/load on processors without XSAVE

2019-09-08 Thread Greg Kroah-Hartman
[ Upstream commit 54577e5018a8c0cb79c9a0fa118a55c68715d398 ] state_test and smm_test are failing on older processors that do not have xcr0. This is because on those processor KVM does provide support for KVM_GET/SET_XSAVE (to avoid having to rely on the older KVM_GET/SET_FPU) but not for

[PATCH 5.2 68/94] scsi: lpfc: Mitigate high memory pre-allocation by SCSI-MQ

2019-09-08 Thread Greg Kroah-Hartman
[ Upstream commit 77ffd3465ba837e9dc714e17b014e77b2eae765a ] When SCSI-MQ is enabled, the SCSI-MQ layers will do pre-allocation of MQ resources based on shost values set by the driver. In newer cases of the driver, which attempts to set nr_hw_queues to the cpu count, the multipliers become

[PATCH 5.2 79/94] drm/amdgpu: prevent memory leaks in AMDGPU_CS ioctl

2019-09-08 Thread Greg Kroah-Hartman
[ Upstream commit 1a701ea924815b0518733aa8d5d05c1f6fa87062 ] Error out if the AMDGPU_CS ioctl is called with multiple SYNCOBJ_OUT and/or TIMELINE_SIGNAL chunks, since otherwise the last chunk wins while the allocated array as well as the reference counts of sync objects are leaked.

[PATCH 5.2 69/94] Input: hyperv-keyboard: Use in-place iterator API in the channel callback

2019-09-08 Thread Greg Kroah-Hartman
[ Upstream commit d09bc83640d524b8467a660db7b1d15e6562a1de ] Simplify the ring buffer handling with the in-place API. Also avoid the dynamic allocation and the memory leak in the channel callback function. Signed-off-by: Dexuan Cui Acked-by: Dmitry Torokhov Signed-off-by: Sasha Levin ---

[PATCH 5.2 72/94] nvme: Fix cntlid validation when not using NVMEoF

2019-09-08 Thread Greg Kroah-Hartman
[ Upstream commit a89fcca8185633993018dc081d6b021d005e6d0b ] Commit 1b1031ca63b2 ("nvme: validate cntlid during controller initialisation") introduced a validation for controllers with duplicate cntlid that runs on nvme_init_subsystem(). The problem is that the validation relies on ctrl->cntlid,

[PATCH 5.2 91/94] libceph: allow ceph_buffer_put() to receive a NULL ceph_buffer

2019-09-08 Thread Greg Kroah-Hartman
[ Upstream commit 5c498950f730aa17c5f8a2cdcb903524e4002ed2 ] Signed-off-by: Luis Henriques Reviewed-by: Jeff Layton Signed-off-by: Ilya Dryomov Signed-off-by: Sasha Levin --- include/linux/ceph/buffer.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git

[PATCH 5.2 92/94] Revert "x86/apic: Include the LDR when clearing out APIC registers"

2019-09-08 Thread Greg Kroah-Hartman
[ Upstream commit 950b07c14e8c59444e2359f15fd70ed5112e11a0 ] This reverts commit 558682b5291937a70748d36fd9ba757fb25b99ae. Chris Wilson reports that it breaks his CPU hotplug test scripts. In particular, it breaks offlining and then re-onlining the boot CPU, which we treat specially (and the

[PATCH 5.2 55/94] lan78xx: Fix memory leaks

2019-09-08 Thread Greg Kroah-Hartman
[ Upstream commit b9cbf8a64865b50fd0f4a3915fa00ac7365cdf8f ] In lan78xx_probe(), a new urb is allocated through usb_alloc_urb() and saved to 'dev->urb_intr'. However, in the following execution, if an error occurs, 'dev->urb_intr' is not deallocated, leading to memory leaks. To fix this issue,

[PATCH 5.2 56/94] vfs: fix page locking deadlocks when deduping files

2019-09-08 Thread Greg Kroah-Hartman
[ Upstream commit edc58dd0123b552453a74369bd0c8d890b497b4b ] When dedupe wants to use the page cache to compare parts of two files for dedupe, we must be very careful to handle locking correctly. The current code doesn't do this. It must lock and unlock the page only once if the two pages are

[PATCH 5.2 86/94] afs: use correct afs_call_type in yfs_fs_store_opaque_acl2

2019-09-08 Thread Greg Kroah-Hartman
[ Upstream commit 7533be858f5b9a036b9f91556a3ed70786abca8e ] It seems that 'yfs_RXYFSStoreOpaqueACL2' should be use in yfs_fs_store_opaque_acl2(). Fixes: f5e4546347bc ("afs: Implement YFS ACL setting") Signed-off-by: YueHaibing Signed-off-by: David Howells Signed-off-by: Sasha Levin ---

[PATCH 5.2 88/94] gpio: Fix irqchip initialization order

2019-09-08 Thread Greg Kroah-Hartman
[ Upstream commit 48057ed1840fde9239b1e000bea1a0a1f07c5e99 ] The new API for registering a gpio_irq_chip along with a gpio_chip has a different semantic ordering than the old API which added the irqchip explicitly after registering the gpio_chip. Move the calls to add the gpio_irq_chip *last* in

[PATCH 5.2 51/94] liquidio: add cleanup in octeon_setup_iq()

2019-09-08 Thread Greg Kroah-Hartman
[ Upstream commit 6f967f8b1be7001b31c46429f2ee7d275af2190f ] If oct->fn_list.enable_io_queues() fails, no cleanup is executed, leading to memory/resource leaks. To fix this issue, invoke octeon_delete_instr_queue() before returning from the function. Signed-off-by: Wenwen Wang Signed-off-by:

[PATCH 5.2 87/94] RDMA/bnxt_re: Fix stack-out-of-bounds in bnxt_qplib_rcfw_send_message

2019-09-08 Thread Greg Kroah-Hartman
[ Upstream commit d37b1e534071ab1983e7c85273234b132c77591a ] Driver copies FW commands to the HW queue as units of 16 bytes. Some of the command structures are not exact multiple of 16. So while copying the data from those structures, the stack out of bounds messages are reported by KASAN. The

[PATCH 5.2 85/94] afs: Fix possible oops in afs_lookup trace event

2019-09-08 Thread Greg Kroah-Hartman
[ Upstream commit c4c613ff08d92e72bf64a65ec35a2c3aa1cfcd06 ] The afs_lookup trace event can cause the following: [ 216.576777] BUG: kernel NULL pointer dereference, address: 023b [ 216.576803] #PF: supervisor read access in kernel mode [ 216.576813] #PF: error_code(0x) -

[PATCH 5.2 94/94] Revert "mmc: core: do not retry CMD6 in __mmc_switch()"

2019-09-08 Thread Greg Kroah-Hartman
From: Jan Kaisrlik commit 8ad8e02c2fa70cfddc1ded53ba9001c9d444075d upstream. Turns out the commit 3a0681c7448b ("mmc: core: do not retry CMD6 in __mmc_switch()") breaks initialization of a Toshiba THGBMNG5 eMMC card, when using the meson-gx-mmc.c driver on a custom board based on Amlogic A113D.

[PATCH 5.2 60/94] net: cavium: fix driver name

2019-09-08 Thread Greg Kroah-Hartman
[ Upstream commit 3434341004a380f4e47c3a03d4320d43982162a0 ] The driver name gets exposed in sysfs under /sys/bus/pci/drivers so it should look like other devices. Change it to be common format (instead of "Cavium PTP"). This is a trivial fix that was observed by accident because Debian kernels

[PATCH 5.2 93/94] x86/boot: Preserve boot_params.secure_boot from sanitizing

2019-09-08 Thread Greg Kroah-Hartman
From: John S. Gruber commit 29d9a0b50736768f042752070e5cdf4e4d4c00df upstream. Commit a90118c445cc ("x86/boot: Save fields explicitly, zero out everything else") now zeroes the secure boot setting information (enabled/disabled/...) passed by the boot loader or by the kernel's EFI handover

[PATCH 5.2 81/94] ceph: fix buffer free while holding i_ceph_lock in __ceph_build_xattrs_blob()

2019-09-08 Thread Greg Kroah-Hartman
[ Upstream commit 12fe3dda7ed89c95cc0ef7abc001ad1ad3e092f8 ] Calling ceph_buffer_put() in __ceph_build_xattrs_blob() may result in freeing the i_xattrs.blob buffer while holding the i_ceph_lock. This can be fixed by having this function returning the old blob buffer and have the callers of this

[PATCH 5.2 84/94] afs: Fix leak in afs_lookup_cell_rcu()

2019-09-08 Thread Greg Kroah-Hartman
[ Upstream commit a5fb8e6c02d6a518fb2b1a2b8c2471fa77b69436 ] Fix a leak on the cell refcount in afs_lookup_cell_rcu() due to non-clearance of the default error in the case a NULL cell name is passed and the workstation default cell is used. Also put a bit at the end to make sure we don't leak a

[PATCH 5.2 57/94] cx82310_eth: fix a memory leak bug

2019-09-08 Thread Greg Kroah-Hartman
[ Upstream commit 1eca92eef18719027d394bf1a2d276f43e7cf886 ] In cx82310_bind(), 'dev->partial_data' is allocated through kmalloc(). Then, the execution waits for the firmware to become ready. If the firmware is not ready in time, the execution is terminated. However, the allocated

[PATCH 5.2 58/94] net: kalmia: fix memory leaks

2019-09-08 Thread Greg Kroah-Hartman
[ Upstream commit f1472cb09f11ddb41d4be84f0650835cb65a9073 ] In kalmia_init_and_get_ethernet_addr(), 'usb_buf' is allocated through kmalloc(). In the following execution, if the 'status' returned by kalmia_send_init_packet() is not 0, 'usb_buf' is not deallocated, leading to memory leaks. To fix

[PATCH 5.2 59/94] ibmvnic: Unmap DMA address of TX descriptor buffers after use

2019-09-08 Thread Greg Kroah-Hartman
[ Upstream commit 80f0fe0934cd3daa13a5e4d48a103f469115b160 ] There's no need to wait until a completion is received to unmap TX descriptor buffers that have been passed to the hypervisor. Instead unmap it when the hypervisor call has completed. This patch avoids the possibility that a buffer will

[PATCH 5.2 89/94] KVM: arm/arm64: VGIC: Properly initialise private IRQ affinity

2019-09-08 Thread Greg Kroah-Hartman
[ Upstream commit 2e16f3e926ed48373c98edea85c6ad0ef69425d1 ] At the moment we initialise the target *mask* of a virtual IRQ to the VCPU it belongs to, even though this mask is only defined for GICv2 and quickly runs out of bits for many GICv3 guests. This behaviour triggers an UBSAN complaint for

[PATCH 5.2 82/94] ceph: fix buffer free while holding i_ceph_lock in fill_inode()

2019-09-08 Thread Greg Kroah-Hartman
[ Upstream commit af8a85a41734f37b67ba8ce69d56b685bee4ac48 ] Calling ceph_buffer_put() in fill_inode() may result in freeing the i_xattrs.blob buffer while holding the i_ceph_lock. This can be fixed by postponing the call until later, when the lock is released. The following backtrace was

[PATCH 5.2 83/94] KVM: arm/arm64: Only skip MMIO insn once

2019-09-08 Thread Greg Kroah-Hartman
[ Upstream commit 2113c5f62b7423e4a72b890bd479704aa85c81ba ] If after an MMIO exit to userspace a VCPU is immediately run with an immediate_exit request, such as when a signal is delivered or an MMIO emulation completion is needed, then the VCPU completes the MMIO emulation and immediately

[PATCH 5.2 90/94] x86/boot/compressed/64: Fix missing initialization in find_trampoline_placement()

2019-09-08 Thread Greg Kroah-Hartman
[ Upstream commit c96e8483cb2da6695c8b8d0896fe7ae272a07b54 ] Gustavo noticed that 'new' can be left uninitialized if 'bios_start' happens to be less or equal to 'entry->addr + entry->size'. Initialize the variable at the begin of the iteration to the current value of 'bios_start'. Fixes:

[PATCH 5.2 54/94] clk: Fix potential NULL dereference in clk_fetch_parent_index()

2019-09-08 Thread Greg Kroah-Hartman
[ Upstream commit 24876f09a7dfe36a82f53d304d8c1bceb3257a0f ] Don't compare the parent clock name with a NULL name in the clk_parent_map. This prevents a kernel crash when passing NULL core->parents[i].name to strcmp(). An example which triggered this is a mux clock with four parents when each of

[PATCH 5.2 80/94] ceph: fix buffer free while holding i_ceph_lock in __ceph_setxattr()

2019-09-08 Thread Greg Kroah-Hartman
[ Upstream commit 86968ef21596515958d5f0a40233d02be78ecec0 ] Calling ceph_buffer_put() in __ceph_setxattr() may end up freeing the i_xattrs.prealloc_blob buffer while holding the i_ceph_lock. This can be fixed by postponing the call until later, when the lock is released. The following

[PATCH 5.2 78/94] selftests/kvm: make platform_info_test pass on AMD

2019-09-08 Thread Greg Kroah-Hartman
[ Upstream commit e4427372398c31f57450565de277f861a4db5b3b ] test_msr_platform_info_disabled() generates EXIT_SHUTDOWN but VMCB state is undefined after that so an attempt to launch this guest again from test_msr_platform_info_enabled() fails. Reorder the tests to make test pass. Signed-off-by:

[PATCH 5.2 62/94] ravb: Fix use-after-free ravb_tstamp_skb

2019-09-08 Thread Greg Kroah-Hartman
[ Upstream commit cfef46d692efd852a0da6803f920cc756eea2855 ] When a Tx timestamp is requested, a pointer to the skb is stored in the ravb_tstamp_skb struct. This was done without an skb_get. There exists the possibility that the skb could be freed by ravb_tx_free (when ravb_tx_free is called from

[PATCH 5.2 63/94] sched/core: Schedule new worker even if PI-blocked

2019-09-08 Thread Greg Kroah-Hartman
[ Upstream commit b0fdc01354f45d43f082025636ef808968a27b36 ] If a task is PI-blocked (blocking on sleeping spinlock) then we don't want to schedule a new kworker if we schedule out due to lock contention because !RT does not do that as well. A spinning spinlock disables preemption and a worker

[PATCH 5.2 52/94] net: myri10ge: fix memory leaks

2019-09-08 Thread Greg Kroah-Hartman
[ Upstream commit 20fb7c7a39b5c719e2e619673b5f5729ee7d2306 ] In myri10ge_probe(), myri10ge_alloc_slices() is invoked to allocate slices related structures. Later on, myri10ge_request_irq() is used to get an irq. However, if this process fails, the allocated slices related structures are not

[PATCH 5.2 70/94] Tools: hv: kvp: eliminate may be used uninitialized warning

2019-09-08 Thread Greg Kroah-Hartman
[ Upstream commit 89eb4d8d25722a0a0194cf7fa47ba602e32a6da7 ] When building hv_kvp_daemon GCC-8.3 complains: hv_kvp_daemon.c: In function ‘kvp_get_ip_info.constprop’: hv_kvp_daemon.c:812:30: warning: ‘ip_buffer’ may be used uninitialized in this function [-Wmaybe-uninitialized] struct

[PATCH 5.2 73/94] RDMA/cma: fix null-ptr-deref Read in cma_cleanup

2019-09-08 Thread Greg Kroah-Hartman
[ Upstream commit a7bfb93f0211b4a2f1ffeeb259ed6206bac30460 ] In cma_init, if cma_configfs_init fails, need to free the previously memory and return fail, otherwise will trigger null-ptr-deref Read in cma_cleanup. cma_cleanup cma_configfs_exit configfs_unregister_subsystem Fixes:

[PATCH 5.2 74/94] IB/mlx4: Fix memory leaks

2019-09-08 Thread Greg Kroah-Hartman
[ Upstream commit 5c1baaa82cea2c815a5180ded402a7cd455d1810 ] In mlx4_ib_alloc_pv_bufs(), 'tun_qp->tx_ring' is allocated through kcalloc(). However, it is not always deallocated in the following execution if an error occurs, leading to memory leaks. To fix this issue, free 'tun_qp->tx_ring'

[PATCH 5.2 65/94] HID: intel-ish-hid: ipc: add EHL device id

2019-09-08 Thread Greg Kroah-Hartman
[ Upstream commit b640be5bc8e4673dc8049cf74176ddedecea5597 ] EHL is a new platform using ishtp solution, add its device id to support list. Signed-off-by: Even Xu Acked-by: Srinivas Pandruvada Signed-off-by: Jiri Kosina Signed-off-by: Sasha Levin --- drivers/hid/intel-ish-hid/ipc/hw-ish.h

[PATCH 5.2 14/94] net/sched: cbs: Set default link speed to 10 Mbps in cbs_set_port_rate

2019-09-08 Thread Greg Kroah-Hartman
From: Vladimir Oltean The discussion to be made is absolutely the same as in the case of previous patch ("taprio: Set default link speed to 10 Mbps in taprio_set_picos_per_byte"). Nothing is lost when setting a default. Cc: Leandro Dorileo Fixes: e0a7683d30e9 ("net/sched: cbs: fix port_rate

[PATCH 5.2 11/94] r8152: remove calling netif_napi_del

2019-09-08 Thread Greg Kroah-Hartman
From: Hayes Wang [ Upstream commit 973dc6cfc0e2c43ff29ca5645ceaf1ae694ea110 ] Remove unnecessary use of netif_napi_del. This also avoids to call napi_disable() after netif_napi_del(). Signed-off-by: Hayes Wang Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman ---

[PATCH 5.2 47/94] cxgb4: fix a memory leak bug

2019-09-08 Thread Greg Kroah-Hartman
[ Upstream commit c554336efa9bbc28d6ec14efbee3c7d63c61a34f ] In blocked_fl_write(), 't' is not deallocated if bitmap_parse_user() fails, leading to a memory leak bug. To fix this issue, free t before returning the error. Signed-off-by: Wenwen Wang Signed-off-by: David S. Miller Signed-off-by:

<    1   2   3   4   5   6   >