Re: [RFC 6/7] mm: extend process_madvise syscall to support vector arrary

2019-05-29 Thread Michal Hocko
On Thu 30-05-19 11:17:48, Minchan Kim wrote: > On Wed, May 29, 2019 at 12:33:52PM +0200, Michal Hocko wrote: > > On Wed 29-05-19 03:08:32, Daniel Colascione wrote: > > > On Mon, May 27, 2019 at 12:49 AM Minchan Kim wrote: > > > > > > > > On Tue, May 21, 2019 at 12:37:26PM +0200, Michal Hocko wrote

[HELP] How to get task_struct from mm

2019-05-29 Thread Yang Shi
Hi folks, As what we discussed about page demotion for PMEM at LSF/MM, the demotion should respect to the mempolicy and allowed mems of the process which the page (anonymous page only for now) belongs to. The vma that the page is mapped to can be retrieved from rmap walk easily, but we nee

Re: [EXTERNAL] Re: [PATCH v3 1/3] PCI: Introduce pcibios_ignore_alignment_request

2019-05-29 Thread Sam Bobroff
On Tue, May 28, 2019 at 03:36:34PM +1000, Oliver wrote: > On Tue, May 28, 2019 at 2:03 PM Shawn Anastasio wrote: > > > > Introduce a new pcibios function pcibios_ignore_alignment_request > > which allows the PCI core to defer to platform-specific code to > > determine whether or not to ignore alig

Re: [PATCH v2] riscv: Fix udelay in RV32.

2019-05-29 Thread Nick Hu
On Thu, May 30, 2019 at 02:49:10PM +0800, Nick Chun-Ming Hu(胡峻銘) wrote: > In RV32, udelay would delay the wrong cycle. When it shifts right > "UDELAY_SHITFT" bits, it either delays 0 cycle or 1 cycle. It only works > correctly in RV64. Because the 'ucycles' always needs to be 64 bits > variable. >

Re: [GIT PULL] keys: Miscellany

2019-05-29 Thread James Morris
On Wed, 29 May 2019, David Howells wrote: > Hi James, > > Here are some miscellaneous keyrings fixes and improvements intended for > the next merge window, if you could pull them please. > Linus has asked for security subsystem PRs to go directly to him. -- James Morris

Re: linux-next: manual merge of the net-next tree with the net tree

2019-05-29 Thread Maxim Uvarov
Merge fix looks like correct. Might be my fault I sent dp83867 patches against linux.git, not linux-next.git. If you want I can resend updated version for linux-next. Max. чт, 30 мая 2019 г. в 02:56, Stephen Rothwell : > > Hi all, > > Today's linux-next merge of the net-next tree got a conflict i

Re: [PATCH REBASED] mm, memcg: Make scan aggression always exclude protection

2019-05-29 Thread Michal Hocko
On Wed 29-05-19 23:44:53, Chris Down wrote: > Michal Hocko writes: > > Maybe I am missing something so correct me if I am wrong but the new > > calculation actually means that we always allow to scan even min > > protected memcgs right? > > We check if the memcg is min protected as a precondition

[PATCH v2] riscv: Fix udelay in RV32.

2019-05-29 Thread Nick Hu
In RV32, udelay would delay the wrong cycle. When it shifts right "UDELAY_SHITFT" bits, it either delays 0 cycle or 1 cycle. It only works correctly in RV64. Because the 'ucycles' always needs to be 64 bits variable. Signed-off-by: Nick Hu --- arch/riscv/lib/delay.c | 2 +- 1 file changed, 1 ins

Re: [PATCH net-next] ethtool: copy reglen to userspace

2019-05-29 Thread Michal Kubecek
On Wed, May 29, 2019 at 10:17:44PM -0700, David Miller wrote: > From: Vivien Didelot > Date: Tue, 28 May 2019 16:58:48 -0400 > > > ethtool_get_regs() allocates a buffer of size reglen obtained from > > ops->get_regs_len(), thus only this value must be used when copying > > the buffer back to user

Re: [PATCH] elf: align AT_RANDOM bytes

2019-05-29 Thread Alexey Dobriyan
On Wed, May 29, 2019 at 04:00:23PM -0700, Kees Cook wrote: > On Wed, May 29, 2019 at 03:20:20PM -0700, Andrew Morton wrote: > > On Thu, 30 May 2019 00:37:08 +0300 Alexey Dobriyan > > wrote: > > > > > AT_RANDOM content is always misaligned on x86_64: > > > > > > $ LD_SHOW_AUXV=1 /bin/true | gr

Re: [PATCH REBASED] mm, memcg: Make scan aggression always exclude protection

2019-05-29 Thread Chris Down
Michal Hocko writes: Maybe I am missing something so correct me if I am wrong but the new calculation actually means that we always allow to scan even min protected memcgs right? We check if the memcg is min protected as a precondition for coming into this function at all, so this generally is

Re: [PATCH] elf: align AT_RANDOM bytes

2019-05-29 Thread Alexey Dobriyan
On Wed, May 29, 2019 at 03:20:20PM -0700, Andrew Morton wrote: > On Thu, 30 May 2019 00:37:08 +0300 Alexey Dobriyan > wrote: > > > AT_RANDOM content is always misaligned on x86_64: > > > > $ LD_SHOW_AUXV=1 /bin/true | grep AT_RANDOM > > AT_RANDOM: 0x7fff02101019 > > > > glibc cop

Re: [PATCH, RFC] byteorder: sanity check toolchain vs kernel endianess

2019-05-29 Thread Christoph Hellwig
On Thu, May 30, 2019 at 01:46:18AM +, Maciej Rozycki wrote: > > +#if defined(__BYTE_ORDER__) && __BYTE_ORDER__ != __ORDER_BIG_ENDIAN__ > > +#error "Unsupported endianess, check your toolchain" > > Typo here: s/endianess/endianness/. The original patch has already been merged, please send a f

