[PATCH AUTOSEL 5.4 068/330] xfs: fix realtime file data space leak

2020-09-17 Thread Sasha Levin
From: Omar Sandoval [ Upstream commit 0c4da70c83d41a8461fdf50a3f7b292ecb04e378 ] Realtime files in XFS allocate extents in rextsize units. However, the written/unwritten state of those extents is still tracked in blocksize units. Therefore, a realtime file can be split up into written and

[PATCH AUTOSEL 5.4 067/330] s390: avoid misusing CALL_ON_STACK for task stack setup

2020-09-17 Thread Sasha Levin
From: Vasily Gorbik [ Upstream commit 7bcaad1f9fac889f5fcd1a383acf7e00d006da41 ] CALL_ON_STACK is intended to be used for temporary stack switching with potential return to the caller. When CALL_ON_STACK is misused to switch from nodat stack to task stack back_chain information would later

[PATCH AUTOSEL 5.4 080/330] neigh_stat_seq_next() should increase position index

2020-09-17 Thread Sasha Levin
From: Vasily Averin [ Upstream commit 1e3f9f073c47bee7c23e77316b07bc12338c5bba ] if seq_file .next fuction does not change position index, read after some lseek can generate unexpected output. https://bugzilla.kernel.org/show_bug.cgi?id=206283 Signed-off-by: Vasily Averin Signed-off-by: David

[PATCH] batman-adv: Fix orig node refcnt leak when creating neigh node

2020-09-17 Thread Xiyu Yang
batadv_neigh_node_create() is used to create a neigh node object, whose fields will be initialized with the specific object. When a new reference of the specific object is created during the initialization, its refcount should be increased. However, when "neigh_node" object initializes its

[PATCH AUTOSEL 5.4 078/330] tipc: fix link overflow issue at socket shutdown

2020-09-17 Thread Sasha Levin
From: Tuong Lien [ Upstream commit 49afb806cb650dd1f06f191994f3aa657d264009 ] When a socket is suddenly shutdown or released, it will reject all the unreceived messages in its receive queue. This applies to a connected socket too, whereas there is only one 'FIN' message required to be sent back

[PATCH AUTOSEL 5.4 079/330] vcc_seq_next should increase position index

2020-09-17 Thread Sasha Levin
From: Vasily Averin [ Upstream commit 8bf7092021f283944f0c5f4c364853201c45c611 ] if seq_file .next fuction does not change position index, read after some lseek can generate unexpected output. https://bugzilla.kernel.org/show_bug.cgi?id=206283 Signed-off-by: Vasily Averin Signed-off-by: David

[PATCH AUTOSEL 5.4 072/330] kernel/notifier.c: intercept duplicate registrations to avoid infinite loops

2020-09-17 Thread Sasha Levin
From: Xiaoming Ni [ Upstream commit 1a50cb80f219c44adb6265f5071b81fc3c1deced ] Registering the same notifier to a hook repeatedly can cause the hook list to form a ring or lose other members of the list. case1: An infinite loop in notifier_chain_register() can cause soft lockup

[PATCH AUTOSEL 5.4 083/330] drm/mcde: Handle pending vblank while disabling display

2020-09-17 Thread Sasha Levin
From: Stephan Gerhold [ Upstream commit 97de863673f07f424dd0666aefb4b6ecaba10171 ] Disabling the display using MCDE currently results in a warning together with a delay caused by some timeouts: mcde a035.mcde: MCDE display is disabled [ cut here ]

[PATCH AUTOSEL 5.4 081/330] rt_cpu_seq_next should increase position index

2020-09-17 Thread Sasha Levin
From: Vasily Averin [ Upstream commit a3ea86739f1bc7e121d921842f0f4a8ab1af94d9 ] if seq_file .next fuction does not change position index, read after some lseek can generate unexpected output. https://bugzilla.kernel.org/show_bug.cgi?id=206283 Signed-off-by: Vasily Averin Signed-off-by: David

[PATCH AUTOSEL 5.4 075/330] module: Remove accidental change of module_enable_x()

2020-09-17 Thread Sasha Levin
From: "Steven Rostedt (VMware)" [ Upstream commit af74262337faa65d5ac2944553437d3f5fb29123 ] When pulling in Divya Indi's patch, I made a minor fix to remove unneeded braces. I commited my fix up via "git commit -a --amend". Unfortunately, I didn't realize I had some changes I was testing in

[PATCH AUTOSEL 5.4 084/330] seqlock: Require WRITE_ONCE surrounding raw_seqcount_barrier

2020-09-17 Thread Sasha Levin
From: Marco Elver [ Upstream commit bf07132f96d426bcbf2098227fb680915cf44498 ] This patch proposes to require marked atomic accesses surrounding raw_write_seqcount_barrier. We reason that otherwise there is no way to guarantee propagation nor atomicity of writes before/after the barrier [1].

[PATCH AUTOSEL 5.4 087/330] opp: Replace list_kref with a local counter

2020-09-17 Thread Sasha Levin
From: Viresh Kumar [ Upstream commit 03758d60265c773e1d06d436b99ee338f2ac55d6 ] A kref or refcount isn't the right tool to be used here for counting number of devices that are sharing the static OPPs created for the OPP table. For example, we are reinitializing the kref again, after it reaches

[PATCH AUTOSEL 5.4 091/330] ACPI: EC: Reference count query handlers under lock

2020-09-17 Thread Sasha Levin
From: "Rafael J. Wysocki" [ Upstream commit 3df663a147fe077a6ee8444ec626738946e65547 ] There is a race condition in acpi_ec_get_query_handler() theoretically allowing query handlers to go away before refernce counting them. In order to avoid it, call kref_get() on query handlers under

[PATCH AUTOSEL 5.4 092/330] scsi: ufs: Make ufshcd_add_command_trace() easier to read