Re: [PATCH 4/4] arm64/mm: Drop vm_fault_t argument from __do_page_fault()

2019-05-29 Thread Christoph Hellwig
On Wed, May 29, 2019 at 06:04:45PM +0530, Anshuman Khandual wrote: > __do_page_fault() is over complicated with multiple goto statements. This > cleans up code flow and while there drops the vm_fault_t argument. There is no argument dropped anywhere, just a local variable.

Re: [PATCH] riscv: Fix udelay in RV32.

2019-05-29 Thread Nick Hu
On Thu, May 30, 2019 at 01:52:58PM +0800, Christoph Hellwig wrote: > On Tue, May 28, 2019 at 05:26:49PM +0800, Nick Hu wrote: > > In RV32, udelay would delay the wrong cycle. > > When it shifts right "UDELAY_SHITFT" bits, it > > either delays 0 cycle or 1 cycle. It only works > > correctly in RV64.

Re: [PATCH v2 1/8] arm64: dts: mt8183: add thermal zone node

2019-05-29 Thread Hsin-Yi Wang
On Fri, May 10, 2019 at 9:27 PM michael.kao wrote: > + > + tzts1: tzts1 { > + polling-delay-passive = <0>; > + polling-delay = <0>; > + thermal-sensors = <&thermal 1>; > +

Re: [PATCH] mm/slab_common.c: fix possible spectre-v1 in kmalloc_slab()

2019-05-29 Thread Michal Hocko
[Please do not top-post] On Thu 30-05-19 13:20:01, Dianzhang Chen wrote: > It is possible that a CPU mis-predicts the conditional branch, and > speculatively loads size_index[size_index_elem(size)], even if size >192. > Although this value will subsequently be discarded, > but it can not drop all

linux-next: Tree for May 30

2019-05-29 Thread Stephen Rothwell
Hi all, Changes since 20190529: The net-next tree gained a conflict against the net tree. The userns tree gained a conflict against the arc-current tree. The akpm-current tree lost its build failure but gained another for which I applied a patch. It also gained a boot failure so I reverted 2

linux-next: boot failure after merge of the akpm tree

2019-05-29 Thread Stephen Rothwell
Hi all, My qemu boot (PowerPC le guest on PowerPC le host, with and without kvm, using a kernel built with powerpc_pseries_le_defconfig) oopses during boot like this: - numa: Node 0 CPUs: 0 Using standard scheduler topolo

[PATCH V2] drivers: i2c: tegra: fix checkpatch defects

2019-05-29 Thread Bitan Biswas
Fix checkpatch.pl warning(s)/error(s)/check(s) in i2c-tegra.c except for BUG/BUG_ON checks Signed-off-by: Bitan Biswas --- drivers/i2c/busses/i2c-tegra.c | 54 +++--- 1 file changed, 30 insertions(+), 24 deletions(-) diff --git a/drivers/i2c/busses/i2c-tegra.

Re: [PATCH REBASED] mm, memcg: Make scan aggression always exclude protection

2019-05-29 Thread Michal Hocko
[Sorry for a late reply] On Fri 22-03-19 16:03:07, Chris Down wrote: [...] > With this patch, memory.low and memory.min affect reclaim pressure in a > more understandable and composable way. For example, from a user > standpoint, "protected" memory now remains untouchable from a reclaim > aggressi

RE: SGX vs LSM (Re: [PATCH v20 00/28] Intel SGX1 support)

2019-05-29 Thread Xing, Cedric
> From: linux-sgx-ow...@vger.kernel.org > [mailto:linux-sgx-ow...@vger.kernel.org] On Behalf > Of Stephen Smalley > Sent: Wednesday, May 29, 2019 7:08 AM > > On 5/28/19 4:24 PM, Sean Christopherson wrote: > > On Sat, May 25, 2019 at 11:09:38PM -0700, Xing, Cedric wrote: > >>> From: Andy Lutomirsk

[RFC] mm: Generalize notify_page_fault()

2019-05-29 Thread Anshuman Khandual
Similar notify_page_fault() definitions are being used by architectures duplicating much of the same code. This attempts to unify them into a single implementation, generalize it and then move it to a common place. kprobes_built_in() can detect CONFIG_KPROBES, hence notify_page_fault() must not be

[PATCH V1] i2c: busses: tegra: Add suspend-resume support

2019-05-29 Thread Bitan Biswas
Post suspend I2C registers have power on reset values. Before any transfer initialize I2C registers to prevent I2C transfer timeout and implement suspend and resume callbacks needed. Fix below errors post suspend: 1) Tegra I2C transfer timeout during jetson tx2 resume: [ 27.520613] pca953x 1-00

Re: [PATCH] riscv: Fix udelay in RV32.

2019-05-29 Thread Christoph Hellwig
On Tue, May 28, 2019 at 05:26:49PM +0800, Nick Hu wrote: > In RV32, udelay would delay the wrong cycle. > When it shifts right "UDELAY_SHITFT" bits, it > either delays 0 cycle or 1 cycle. It only works > correctly in RV64. Because the 'ucycles' always > needs to be 64 bits variable. Please use up

[PATCH 3/3] arm64: defconfig: Select CONFIG_CLK_IMX8MN by default

2019-05-29 Thread Anson . Huang
From: Anson Huang Enable CONFIG_CLK_IMX8MN to support i.MX8MN clock driver. Signed-off-by: Anson Huang --- arch/arm64/configs/defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig index 8d4f25c..aef797c 100644 --- a/arch/arm64

[PATCH 1/3] dt-bindings: imx: Add clock binding doc for i.MX8MN