2020-09-17 Thread Sasha Levin
From: Bart Van Assche [ Upstream commit e4d2add7fd5bc64ee3e388eabe6b9e081cb42e11 ] Since the lrbp->cmd expression occurs multiple times, introduce a new local variable to hold that pointer. This patch does not change any functionality. Cc: Bean Huo Cc: Can Guo Cc: Avri Altman Cc: Stanley

[PATCH AUTOSEL 5.4 102/330] powerpc/eeh: Only dump stack once if an MMIO loop is detected

2020-09-17 Thread Sasha Levin
From: Oliver O'Halloran [ Upstream commit 4e0942c0302b5ad76b228b1a7b8c09f658a1d58a ] Many drivers don't check for errors when they get a 0xFFs response from an MMIO load. As a result after an EEH event occurs a driver can get stuck in a polling loop unless it some kind of internal timeout

[PATCH AUTOSEL 5.4 086/330] media: ti-vpe: cal: Restrict DMA to avoid memory corruption

2020-09-17 Thread Sasha Levin
From: Nikhil Devshatwar [ Upstream commit 6e72eab2e7b7a157d554b8f9faed7676047be7c1 ] When setting DMA for video capture from CSI channel, if the DMA size is not given, it ends up writing as much data as sent by the camera. This may lead to overwriting the buffers causing memory corruption.

[PATCH AUTOSEL 5.4 089/330] scsi: lpfc: Fix incomplete NVME discovery when target

2020-09-17 Thread Sasha Levin
From: James Smart [ Upstream commit be0709e449ac9d9753a5c17e5b770d6e5e930e4a ] NVMe device re-discovery does not complete. Dev_loss_tmo messages seen on initiator after recovery from a link disturbance. The failing case is the following: When the driver (as a NVME target) receives a PLOGI,

[PATCH AUTOSEL 5.4 093/330] scsi: ufs: Fix a race condition in the tracing code

2020-09-17 Thread Sasha Levin
From: Bart Van Assche [ Upstream commit eacf36f5bebde5089dddb3d5bfcbeab530b01f8a ] Starting execution of a command before tracing a command may cause the completion handler to free data while it is being traced. Fix this race by tracing a command before it is submitted. Cc: Bean Huo Cc: Can

[PATCH AUTOSEL 5.4 085/330] drm/scheduler: Avoid accessing freed bad job.

2020-09-17 Thread Sasha Levin
From: Andrey Grodzovsky [ Upstream commit 135517d3565b48f4def3b1b82008bc17eb5d1c90 ] Problem: Due to a race between drm_sched_cleanup_jobs in sched thread and drm_sched_job_timedout in timeout work there is a possiblity that bad job was already freed while still being accessed from the timeout

[PATCH AUTOSEL 5.4 090/330] sctp: move trace_sctp_probe_path into sctp_outq_sack

2020-09-17 Thread Sasha Levin
From: Kevin Kou [ Upstream commit f643ee295c1c63bc117fb052d4da681354d6f732 ] The original patch bringed in the "SCTP ACK tracking trace event" feature was committed at Dec.20, 2017, it replaced jprobe usage with trace events, and bringed in two trace events, one is TRACE_EVENT(sctp_probe),

[PATCH AUTOSEL 5.4 095/330] i2c: tegra: Prevent interrupt triggering after transfer timeout

2020-09-17 Thread Sasha Levin
From: Dmitry Osipenko [ Upstream commit b5d5605ca3cebb9b16c4f251635ef171ad18b80d ] Potentially it is possible that interrupt may fire after transfer timeout. That may not end up well for the next transfer because interrupt handling may race with hardware resetting. This is very unlikely to

[PATCH AUTOSEL 5.4 106/330] ARM: 8948/1: Prevent OOB access in stacktrace

2020-09-17 Thread Sasha Levin
From: Vincent Whitchurch [ Upstream commit 40ff1ddb5570284e039e0ff14d7a859a73dc3673 ] The stacktrace code can read beyond the stack size, when it attempts to read pt_regs from exception frames. This can happen on normal, non-corrupt stacks. Since the unwind information in the extable is not

[PATCH AUTOSEL 5.4 100/330] nfsd: Fix a soft lockup race in nfsd_file_mark_find_or_create()

2020-09-17 Thread Sasha Levin
From: Trond Myklebust [ Upstream commit 90d2f1da832fd23290ef0c0d964d97501e5e8553 ] If nfsd_file_mark_find_or_create() keeps winning the race for the nfsd_file_fsnotify_group->mark_mutex against nfsd_file_mark_put() then it can soft lock up, since fsnotify_add_inode_mark() ends up always finding

[PATCH AUTOSEL 5.4 097/330] btrfs: tree-checker: Check leaf chunk item size

2020-09-17 Thread Sasha Levin
From: Qu Wenruo [ Upstream commit f6d2a5c263afca84646cf3300dc13061bedbd99e ] Inspired by btrfs-progs github issue #208, where chunk item in chunk tree has invalid num_stripes (0). Although that can already be caught by current btrfs_check_chunk_valid(), that function doesn't really check item

[PATCH AUTOSEL 5.4 104/330] tracing: Set kernel_stack's caller size properly

2020-09-17 Thread Sasha Levin
From: Josef Bacik [ Upstream commit cbc3b92ce037f5e7536f6db157d185cd8b8f615c ] I noticed when trying to use the trace-cmd python interface that reading the raw buffer wasn't working for kernel_stack events. This is because it uses a stubbed version of __dynamic_array that doesn't do the

[PATCH AUTOSEL 5.4 107/330] ar5523: Add USB ID of SMCWUSBT-G2 wireless adapter