2019-05-29 Thread Anson . Huang
From: Anson Huang Add the clock binding doc for i.MX8MN. Signed-off-by: Anson Huang --- .../devicetree/bindings/clock/imx8mn-clock.txt | 29 +++ include/dt-bindings/clock/imx8mn-clock.h | 215 + 2 files changed, 244 insertions(+) create mode 100644 Documenta

Re: [PATCH] PCI: endpoint: Add DMA to Linux PCI EP Framework

2019-05-29 Thread Kishon Vijay Abraham I
+Vinod Koul Hi, On 30/05/19 4:07 AM, Alan Mikhak wrote: > On Mon, May 27, 2019 at 2:09 AM Gustavo Pimentel > wrote: >> >> On Fri, May 24, 2019 at 20:42:43, Alan Mikhak >> wrote: >> >> Hi Alan, >> >>> On Fri, May 24, 2019 at 1:59 AM Gustavo Pimentel >>> wrote: Hi Alan, This

[PATCH 2/3] clk: imx: Add support for i.MX8MN clock driver

2019-05-29 Thread Anson . Huang
From: Anson Huang This patch adds i.MX8MN clock driver support. Signed-off-by: Anson Huang --- drivers/clk/imx/Kconfig | 6 + drivers/clk/imx/Makefile | 1 + drivers/clk/imx/clk-imx8mn.c | 609 +++ 3 files changed, 616 insertions(+) create

Re: [PATCH] kernel/sys.c: fix possible spectre-v1 in do_prlimit()

2019-05-29 Thread Dianzhang Chen
Though syscall `getrlimit` , it seems not works after check_prlimit_permission. And the speculation windows are large, as said[1]: >> Can the speculation proceed past the task_lock()? Or is the policy to >> ignore such happy happenstances even if they are available? > > Locks are not in the way o

RE: SGX vs LSM (Re: [PATCH v20 00/28] Intel SGX1 support)

2019-05-29 Thread Xing, Cedric
> From: Christopherson, Sean J > Sent: Tuesday, May 28, 2019 2:41 PM > > On Tue, May 28, 2019 at 01:48:02PM -0700, Andy Lutomirski wrote: > > On Tue, May 28, 2019 at 1:24 PM Sean Christopherson > > wrote: > > > > > > Actually, I think we do have everything we need from an LSM perspective. > > > L

linux-next: build warning after merge of the userns tree

2019-05-29 Thread Stephen Rothwell
Hi Eric, After merging the userns tree, today's linux-next build (i386 defconfig) produced this warning: arch/x86/mm/fault.c: In function 'do_sigbus': arch/x86/mm/fault.c:1017:22: warning: unused variable 'tsk' [-Wunused-variable] struct task_struct *tsk = current; ^~~ In

Re: [PATCH v3 1/8] dt-bindings: soc: Add Aspeed XDMA engine binding documentation

2019-05-29 Thread Andrew Jeffery
On Thu, 30 May 2019, at 03:40, Eddie James wrote: > Document the bindings. > > Signed-off-by: Eddie James > --- > .../devicetree/bindings/soc/aspeed/xdma.txt| 23 > ++ > 1 file changed, 23 insertions(+) > create mode 100644 Documentation/devicetree/bindings/soc/a

Re: [PATCH] mm/slab_common.c: fix possible spectre-v1 in kmalloc_slab()

2019-05-29 Thread Dianzhang Chen
thanks, i think your suggestion is ok. in my previous method is easy to understand for spectre logic, but your suggestion is more sense to use of array_index_nospec. On Thu, May 30, 2019 at 3:48 AM Matthew Wilcox wrote: > > On Wed, May 29, 2019 at 08:37:28PM +0800, Dianzhang Chen wrote: > > Th

Re: [PATCH] mm/slab_common.c: fix possible spectre-v1 in kmalloc_slab()

2019-05-29 Thread Dianzhang Chen
It is possible that a CPU mis-predicts the conditional branch, and speculatively loads size_index[size_index_elem(size)], even if size >192. Although this value will subsequently be discarded, but it can not drop all the effects of speculative execution, such as the presence or absence of data in c

Re: [PATCH net-next] ethtool: copy reglen to userspace

2019-05-29 Thread David Miller
From: Vivien Didelot Date: Tue, 28 May 2019 16:58:48 -0400 > ethtool_get_regs() allocates a buffer of size reglen obtained from > ops->get_regs_len(), thus only this value must be used when copying > the buffer back to userspace. Also no need to check regbuf twice. > > Signed-off-by: Vivien Dide

[PATCH] mm/kconfig: Fix neighboring typos

2019-05-29 Thread Kees Cook
This fixes a couple typos I noticed in the slab Kconfig: sacrifies -> sacrifices accellerate -> accelerate Seeing as no other instances of these typos are found elsewhere in the kernel and that I originally added one of the two, I can only assume working on slab must have caused d

[PATCH 5.1 016/405] kvm: svm/avic: fix off-by-one in checking host APIC ID

2019-05-29 Thread Greg Kroah-Hartman
From: Suthikulpanit, Suravee commit c9bcd3e3335d0a29d89fabd2c385e1b989e6f1b0 upstream. Current logic does not allow VCPU to be loaded onto CPU with APIC ID 255. This should be allowed since the host physical APIC ID field in the AVIC Physical APIC table entry is an 8-bit value, and APIC ID 255 i

[PATCH 5.1 018/405] libnvdimm/pmem: Bypass CONFIG_HARDENED_USERCOPY overhead

2019-05-29 Thread Greg Kroah-Hartman
From: Dan Williams commit 52f476a323f9efc959be1c890d0cdcf12e1582e0 upstream. Jeff discovered that performance improves from ~375K iops to ~519K iops on a simple psync-write fio workload when moving the location of 'struct page' from the default PMEM location to DRAM. This result is surprising be

[PATCH 5.1 002/405] ext4: do not delete unlinked inode from orphan list on failed truncate