2020-09-17 Thread Sasha Levin
From: Mert Dirik [ Upstream commit 5b362498a79631f283578b64bf6f4d15ed4cc19a ] Add the required USB ID for running SMCWUSBT-G2 wireless adapter (SMC "EZ Connect g"). This device uses ar5523 chipset and requires firmware to be loaded. Even though pid of the device is 4507, this patch adds it as

[PATCH AUTOSEL 5.4 114/330] Bluetooth: prefetch channel before killing sock

2020-09-17 Thread Sasha Levin
From: Hillf Danton [ Upstream commit 2a154903cec20fb64ff4d7d617ca53c16f8fd53a ] Prefetch channel before killing sock in order to fix UAF like BUG: KASAN: use-after-free in l2cap_sock_release+0x24c/0x290 net/bluetooth/l2cap_sock.c:1212 Read of size 8 at addr 8880944904a0 by task

[PATCH AUTOSEL 5.4 098/330] dmaengine: zynqmp_dma: fix burst length configuration

2020-09-17 Thread Sasha Levin
From: Matthias Fend [ Upstream commit cc88525ebffc757e00cc5a5d61da6271646c7f5f ] Since the dma engine expects the burst length register content as power of 2 value, the burst length needs to be converted first. Additionally add a burst length range check to avoid corrupting unrelated register

[PATCH AUTOSEL 5.4 103/330] Bluetooth: btrtl: Use kvmalloc for FW allocations

2020-09-17 Thread Sasha Levin
From: Maxim Mikityanskiy [ Upstream commit 268d3636dfb22254324774de1f8875174b3be064 ] Currently, kmemdup is applied to the firmware data, and it invokes kmalloc under the hood. The firmware size and patch_length are big (more than PAGE_SIZE), and on some low-end systems (like ASUS E202SA)

[PATCH AUTOSEL 5.4 113/330] mm: pagewalk: fix termination condition in walk_pte_range()

2020-09-17 Thread Sasha Levin
From: Steven Price [ Upstream commit c02a98753e0a36ba65a05818626fa6adeb4e7c97 ] If walk_pte_range() is called with a 'end' argument that is beyond the last page of memory (e.g. ~0UL) then the comparison between 'addr' and 'end' will always fail and the loop will be infinite. Instead change

[PATCH AUTOSEL 5.4 096/330] efi/arm: Defer probe of PCIe backed efifb on DT systems

2020-09-17 Thread Sasha Levin
From: Ard Biesheuvel [ Upstream commit 64c8a0cd0a535891d5905c3a1651150f0f141439 ] The new of_devlink support breaks PCIe probing on ARM platforms booting via UEFI if the firmware exposes a EFI framebuffer that is backed by a PCI device. The reason is that the probing order gets reversed,

[PATCH AUTOSEL 5.4 122/330] scsi: lpfc: Fix RQ buffer leakage when no IOCBs available

2020-09-17 Thread Sasha Levin
From: James Smart [ Upstream commit 39c4f1a965a9244c3ba60695e8ff8da065ec6ac4 ] The driver is occasionally seeing the following SLI Port error, requiring reset and reinit: Port Status Event: ... error 1=0x52004a01, error 2=0x218 The failure means an RQ timeout. That is, the adapter had

[PATCH AUTOSEL 5.4 116/330] ALSA: hda: Clear RIRB status before reading WP

2020-09-17 Thread Sasha Levin
From: Mohan Kumar [ Upstream commit 6d011d5057ff88ee556c000ac6fe0be23bdfcd72 ] RIRB interrupt status getting cleared after the write pointer is read causes a race condition, where last response(s) into RIRB may remain unserviced by IRQ, eventually causing azx_rirb_get_response to fall back to

[PATCH AUTOSEL 5.4 115/330] KVM: fix overflow of zero page refcount with ksm running

2020-09-17 Thread Sasha Levin
From: Zhuang Yanying [ Upstream commit 7df003c85218b5f5b10a7f6418208f31e813f38f ] We are testing Virtual Machine with KSM on v5.4-rc2 kernel, and found the zero_page refcount overflow. The cause of refcount overflow is increased in try_async_pf (get_user_page) without being decreased in

[PATCH AUTOSEL 5.4 121/330] selinux: sel_avc_get_stat_idx should increase position index

2020-09-17 Thread Sasha Levin
From: Vasily Averin [ Upstream commit 8d269a8e2a8f0bca89022f4ec98de460acb90365 ] If seq_file .next function does not change position index, read after some lseek can generate unexpected output. $ dd if=/sys/fs/selinux/avc/cache_stats # usual output lookups hits misses allocations reclaims

[PATCH AUTOSEL 5.4 117/330] skbuff: fix a data race in skb_queue_len()

2020-09-17 Thread Sasha Levin
From: Qian Cai [ Upstream commit 86b18aaa2b5b5bb48e609cd591b3d2d0fdbe0442 ] sk_buff.qlen can be accessed concurrently as noticed by KCSAN, BUG: KCSAN: data-race in __skb_try_recv_from_queue / unix_dgram_sendmsg read to 0x8a1b1d8a81c0 of 4 bytes by task 5371 on cpu 96:

[PATCH AUTOSEL 5.4 123/330] scsi: lpfc: Fix release of hwq to clear the eq relationship

2020-09-17 Thread Sasha Levin
From: James Smart [ Upstream commit 821bc882accaaaf1bbecf5c0ecef659443e3e8cb ] When performing reset testing, the eq's list for related hwqs was getting corrupted. In cases where there is not a 1:1 eq to hwq, the eq is shared. The eq maintains a list of hwqs utilizing it in case of cpu

[PATCH AUTOSEL 5.4 128/330] crypto: chelsio - This fixes the kernel panic which occurs during a libkcapi test

2020-09-17 Thread Sasha Levin
From: Ayush Sawal [ Upstream commit 9195189e00a7db55e7d448cee973cae87c5a3c71 ] The libkcapi test which causes kernel panic is aead asynchronous vmsplice multiple test. ./bin/kcapi -v -d 4 -x 10 -c "ccm(aes)" -q 4edb58e8d5eb6bc711c43a6f3693daebde2e5524f1b55297abb29f003236e43d -t a7877c99 -n

linux-next: manual merge of the drm-msm tree with the drm tree

2020-09-17 Thread Stephen Rothwell
Hi all, Today's linux-next merge of the drm-msm tree got a conflict in: drivers/gpu/drm/msm/msm_gem.c between commit: 7690a33f22ab ("drm: msm: fix common struct sg_table related issues") from the drm tree and commit: e1bf29e022fb ("drm/msm: drop cache sync hack") from the drm-msm

[PATCH AUTOSEL 5.4 110/330] tools/power/x86/intel_pstate_tracer: changes for python 3 compatibility

2020-09-17 Thread Sasha Levin
From: Doug Smythies [ Upstream commit e749e09db30c38f1a275945814b0109e530a07b0 ] Some syntax needs to be more rigorous for python 3. Backwards compatibility tested with python 2.7 Signed-off-by: Doug Smythies Signed-off-by: Rafael J. Wysocki Signed-off-by: Sasha Levin ---

[PATCH AUTOSEL 5.4 127/330] clk: stratix10: use do_div() for 64-bit calculation

2020-09-17 Thread Sasha Levin
From: Dinh Nguyen [ Upstream commit cc26ed7be46c5f5fa45f3df8161ed7ca3c4d318c ] do_div() macro to perform u64 division and guards against overflow if the result is too large for the unsigned long return type. Signed-off-by: Dinh Nguyen Link:

[PATCH AUTOSEL 5.4 129/330] mt76: clear skb pointers from rx aggregation reorder buffer during cleanup

2020-09-17 Thread Sasha Levin
From: Felix Fietkau [ Upstream commit 9379df2fd9234e3b67a23101c2370c99f6af6d77 ] During the cleanup of the aggregation session, a rx handler (or release timer) on another CPU might still hold a pointer to the reorder buffer and could attempt to release some packets. Clearing pointers during

[PATCH AUTOSEL 5.4 118/330] nfsd: Fix a perf warning

2020-09-17 Thread Sasha Levin
From: Trond Myklebust [ Upstream commit a9ceb060b3cf37987b6162223575eaf4f4e0fc36 ] perf does not know how to deal with a __builtin_bswap32() call, and complains. All other functions just store the xid etc in host endian form, so let's do that in the tracepoint for nfsd_file_acquire too.

[PATCH AUTOSEL 5.4 131/330] ALSA: usb-audio: Don't create a mixer element with bogus volume range

2020-09-17 Thread Sasha Levin
From: Takashi Iwai [ Upstream commit e9a0ef0b5ddcbc0d56c65aefc0f18d16e6f71207 ] Some USB-audio descriptors provide a bogus volume range (e.g. volume min and max are identical), which confuses user-space. This patch makes the driver skipping such a control element. BugLink:

[PATCH AUTOSEL 5.4 130/330] mt76: fix handling full tx queues in mt76_dma_tx_queue_skb_raw

2020-09-17 Thread Sasha Levin
From: Felix Fietkau [ Upstream commit 93eaec7625f13cffb593b471405b017c7e64d4ee ] Fixes a theoretical issue where it could potentially overwrite an existing descriptor entry (and leaking its skb) Signed-off-by: Felix Fietkau Signed-off-by: Sasha Levin ---

[PATCH AUTOSEL 5.4 134/330] KVM: x86: fix incorrect comparison in trace event

2020-09-17 Thread Sasha Levin
From: Paolo Bonzini [ Upstream commit 147f1a1fe5d7e6b01b8df4d0cbd6f9eaf6b6c73b ] The "u" field in the event has three states, -1/0/1. Using u8 however means that comparison with -1 will always fail, so change to signed char. Signed-off-by: Paolo Bonzini Signed-off-by: Sasha Levin ---

[PATCH AUTOSEL 5.4 135/330] KVM: nVMX: Hold KVM's srcu lock when syncing vmcs12->shadow

2020-09-17 Thread Sasha Levin
From: wanpeng li [ Upstream commit c9dfd3fb08352d439f0399b6fabe697681d2638c ] For the duration of mapping eVMCS, it derefences ->memslots without holding ->srcu or ->slots_lock when accessing hv assist page. This patch fixes it by moving nested_sync_vmcs12_to_shadow to prepare_guest_switch,

[PATCH AUTOSEL 5.4 138/330] x86/pkeys: Add check for pkey "overflow"

2020-09-17 Thread Sasha Levin
From: Dave Hansen [ Upstream commit 16171bffc829272d5e6014bad48f680cb50943d9 ] Alex Shi reported the pkey macros above arch_set_user_pkey_access() to be unused. They are unused, and even refer to a nonexistent CONFIG option. But, they might have served a good use, which was to ensure that the

[PATCH AUTOSEL 5.4 133/330] RDMA/rxe: Fix configuration of atomic queue pair attributes

2020-09-17 Thread Sasha Levin
From: Bart Van Assche [ Upstream commit fb3063d31995cc4cf1d47a406bb61d6fb1b1d58d ] >From the comment above the definition of the roundup_pow_of_two() macro: The result is undefined when n == 0. Hence only pass positive values to roundup_pow_of_two(). This patch fixes the following UBSAN

[PATCH AUTOSEL 5.4 154/330] drm/amd/display: fix image corruption with ODM 2:1 DSC 2 slice