2019-05-29 Thread Greg Kroah-Hartman
From: Jan Kara commit ee0ed02ca93ef1ecf8963ad96638795d55af2c14 upstream. It is possible that unlinked inode enters ext4_setattr() (e.g. if somebody calls ftruncate(2) on unlinked but still open file). In such case we should not delete the inode from the orphan list if truncate fails. Note that t

[PATCH 5.1 014/405] dax: Arrange for dax_supported check to span multiple devices

2019-05-29 Thread Greg Kroah-Hartman
From: Dan Williams commit 7bf7eac8d648057519adb6fce1e31458c902212c upstream. Pankaj reports that starting with commit ad428cdb525a "dax: Check the end of the block-device capacity with dax_direct_access()" device-mapper no longer allows dax operation. This results from the stricter checks in __b

[PATCH 5.1 001/405] x86: Hide the int3_emulate_call/jmp functions from UML

2019-05-29 Thread Greg Kroah-Hartman
From: Steven Rostedt (VMware) commit 693713cbdb3a4bda5a8a678c31f06560bbb14657 upstream. User Mode Linux does not have access to the ip or sp fields of the pt_regs, and accessing them causes UML to fail to build. Hide the int3_emulate_jmp() and int3_emulate_call() instructions from UML, as it doe

[PATCH 5.1 011/405] mmc: sdhci-iproc: cygnus: Set NO_HISPD bit to fix HS50 data hold time problem

2019-05-29 Thread Greg Kroah-Hartman
From: Trac Hoang commit b7dfa695afc40d5396ed84b9f25aa3754de23e39 upstream. The iproc host eMMC/SD controller hold time does not meet the specification in the HS50 mode. This problem can be mitigated by disabling the HISPD bit; thus forcing the controller output data to be driven on the falling c

[PATCH 5.1 028/405] btrfs: sysfs: Fix error path kobject memory leak

2019-05-29 Thread Greg Kroah-Hartman
From: Tobin C. Harding commit 450ff8348808a89cc27436771aa05c2b90c0eef1 upstream. If a call to kobject_init_and_add() fails we must call kobject_put() otherwise we leak memory. Calling kobject_put() when kobject_init_and_add() fails drops the refcount back to 0 and calls the ktype release method

RE: [EXT] Re: [PATCH] arm64: dts: ls1028a: fix watchdog device node

2019-05-29 Thread Chuanhua Han
> -Original Message- > From: Rob Herring > Sent: 2019年5月24日 20:29 > To: Chuanhua Han > Cc: Leo Li ; Shawn Guo ; > mark.rutl...@arm.com; linux-arm-ker...@lists.infradead.org; > devicet...@vger.kernel.org; linux-kernel@vger.kernel.org; Ying Zhang > > Subject: Re: [EXT] Re: [PATCH] arm64:

[PATCH 5.1 012/405] mmc: sdhci-iproc: Set NO_HISPD bit to fix HS50 data hold time problem

2019-05-29 Thread Greg Kroah-Hartman
From: Trac Hoang commit ec0970e0a1b2c807c908d459641a9f9a1be3e130 upstream. The iproc host eMMC/SD controller hold time does not meet the specification in the HS50 mode. This problem can be mitigated by disabling the HISPD bit; thus forcing the controller output data to be driven on the falling

[PATCH 5.1 021/405] arm64/iommu: handle non-remapped addresses in ->mmap and ->get_sgtable

2019-05-29 Thread Greg Kroah-Hartman
From: Christoph Hellwig commit a98d9ae937d256ed679a935fc82d9deaa710d98e upstream. DMA allocations that can't sleep may return non-remapped addresses, but we do not properly handle them in the mmap and get_sgtable methods. Resolve non-vmalloc addresses using virt_to_page to handle this corner cas

[PATCH 5.1 024/405] btrfs: Check the compression level before getting a workspace

2019-05-29 Thread Greg Kroah-Hartman
From: Johnny Chang commit 2b90883c561ddcc641741c2e4df1f702a4f2acb8 upstream. When a file's compression property is set as zlib or zstd but leave the compression mount option not be set, that means btrfs will try to compress the file with default compression level. But in btrfs_compress_pages(),

[PATCH 5.1 022/405] gfs2: Fix sign extension bug in gfs2_update_stats

2019-05-29 Thread Greg Kroah-Hartman
From: Andreas Gruenbacher commit 5a5ec83d6ac974b12085cd99b196795f14079037 upstream. Commit 4d207133e9c3 changed the types of the statistic values in struct gfs2_lkstats from s64 to u64. Because of that, what should be a signed value in gfs2_update_stats turned into an unsigned value. When shif

[PATCH 5.1 019/405] arm64/kernel: kaslr: reduce module randomization range to 2 GB

2019-05-29 Thread Greg Kroah-Hartman
From: Ard Biesheuvel commit b2eed9b58811283d00fa861944cb75797d4e52a7 upstream. The following commit 7290d5809571 ("module: use relative references for __ksymtab entries") updated the ksymtab handling of some KASLR capable architectures so that ksymtab entries are emitted as pairs of 32-bit r

[PATCH 5.1 027/405] Btrfs: fix race between ranged fsync and writeback of adjacent ranges

2019-05-29 Thread Greg Kroah-Hartman
From: Filipe Manana commit 0c713cbab6200b0ab6473b50435e450a6e1de85d upstream. When we do a full fsync (the bit BTRFS_INODE_NEEDS_FULL_SYNC is set in the inode) that happens to be ranged, which happens during a msync() or writes for files opened with O_SYNC for example, we can end up with a corru

[PATCH 5.1 025/405] Btrfs: do not abort transaction at btrfs_update_root() after failure to COW path

2019-05-29 Thread Greg Kroah-Hartman
From: Filipe Manana commit 72bd2323ec87722c115a5906bc6a1b31d11e8f54 upstream. Currently when we fail to COW a path at btrfs_update_root() we end up always aborting the transaction. However all the current callers of btrfs_update_root() are able to deal with errors returned from it, many do end u

[PATCH 5.1 015/405] kvm: Check irqchip mode before assign irqfd

2019-05-29 Thread Greg Kroah-Hartman
From: Peter Xu commit 654f1f13ea56b92bacade8ce2725aea0457f91c0 upstream. When assigning kvm irqfd we didn't check the irqchip mode but we allow KVM_IRQFD to succeed with all the irqchip modes. However it does not make much sense to create irqfd even without the kernel chips. Let's provide a ar

[PATCH 5.1 003/405] ext4: wait for outstanding dio during truncate in nojournal mode

2019-05-29 Thread Greg Kroah-Hartman
From: Jan Kara commit 82a25b027ca48d7ef197295846b352345853dfa8 upstream. We didn't wait for outstanding direct IO during truncate in nojournal mode (as we skip orphan handling in that case). This can lead to fs corruption or stale data exposure if truncate ends up freeing blocks and these get re

[PATCH 5.1 029/405] btrfs: sysfs: dont leak memory when failing add fsid

2019-05-29 Thread Greg Kroah-Hartman
From: Tobin C. Harding commit e32773357d5cc271b1d23550b3ed026eb5c2a468 upstream. A failed call to kobject_init_and_add() must be followed by a call to kobject_put(). Currently in the error path when adding fs_devices we are missing this call. This could be fixed by calling btrfs_sysfs_remove_f

[PATCH 5.1 039/405] bpf: devmap: fix use-after-free Read in __dev_map_entry_free

2019-05-29 Thread Greg Kroah-Hartman
From: Eric Dumazet commit 2baae3545327632167c0180e9ca1d467416f1919 upstream. synchronize_rcu() is fine when the rcu callbacks only need to free memory (kfree_rcu() or direct kfree() call rcu call backs) __dev_map_entry_free() is a bit more complex, so we need to make sure that call queued __dev

[PATCH 5.1 044/405] Revert "btrfs: Honour FITRIM range constraints during free space trim"

2019-05-29 Thread Greg Kroah-Hartman
From: David Sterba This reverts commit eb432217d775a90c061681c0dfa3c7abfba75123. There is currently no corresponding patch in master due to additional changes that would be significantly different from plain revert in the respective stable branch. The range argument was not handled correctly an

[PATCH 5.1 023/405] btrfs: dont double unlock on error in btrfs_punch_hole

2019-05-29 Thread Greg Kroah-Hartman
From: Josef Bacik commit 8fca955057b9c58467d1b231e43f19c4cf26ae8c upstream. If we have an error writing out a delalloc range in btrfs_punch_hole_lock_range we'll unlock the inode and then goto out_only_mutex, where we will again unlock the inode. This is bad, don't do this. Fixes: f27451f22996

[PATCH 5.1 009/405] crypto: hash - fix incorrect HASH_MAX_DESCSIZE

2019-05-29 Thread Greg Kroah-Hartman
From: Eric Biggers commit e1354400b25da645c4764ed6844d12f1582c3b66 upstream. The "hmac(sha3-224-generic)" algorithm has a descsize of 368 bytes, which is greater than HASH_MAX_DESCSIZE (360) which is only enough for sha3-224-generic. The check in shash_prepare_alg() doesn't catch this because t

[PATCH 5.1 032/405] ovl: relax WARN_ON() for overlapping layers use case

2019-05-29 Thread Greg Kroah-Hartman
From: Amir Goldstein commit acf3062a7e1ccf67c6f7e7c28671a6708fde63b0 upstream. This nasty little syzbot repro: https://syzkaller.appspot.com/x/repro.syz?x=12c7a94f40 Creates overlay mounts where the same directory is both in upper and lower layers. Simplified example: mkdir foo work mo

[PATCH 5.1 005/405] x86/kvm/pmu: Set AMDs virt PMU version to 1

2019-05-29 Thread Greg Kroah-Hartman
From: Borislav Petkov commit a80c4ec10ed9632c44c829452dc40a0443ff4e85 upstream. After commit: 672ff6cff80c ("KVM: x86: Raise #GP when guest vCPU do not support PMU") my AMD guests started #GPing like this: general protection fault: [#1] PREEMPT SMP CPU: 1 PID: 4355 Comm: bash Not t

[PATCH 5.1 038/405] ssb: Fix possible NULL pointer dereference in ssb_host_pcmcia_exit