2020-09-17 Thread Sasha Levin
From: Wenjing Liu [ Upstream commit df8e34ac27e8a0d8dce364628226c5619693c3fd ] [why] When combining two or more pipes in DSC mode, there will always be more than 1 slice per line. In this case, as per DSC rules, the sink device is expecting that the ICH is reset at the end of each slice line

[PATCH AUTOSEL 5.4 142/330] soundwire: bus: disable pm_runtime in sdw_slave_delete

2020-09-17 Thread Sasha Levin
From: Pierre-Louis Bossart [ Upstream commit dff70572e9a3a1a01d9dbc2279faa784d95f41b6 ] Before removing the slave device, disable pm_runtime to prevent any race condition with the resume being executed after the bus and slave devices are removed. Since this pm_runtime_disable() is handled in

[PATCH AUTOSEL 5.4 147/330] random: fix data races at timer_rand_state

2020-09-17 Thread Sasha Levin
From: Qian Cai [ Upstream commit e00d996a4317aff5351c4338dd97d390225412c2 ] Fields in "struct timer_rand_state" could be accessed concurrently. Lockless plain reads and writes result in data races. Fix them by adding pairs of READ|WRITE_ONCE(). The data races were reported by KCSAN, BUG:

[PATCH AUTOSEL 5.4 146/330] firmware: arm_sdei: Use cpus_read_lock() to avoid races with cpuhp

2020-09-17 Thread Sasha Levin
From: James Morse [ Upstream commit 54f529a6806c9710947a4f2cdc15d6ea54121ccd ] SDEI has private events that need registering and enabling on each CPU. CPUs can come and go while we are trying to do this. SDEI tries to avoid these problems by setting the reregister flag before the register call,

[PATCH AUTOSEL 5.4 143/330] drm/amd/display: dal_ddc_i2c_payloads_create can fail causing panic

2020-09-17 Thread Sasha Levin
From: Aric Cyr [ Upstream commit 6a6c4a4d459ecacc9013c45dcbf2bc9747fdbdbd ] [Why] Since the i2c payload allocation can fail need to check return codes [How] Clean up i2c payload allocations and check for errors Signed-off-by: Aric Cyr Reviewed-by: Joshua Aberback Acked-by: Rodrigo Siqueira

[PATCH AUTOSEL 5.4 137/330] media: staging/imx: Missing assignment in imx_media_capture_device_register()

2020-09-17 Thread Sasha Levin
From: Dan Carpenter [ Upstream commit ef0ed05dcef8a74178a8b480cce23a377b1de2b8 ] There was supposed to be a "ret = " assignment here, otherwise the error handling on the next line won't work. Fixes: 64b5a49df486 ("[media] media: imx: Add Capture Device Interface") Signed-off-by: Dan Carpenter

[PATCH AUTOSEL 5.4 153/330] powerpc/book3s64: Fix error handling in mm_iommu_do_alloc()

2020-09-17 Thread Sasha Levin
From: Alexey Kardashevskiy [ Upstream commit c4b78169e3667413184c9a20e11b5832288a109f ] The last jump to free_exit in mm_iommu_do_alloc() happens after page pointers in struct mm_iommu_table_group_mem_t were already converted to physical addresses. Thus calling put_page() on these physical

[PATCH AUTOSEL 5.4 145/330] iavf: use tc_cls_can_offload_and_chain0() instead of chain check

2020-09-17 Thread Sasha Levin
From: Jiri Pirko [ Upstream commit bb0858d8bc828ebc3eaa90be02a0f32bca3c2351 ] Looks like the iavf code actually experienced a race condition, when a developer took code before the check for chain 0 was put to helper. So use tc_cls_can_offload_and_chain0() helper instead of direct check and move

[PATCH AUTOSEL 5.4 148/330] bus: hisi_lpc: Fixup IO ports addresses to avoid use-after-free in host removal

2020-09-17 Thread Sasha Levin
From: John Garry [ Upstream commit a6dd255bdd7d00bbdbf78ba00bde9fc64f86c3a7 ] Some released ACPI FW for Huawei boards describes incorrect the port IO address range for child devices, in that it tells us the IO port max range is 0x3fff for each child device, which is not correct. The address

[PATCH AUTOSEL 5.4 152/330] timekeeping: Prevent 32bit truncation in scale64_check_overflow()

2020-09-17 Thread Sasha Levin
From: Wen Yang [ Upstream commit 4cbbc3a0eeed675449b1a4d080008927121f3da3 ] While unlikely the divisor in scale64_check_overflow() could be >= 32bit in scale64_check_overflow(). do_div() truncates the divisor to 32bit at least on 32bit platforms. Use div64_u64() instead to avoid the truncation

[PATCH AUTOSEL 5.4 140/330] dmaengine: stm32-dma: use vchan_terminate_vdesc() in .terminate_all

2020-09-17 Thread Sasha Levin
From: Amelie Delaunay [ Upstream commit d80cbef35bf89b763f06e03bb4ff8f933bf012c5 ] To avoid race with vchan_complete, use the race free way to terminate running transfer. Move vdesc->node list_del in stm32_dma_start_transfer instead of in stm32_mdma_chan_complete to avoid another race in

[PATCH AUTOSEL 5.4 132/330] perf test: Fix test trace+probe_vfs_getname.sh on s390

2020-09-17 Thread Sasha Levin
From: Thomas Richter [ Upstream commit 2bbc83537614517730e9f2811195004b712de207 ] This test places a kprobe to function getname_flags() in the kernel which has the following prototype: struct filename *getname_flags(const char __user *filename, int flags, int *empty) The 'filename'

[PATCH AUTOSEL 5.4 155/330] ext4: fix a data race at inode->i_disksize