2019-05-29 Thread Greg Kroah-Hartman
From: YueHaibing commit b2c01aab9646ed8ffb7c549afe55d5349c482425 upstream. Syzkaller report this: kasan: GPF could be caused by NULL-ptr deref or user memory access general protection fault: [#1] SMP KASAN PTI CPU: 0 PID: 4492 Comm: syz-executor.0 Not tainted 5.0.0-rc7+ #45 Hardware name:

[PATCH 5.1 030/405] fbdev: fix divide error in fb_var_to_videomode

2019-05-29 Thread Greg Kroah-Hartman
From: Shile Zhang commit cf84807f6dd0be5214378e66460cfc9187f532f9 upstream. To fix following divide-by-zero error found by Syzkaller: divide error: [#1] SMP PTI CPU: 7 PID: 8447 Comm: test Kdump: loaded Not tainted 4.19.24-8.al7.x86_64 #1 Hardware name: Alibaba Cloud Alibaba Cloud EC

[PATCH 5.1 031/405] arm64: errata: Add workaround for Cortex-A76 erratum #1463225

2019-05-29 Thread Greg Kroah-Hartman
From: Will Deacon commit 969f5ea627570e91c9d54403287ee3ed657f58fe upstream. Revisions of the Cortex-A76 CPU prior to r4p0 are affected by an erratum that can prevent interrupts from being taken when single-stepping. This patch implements a software workaround to prevent userspace from effective

[PATCH 5.1 054/405] tools/bpf: fix perf build error with uClibc (seen on ARC)

2019-05-29 Thread Greg Kroah-Hartman
[ Upstream commit ca31ca8247e2d3807ff5fa1d1760616a2292001c ] When build perf for ARC recently, there was a build failure due to lack of __NR_bpf. | Auto-detecting system features: | | ... get_cpuid: [ OFF ] | ... bpf: [ on ] | | # error __NR_bpf not

[PATCH 5.1 041/405] at76c50x-usb: Dont register led_trigger if usb_register_driver failed

2019-05-29 Thread Greg Kroah-Hartman
From: YueHaibing commit 09ac2694b0475f96be895848687ebcbba97eeecf upstream. Syzkaller report this: [ 1213.468581] BUG: unable to handle kernel paging request at fbfff83bf338 [ 1213.469530] #PF error: [normal kernel read fault] [ 1213.469530] PGD 237fe4067 P4D 237fe4067 PUD 237e60067 PMD 1c86

[PATCH 5.1 034/405] media: cpia2: Fix use-after-free in cpia2_exit

2019-05-29 Thread Greg Kroah-Hartman
From: YueHaibing commit dea37a97265588da604c6ba80160a287b72c7bfd upstream. Syzkaller report this: BUG: KASAN: use-after-free in sysfs_remove_file_ns+0x5f/0x70 fs/sysfs/file.c:468 Read of size 8 at addr 8881f59a6b70 by task syz-executor.0/8363 CPU: 0 PID: 8363 Comm: syz-executor.0 Not taint

[PATCH 5.1 062/405] blk-mq: grab .q_usage_counter when queuing request from plug code path

2019-05-29 Thread Greg Kroah-Hartman
[ Upstream commit e87eb301bee183d82bb3d04bd71b6660889a2588 ] Just like aio/io_uring, we need to grab 2 refcount for queuing one request, one is for submission, another is for completion. If the request isn't queued from plug code path, the refcount grabbed in generic_make_request() serves for sub

[PATCH 5.1 035/405] media: serial_ir: Fix use-after-free in serial_ir_init_module

2019-05-29 Thread Greg Kroah-Hartman
From: YueHaibing commit 56cd26b618855c9af48c8301aa6754ced8dd0beb upstream. Syzkaller report this: BUG: KASAN: use-after-free in sysfs_remove_file_ns+0x5f/0x70 fs/sysfs/file.c:468 Read of size 8 at addr 8881dc7ae030 by task syz-executor.0/6249 CPU: 1 PID: 6249 Comm: syz-executor.0 Not taint

[PATCH 5.1 036/405] media: vb2: add waiting_in_dqbuf flag

2019-05-29 Thread Greg Kroah-Hartman
From: Hans Verkuil commit d65842f7126aa1a87fb44b7c9980c12630ed4f33 upstream. Calling VIDIOC_DQBUF can release the core serialization lock pointed to by vb2_queue->lock if it has to wait for a new buffer to arrive. However, if userspace dup()ped the video device filehandle, then it is possible t

[PATCH 5.1 060/405] ice: Preserve VLAN Rx stripping settings

2019-05-29 Thread Greg Kroah-Hartman
[ Upstream commit e80e76db6c5bbc7a8f8512f3dc630a2170745b0b ] When Tx insertion is set, we are not accounting for the state of Rx stripping. This causes Rx stripping to be enabled any time Tx insertion is changed, even when it's supposed to be disabled. Signed-off-by: Tony Nguyen Signed-off-by:

[PATCH 5.1 056/405] libbpf: fix invalid munmap call

2019-05-29 Thread Greg Kroah-Hartman
[ Upstream commit 0e6741f092979535d159d5a851f12c88bfb7cb9a ] When unmapping the AF_XDP memory regions used for the rings, an invalid address was passed to the munmap() calls. Instead of passing the beginning of the memory region, the descriptor region was passed to munmap. When the userspace appl

[PATCH 5.1 058/405] bpftool: exclude bash-completion/bpftool from .gitignore pattern

2019-05-29 Thread Greg Kroah-Hartman
[ Upstream commit a7d006714724de4334c5e3548701b33f7b12ca96 ] tools/bpf/bpftool/.gitignore has the "bpftool" pattern, which is intended to ignore the following build artifact: tools/bpf/bpftool/bpftool However, the .gitignore entry is effective not only for the current directory, but also for a

[PATCH 5.1 037/405] media: vivid: use vfree() instead of kfree() for dev->bitmap_cap

2019-05-29 Thread Greg Kroah-Hartman
From: Alexander Potapenko commit dad7e270ba712ba1c99cd2d91018af607a06 upstream. syzkaller reported crashes on kfree() called from vivid_vid_cap_s_selection(). This looks like a simple typo, as dev->bitmap_cap is allocated with vzalloc() throughout the file. Fixes: ef834f7836ec0 ("[media] vi

[PATCH 5.1 057/405] selftests/bpf: set RLIMIT_MEMLOCK properly for test_libbpf_open.c

2019-05-29 Thread Greg Kroah-Hartman
[ Upstream commit 6cea33701eb024bc6c920ab83940ee22afd29139 ] Test test_libbpf.sh failed on my development server with failure -bash-4.4$ sudo ./test_libbpf.sh [0] libbpf: Error in bpf_object__probe_name():Operation not permitted(1). Couldn't load basic 'r0 = 0' BPF program. test_libbpf

Re: [RFC PATCH v3] rtl8xxxu: Improve TX performance of RTL8723BU on rtl8xxxu driver

2019-05-29 Thread Chris Chiu
On Thu, May 30, 2019 at 2:22 AM Larry Finger wrote: > > On 5/29/19 12:03 AM, Chris Chiu wrote: > > We have 3 laptops which connect the wifi by the same RTL8723BU. > > The PCI VID/PID of the wifi chip is 10EC:B720 which is supported. > > They have the same problem with the in-kernel rtl8xxxu driver

[PATCH 5.1 064/405] net: ena: gcc 8: fix compilation warning

2019-05-29 Thread Greg Kroah-Hartman
[ Upstream commit f913308879bc6ae437ce64d878c7b05643ddea44 ] GCC 8 contains a number of new warnings as well as enhancements to existing checkers. The warning - Wstringop-truncation - warns for calls to bounded string manipulation functions such as strncat, strncpy, and stpncpy that may either tru

[PATCH 5.1 066/405] hv_netvsc: fix race that may miss tx queue wakeup

2019-05-29 Thread Greg Kroah-Hartman
[ Upstream commit 93aa4792c3908eac87ddd368ee0fe0564148232b ] When the ring buffer is almost full due to RX completion messages, a TX packet may reach the "low watermark" and cause the queue stopped. If the TX completion arrives earlier than queue stopping, the wakeup may be missed. This patch mov

[PATCH 5.1 063/405] dmaengine: tegra210-dma: free dma controller in remove()

2019-05-29 Thread Greg Kroah-Hartman
[ Upstream commit f030e419501cb95e961e9ed35c493b5d46a04eca ] Following kernel panic is seen during DMA driver unload->load sequence == Unable to handle kernel paging request at virtual address ff8001198880 Internal error:

[PATCH 5.1 065/405] net: ena: fix: set freed objects to NULL to avoid failing future allocations

2019-05-29 Thread Greg Kroah-Hartman
[ Upstream commit 8ee8ee7fe87bf64738ab4e31be036a7165608b27 ] In some cases when a queue related allocation fails, successful past allocations are freed but the pointer that pointed to them is not set to NULL. This is a problem for 2 reasons: 1. This is generally a bad practice since this pointer m

[PATCH 5.1 067/405] Bluetooth: Ignore CC events not matching the last HCI command

2019-05-29 Thread Greg Kroah-Hartman
[ Upstream commit f80c5dad7b6467b884c445ffea45985793b4b2d0 ] This commit makes the kernel not send the next queued HCI command until a command complete arrives for the last HCI command sent to the controller. This change avoids a problem with some buggy controllers (seen on two SKUs of QCA9377) th

[PATCH 5.1 068/405] pinctrl: zte: fix leaked of_node references

2019-05-29 Thread Greg Kroah-Hartman
[ Upstream commit 02d15f0d80720545f1f4922a1550ea4aaad4e152 ] The call to of_parse_phandle returns a node pointer with refcount incremented thus it must be explicitly decremented after the last usage. Detected by coccinelle with the following warnings: ./drivers/pinctrl/zte/pinctrl-zx.c:415:2-8: E

[PATCH 5.1 079/405] spi: pxa2xx: fix SCR (divisor) calculation

2019-05-29 Thread Greg Kroah-Hartman
[ Upstream commit 29f2133717c527f492933b0622a4aafe0b3cbe9e ] Calculate the divisor for the SCR (Serial Clock Rate), avoiding that the SSP transmission rate can be greater than the device rate. When the division between the SSP clock and the device rate generates a reminder, we have to increment b

[PATCH 5.1 072/405] usb: gadget: f_fs: dont free buffer prematurely

2019-05-29 Thread Greg Kroah-Hartman
[ Upstream commit 73103c7f958b99561555c3bd1bc1a0809e0b7d61 ] The following kernel panic happens due to the io_data buffer gets deallocated before the async io is completed. Add a check for the case where io_data buffer should be deallocated by ffs_user_copy_worker. [ 41.663334] BUG: unable to h

[PATCH 5.1 069/405] ASoC: Intel: kbl_da7219_max98357a: Map BTN_0 to KEY_PLAYPAUSE

2019-05-29 Thread Greg Kroah-Hartman
[ Upstream commit 16ec5dfe0327ddcf279957bffe4c8fe527088c63 ] On kbl_rt5663_max98927, commit 38a5882e4292 ("ASoC: Intel: kbl_rt5663_max98927: Map BTN_0 to KEY_PLAYPAUSE") This key pair mapping to play/pause when playing Youtube The Android 3.5mm Headset jack specification mentions that BTN

[PATCH 5.1 073/405] ASoC: hdmi-codec: unlock the device on startup errors

2019-05-29 Thread Greg Kroah-Hartman
[ Upstream commit 30180e8436046344b12813dc954b2e01dfdcd22d ] If the hdmi codec startup fails, it should clear the current_substream pointer to free the device. This is properly done for the audio_startup() callback but for snd_pcm_hw_constraint_eld(). Make sure the pointer cleared if an error is

[PATCH 5.1 046/405] cxgb4: Fix error path in cxgb4_init_module

2019-05-29 Thread Greg Kroah-Hartman
[ Upstream commit a3147770bea76c8dbad73eca3a24c2118da5e719 ] BUG: unable to handle kernel paging request at a016a270 PGD 3270067 P4D 3270067 PUD 3271063 PMD 230bbd067 PTE 0 Oops: [#1 CPU: 0 PID: 6134 Comm: modprobe Not tainted 5.1.0+ #33 Hardware name: QEMU Standard PC (i440FX + PIIX,

[PATCH 5.1 080/405] net/mlx5: E-Switch, Use atomic rep state to serialize state change

2019-05-29 Thread Greg Kroah-Hartman
[ Upstream commit 6f4e02193c9a9ea54dd3151cf97489fa787cd0e6 ] When the state of rep was introduced, it was also designed to prevent duplicate unloading of the same rep. Considering the following two flows when an eswitch manager is at switchdev mode with n VF reps loaded. +

[PATCH 5.1 075/405] powerpc/boot: Fix missing check of lseek() return value

2019-05-29 Thread Greg Kroah-Hartman
[ Upstream commit 5d085ec04a000fefb5182d3b03ee46ca96d8389b ] This is detected by Coverity scan: CID: 1440481 Signed-off-by: Bo YU Signed-off-by: Michael Ellerman Signed-off-by: Sasha Levin --- arch/powerpc/boot/addnote.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a

[PATCH 5.1 042/405] acct_on(): dont mess with freeze protection

2019-05-29 Thread Greg Kroah-Hartman
From: Al Viro commit 9419a3191dcb27f24478d288abaab697228d28e6 upstream. What happens there is that we are replacing file->path.mnt of a file we'd just opened with a clone and we need the write count contribution to be transferred from original mount to new one. That's it. We do *NOT* want any

[PATCH 5.1 071/405] usb: dwc3: move synchronize_irq() out of the spinlock protected block

2019-05-29 Thread Greg Kroah-Hartman
[ Upstream commit 41a91c606e7d2b74358a944525267cc451c271e8 ] dwc3_gadget_suspend() is called under dwc->lock spinlock. In such context calling synchronize_irq() is not allowed. Move the problematic call out of the protected block to fix the following kernel BUG during system suspend: BUG: sleepin

[PATCH 5.1 078/405] ASoC: imx: fix fiq dependencies

2019-05-29 Thread Greg Kroah-Hartman
[ Upstream commit ea751227c813ab833609afecfeedaf0aa26f327e ] During randconfig builds, I occasionally run into an invalid configuration of the freescale FIQ sound support: WARNING: unmet direct dependencies detected for SND_SOC_IMX_PCM_FIQ Depends on [m]: SOUND [=y] && !UML && SND [=y] && SND_S

[PATCH 5.1 040/405] batman-adv: mcast: fix multicast tt/tvlv worker locking

2019-05-29 Thread Greg Kroah-Hartman
From: Linus Lüssing commit a3c7cd0cdf1107f891aff847ad481e34df727055 upstream. Syzbot has reported some issues with the locking assumptions made for the multicast tt/tvlv worker: It was able to trigger the WARN_ON() in batadv_mcast_mla_tt_retract() and batadv_mcast_mla_tt_add(). While hard/not re

[PATCH 5.1 077/405] spi: atmel-quadspi: fix crash while suspending

2019-05-29 Thread Greg Kroah-Hartman
[ Upstream commit e5c27498a0403b270620b1a8a0a66e3efc222fb6 ] atmel_qspi objects are kept in spi_controller objects, so, first get pointer to spi_controller object and then get atmel_qspi object from spi_controller object. Fixes: 2d30ac5ed633 ("mtd: spi-nor: atmel-quadspi: Use spi-mem interface fo

[PATCH 5.1 074/405] powerpc/perf: Return accordingly on invalid chip-id in

2019-05-29 Thread Greg Kroah-Hartman
[ Upstream commit a913e5e8b43be1d3897a141ce61c1ec071cad89c ] Nest hardware counter memory resides in a per-chip reserve-memory. During nest_imc_event_init(), chip-id of the event-cpu is considered to calculate the base memory addresss for that cpu. Return, proper error condition if the chip_id cal

[PATCH 5.1 103/405] s390/kexec_file: Fix detection of text segment in ELF loader

2019-05-29 Thread Greg Kroah-Hartman
[ Upstream commit 729829d775c9a5217abc784b2f16087d79c4eec8 ] To register data for the next kernel (command line, oldmem_base, etc.) the current kernel needs to find the ELF segment that contains head.S. This is currently done by checking ifor 'phdr->p_paddr == 0'. This works fine for the current k

[PATCH 5.1 105/405] sched/nohz: Run NOHZ idle load balancer on HK_FLAG_MISC CPUs

2019-05-29 Thread Greg Kroah-Hartman
[ Upstream commit 9b019acb72e4b5741d88e8936d6f200ed44b66b2 ] The NOHZ idle balancer runs on the lowest idle CPU. This can interfere with isolated CPUs, so confine it to HK_FLAG_MISC housekeeping CPUs. HK_FLAG_SCHED is not used for this because it is not set anywhere at the moment. This could be f

[PATCH 5.1 048/405] NFS: make nfs_match_client killable

2019-05-29 Thread Greg Kroah-Hartman
[ Upstream commit 950a578c6128c2886e295b9c7ecb0b6b22fcc92b ] Actually we don't do anything with return value from nfs_wait_client_init_complete in nfs_match_client, as a consequence if we get a fatal signal and client is not fully initialised, we'll loop to "again" label This

RE: [EXT] Re: Issue: regmap: use debugfs even when no device

2019-05-29 Thread Andy Duan
From: Mark Brown Sent: Wednesday, May 29, 2019 7:16 PM > To: Andy Duan > Cc: da...@lechnology.com; raf...@kernel.org; Robby Cai > ; gre...@linuxfoundation.org; linux-kernel > > Subject: Re: [EXT] Re: Issue: regmap: use debugfs even when no device > > On Wed, May 29, 2019 at 01:33:46AM +, An

[PATCH 5.1 047/405] afs: Fix getting the afs.fid xattr

2019-05-29 Thread Greg Kroah-Hartman
[ Upstream commit a2f611a3dc317d8ea1c98ad6c54b911cf7f93193 ] The AFS3 FID is three 32-bit unsigned numbers and is represented as three up-to-8-hex-digit numbers separated by colons to the afs.fid xattr. However, with the advent of support for YFS, the FID is now a 64-bit volume number, a 96-bit vn

  1   2   3   4   5   6   7   8   9   10   >