2020-09-17 Thread Sasha Levin
From: Qiujun Huang [ Upstream commit dce8e237100f60c28cc66effb526ba65a01d8cb3 ] KCSAN find inode->i_disksize could be accessed concurrently. BUG: KCSAN: data-race in ext4_mark_iloc_dirty / ext4_write_end write (marked) to 0x8b8932f40090 of 8 bytes by task 66792 on cpu 0:

[PATCH AUTOSEL 5.4 144/330] drm/omap: dss: Cleanup DSS ports on initialisation failure

2020-09-17 Thread Sasha Levin
From: Laurent Pinchart [ Upstream commit 2a0a3ae17d36fa86dcf7c8e8d7b7f056ebd6c064 ] When the DSS initialises its output DPI and SDI ports, failures don't clean up previous successfully initialised ports. This can lead to resource leak or memory corruption. Fix it. Reported-by: Hans Verkuil

[PATCH AUTOSEL 5.4 156/330] perf jevents: Fix leak of mapfile memory

2020-09-17 Thread Sasha Levin
From: John Garry [ Upstream commit 3f5777fbaf04c58d940526a22a2e0c813c837936 ] The memory for global pointer is never freed during normal program execution, so let's do that in the main function exit as a good programming practice. A stray blank line is also removed. Reported-by: Jiri Olsa

[PATCH AUTOSEL 5.4 159/330] ARM: OMAP2+: Handle errors for cpu_pm

2020-09-17 Thread Sasha Levin
From: Tony Lindgren [ Upstream commit 55be2f50336f67800513b46c5ba6270e4ed0e784 ] We need to check for errors when calling cpu_pm_enter() and cpu_cluster_pm_enter(). And we need to bail out on errors as otherwise we can enter a deeper idle state when not desired. I'm not aware of the lack of

[PATCH AUTOSEL 5.4 171/330] xfs: don't ever return a stale pointer from __xfs_dir3_free_read

2020-09-17 Thread Sasha Levin
From: "Darrick J. Wong" [ Upstream commit 1cb5deb5bc095c070c09a4540c45f9c9ba24be43 ] If we decide that a directory free block is corrupt, we must take care not to leak a buffer pointer to the caller. After xfs_trans_brelse returns, the buffer can be freed or reused, which means that we have to

[PATCH AUTOSEL 5.4 157/330] mm: avoid data corruption on CoW fault into PFN-mapped VMA

2020-09-17 Thread Sasha Levin
From: "Kirill A. Shutemov" [ Upstream commit c3e5ea6ee574ae5e845a40ac8198de1fb63bb3ab ] Jeff Moyer has reported that one of xfstests triggers a warning when run on DAX-enabled filesystem: WARNING: CPU: 76 PID: 51024 at mm/memory.c:2317 wp_page_copy+0xc40/0xd50 ...

[PATCH AUTOSEL 5.4 158/330] drm/amdgpu: increase atombios cmd timeout

2020-09-17 Thread Sasha Levin
From: John Clements [ Upstream commit 1b3460a8b19688ad3033b75237d40fa580a5a953 ] mitigates race condition on BACO reset between GPU bootcode and driver reload Reviewed-by: Hawking Zhang Signed-off-by: John Clements Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin ---

[PATCH AUTOSEL 5.4 164/330] perf cs-etm: Swap packets for instruction samples

2020-09-17 Thread Sasha Levin
From: Leo Yan [ Upstream commit d01751563caf0dec7be36f81de77cc0197b77e59 ] If use option '--itrace=iNNN' with Arm CoreSight trace data, perf tool fails inject instruction samples; the root cause is the packets are only swapped for branch samples and last branches but not for instruction

[PATCH AUTOSEL 5.4 168/330] Bluetooth: L2CAP: handle l2cap config request during open state

2020-09-17 Thread Sasha Levin
From: Howard Chung [ Upstream commit 96298f640104e4cd9a913a6e50b0b981829b94ff ] According to Core Spec Version 5.2 | Vol 3, Part A 6.1.5, the incoming L2CAP_ConfigReq should be handled during OPEN state. The section below shows the btmon trace when running L2CAP/COS/CFD/BV-12-C before and

[PATCH AUTOSEL 5.4 170/330] tty: sifive: Finish transmission before changing the clock

2020-09-17 Thread Sasha Levin
From: Palmer Dabbelt [ Upstream commit 4cbd7814bbd595061fcb6d6355d63f04179161cd ] SiFive's UART has a software controller clock divider that produces the final baud rate clock. Whenever the clock that drives the UART is changed this divider must be updated accordingly, and given that these two

[PATCH AUTOSEL 5.4 163/330] s390/irq: replace setup_irq() by request_irq()

2020-09-17 Thread Sasha Levin
From: afzal mohammed [ Upstream commit 8719b6d29d2851fa84c4074bb2e5adc022911ab8 ] request_irq() is preferred over setup_irq(). Invocations of setup_irq() occur after memory allocators are ready. Per tglx[1], setup_irq() existed in olden days when allocators were not ready by the time early

[PATCH AUTOSEL 5.4 169/330] media: tda10071: fix unsigned sign extension overflow

2020-09-17 Thread Sasha Levin
From: Colin Ian King [ Upstream commit a7463e2dc698075132de9905b89f495df888bb79 ] The shifting of buf[3] by 24 bits to the left will be promoted to a 32 bit signed int and then sign-extended to an unsigned long. In the unlikely event that the the top bit of buf[3] is set then all then all the

[PATCH AUTOSEL 5.4 173/330] ext4: mark block bitmap corrupted when found instead of BUGON

2020-09-17 Thread Sasha Levin
From: Dmitry Monakhov [ Upstream commit eb5760863fc28feab28b567ddcda7e667e638da0 ] We already has similar code in ext4_mb_complex_scan_group(), but ext4_mb_simple_scan_group() still affected. Other reports: https://www.spinics.net/lists/linux-ext4/msg60231.html Reviewed-by: Andreas Dilger

[PATCH AUTOSEL 5.4 174/330] tpm: ibmvtpm: Wait for buffer to be set before proceeding

2020-09-17 Thread Sasha Levin
From: Stefan Berger [ Upstream commit d8d74ea3c00214aee1e1826ca18e77944812b9b4 ] Synchronize with the results from the CRQs before continuing with the initialization. This avoids trying to send TPM commands while the rtce buffer has not been allocated, yet. This patch fixes an existing race

[PATCH AUTOSEL 5.4 175/330] rtc: sa1100: fix possible race condition

2020-09-17 Thread Sasha Levin
From: Alexandre Belloni [ Upstream commit f2997775b111c6d660c32a18d5d44d37cb7361b1 ] Both RTC IRQs are requested before the struct rtc_device is allocated, this may lead to a NULL pointer dereference in the IRQ handler. To fix this issue, allocating the rtc_device struct before requesting the

[PATCH AUTOSEL 5.4 172/330] xfs: mark dir corrupt when lookup-by-hash fails

2020-09-17 Thread Sasha Levin
From: "Darrick J. Wong" [ Upstream commit 2e107cf869eecc770e3f630060bb4e5f547d0fd8 ] In xchk_dir_actor, we attempt to validate the directory hash structures by performing a directory entry lookup by (hashed) name. If the lookup returns ENOENT, that means that the hash information is corrupt.

[PATCH AUTOSEL 5.4 181/330] drm/msm: fix leaks if initialization fails

2020-09-17 Thread Sasha Levin
From: Pavel Machek [ Upstream commit 66be340f827554cb1c8a1ed7dea97920b4085af2 ] We should free resources in unlikely case of allocation failure. Signed-off-by: Pavel Machek Signed-off-by: Rob Clark Signed-off-by: Sasha Levin --- drivers/gpu/drm/msm/msm_drv.c | 6 -- 1 file changed, 4

Re: [PATCH 3/3] hwmon: (lm75) Add regulator support

2020-09-17 Thread Guenter Roeck
On 9/17/20 4:00 AM, Mark Brown wrote: > On Thu, Sep 17, 2020 at 12:18:19PM +0200, Alban Bedel wrote: > >> +data->vs = devm_regulator_get_optional(dev, "vs"); >> +if (IS_ERR(data->vs)) { > > Unless the device can work without power you should not be using > regulator_get_optional(). >

[PATCH AUTOSEL 5.4 180/330] KVM: PPC: Book3S HV: Treat TM-related invalid form instructions on P9 like the valid ones

2020-09-17 Thread Sasha Levin
From: Gustavo Romero [ Upstream commit 1dff3064c764b5a51c367b949b341d2e38972bec ] On P9 DD2.2 due to a CPU defect some TM instructions need to be emulated by KVM. This is handled at first by the hardware raising a softpatch interrupt when certain TM instructions that need KVM assistance are

[PATCH AUTOSEL 5.4 183/330] tracing: Use address-of operator on section symbols

2020-09-17 Thread Sasha Levin
From: Nathan Chancellor [ Upstream commit bf2cbe044da275021b2de5917240411a19e5c50d ] Clang warns: ../kernel/trace/trace.c:9335:33: warning: array comparison always evaluates to true [-Wtautological-compare] if (__stop___trace_bprintk_fmt != __start___trace_bprintk_fmt)

[PATCH AUTOSEL 5.4 165/330] perf cs-etm: Correct synthesizing instruction samples

2020-09-17 Thread Sasha Levin
From: Leo Yan [ Upstream commit c9f5baa136777b2c982f6f7a90c9da69a88be148 ] When 'etm->instructions_sample_period' is less than 'tidq->period_instructions', the function cs_etm__sample() cannot handle this case properly with its logic. Let's see below flow as an example: - If we set itrace

[PATCH] f2fs: compress: fix to disallow enabling compress on non-empty file

2020-09-17 Thread Chao Yu
Compressed inode and normal inode has different layout, so we should disallow enabling compress on non-empty file to avoid race condition during inode .i_addr array parsing and updating. Signed-off-by: Chao Yu --- fs/f2fs/file.c | 2 ++ 1 file changed, 2 insertions(+) diff --git

[PATCH AUTOSEL 5.4 182/330] drm/msm/a5xx: Always set an OPP supported hardware value

2020-09-17 Thread Sasha Levin
From: Jordan Crouse [ Upstream commit 0478b4fc5f37f4d494245fe7bcce3f531cf380e9 ] If the opp table specifies opp-supported-hw as a property but the driver has not set a supported hardware value the OPP subsystem will reject all the table entries. Set a "default" value that will match the

[PATCH AUTOSEL 5.4 189/330] r8169: improve RTL8168b FIFO overflow workaround

2020-09-17 Thread Sasha Levin
From: Heiner Kallweit [ Upstream commit 6b02e407cbf8d421477ebb7792cd6380affcd313 ] So far only the reset bit it set, but the handler executing the reset is not scheduled. Therefore nothing will happen until some other action schedules the handler. Improve this by ensuring that the handler is

[PATCH AUTOSEL 5.4 190/330] serial: 8250_port: Don't service RX FIFO if throttled

2020-09-17 Thread Sasha Levin
From: Vignesh Raghavendra [ Upstream commit f19c3f6c8109b8bab000afd35580929958e087a9 ] When port's throttle callback is called, it should stop pushing any more data into TTY buffer to avoid buffer overflow. This means driver has to stop HW from receiving more data and assert the HW flow

[PATCH AUTOSEL 5.4 193/330] perf cpumap: Fix snprintf overflow check

2020-09-17 Thread Sasha Levin
From: Christophe JAILLET [ Upstream commit d74b181a028bb5a468f0c609553eff6a8fdf4887 ] 'snprintf' returns the number of characters which would be generated for the given input. If the returned value is *greater than* or equal to the buffer size, it means that the output has been truncated. Fix

[PATCH AUTOSEL 5.4 185/330] KVM: LAPIC: Mark hrtimer for period or oneshot mode to expire in hard interrupt context

2020-09-17 Thread Sasha Levin
From: He Zhe [ Upstream commit edec6e015a02003c2af0ce82c54ea016b5a9e3f0 ] apic->lapic_timer.timer was initialized with HRTIMER_MODE_ABS_HARD but started later with HRTIMER_MODE_ABS, which may cause the following warning in PREEMPT_RT kernel. WARNING: CPU: 1 PID: 2957 at

[PATCH AUTOSEL 5.4 177/330] nfsd: Don't add locks to closed or closing open stateids

2020-09-17 Thread Sasha Levin
From: Trond Myklebust [ Upstream commit a451b12311aa8c96c6f6e01c783a86995dc3ec6b ] In NFSv4, the lock stateids are tied to the lockowner, and the open stateid, so that the action of closing the file also results in either an automatic loss of the locks, or an error of the form

[PATCH AUTOSEL 5.4 197/330] tools: gpio-hammer: Avoid potential overflow in main

2020-09-17 Thread Sasha Levin
From: Gabriel Ravier [ Upstream commit d1ee7e1f5c9191afb69ce46cc7752e4257340a31 ] If '-o' was used more than 64 times in a single invocation of gpio-hammer, this could lead to an overflow of the 'lines' array. This commit fixes this by avoiding the overflow and giving a proper diagnostic back

[PATCH AUTOSEL 5.4 184/330] thermal: rcar_thermal: Handle probe error gracefully

2020-09-17 Thread Sasha Levin
From: Niklas Söderlund [ Upstream commit 39056e8a989ef52486e063e34b4822b341e47b0e ] If the common register memory resource is not available the driver needs to fail gracefully to disable PM. Instead of returning the error directly store it in ret and use the already existing error path.

[PATCH AUTOSEL 5.4 186/330] perf parse-events: Fix 3 use after frees found with clang ASAN

2020-09-17 Thread Sasha Levin
From: Ian Rogers [ Upstream commit d4953f7ef1a2e87ef732823af35361404d13fea8 ] Reproducible with a clang asan build and then running perf test in particular 'Parse event definition strings'. Signed-off-by: Ian Rogers Acked-by: Jiri Olsa Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Andi

[PATCH AUTOSEL 5.4 196/330] cpufreq: powernv: Fix frame-size-overflow in powernv_cpufreq_work_fn

2020-09-17 Thread Sasha Levin
From: Pratik Rajesh Sampat [ Upstream commit d95fe371ecd28901f11256c610b988ed44e36ee2 ] The patch avoids allocating cpufreq_policy on stack hence fixing frame size overflow in 'powernv_cpufreq_work_fn' Fixes: 227942809b52 ("cpufreq: powernv: Restore cpu frequency to policy->cur on

[PATCH AUTOSEL 5.4 202/330] proc: Use new infrastructure to fix deadlocks in execve

2020-09-17 Thread Sasha Levin
From: Bernd Edlinger [ Upstream commit 2db9dbf71bf98d02a0bf33e798e5bfd2a9944696 ] This changes lock_trace to use the new exec_update_mutex instead of cred_guard_mutex. This fixes possible deadlocks when the trace is accessing /proc/$pid/stack for instance. This should be safe, as the

[PATCH AUTOSEL 5.4 195/330] net: axienet: Propagate failure of DMA descriptor setup

2020-09-17 Thread Sasha Levin
From: Andre Przywara [ Upstream commit ee44d0b78839b21591501424fd3cb3648cc803b5 ] When we fail allocating the DMA buffers in axienet_dma_bd_init(), we report this error, but carry on with initialisation nevertheless. This leads to a kernel panic when the driver later wants to send a packet, as

[PATCH 01/13] mm: use add_page_to_lru_list()

2020-09-17 Thread Yu Zhao
This patch replaces the only open-coded lru list addition with add_page_to_lru_list(). Before this patch, we have: update_lru_size() list_move() After this patch, we have: list_del() add_page_to_lru_list() update_lru_size()

[PATCH 03/13] mm: move __ClearPageLRU() into page_off_lru()

2020-09-17 Thread Yu Zhao
Now we have a total of three places that free lru pages when their references become zero (after we drop the reference from isolation). Before this patch, they all do: __ClearPageLRU() page_off_lru() del_page_from_lru_list() After this patch, they become:

[PATCH AUTOSEL 5.4 207/330] nvme: Fix controller creation races with teardown flow

2020-09-17 Thread Sasha Levin
From: Israel Rukshin [ Upstream commit ce1518139e6976cf19c133b555083354fdb629b8 ] Calling nvme_sysfs_delete() when the controller is in the middle of creation may cause several bugs. If the controller is in NEW state we remove delete_controller file and don't delete the controller. The user

[PATCH AUTOSEL 5.4 205/330] nvme-multipath: do not reset on unknown status

2020-09-17 Thread Sasha Levin
From: John Meneghini [ Upstream commit 764e9332098c0e60251386a507fe46ac91276120 ] The nvme multipath error handling defaults to controller reset if the error is unknown. There are, however, no existing nvme status codes that indicate a reset should be used, and resetting causes unnecessary

[PATCH 06/13] mm: don't pass enum lru_list to trace_mm_lru_insertion()

2020-09-17 Thread Yu Zhao
The parameter is redundant in the sense that it can be extracted from the struct page parameter by page_lru() correctly. This change should have no side effects. Signed-off-by: Yu Zhao --- include/trace/events/pagemap.h | 11 --- mm/swap.c | 5 + 2 files

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