[PATCH 4.9 35/76] powerpc/fsl: Emulate SPRN_BUCSR register

2019-04-15 Thread Greg Kroah-Hartman
commit 98518c4d8728656db349f875fcbbc7c126d4c973 upstream. In order to flush the branch predictor the guest kernel performs writes to the BUCSR register which is hypervisor privilleged. However, the branch predictor is flushed at each KVM entry, so the branch predictor has been already flushed, so

[PATCH 4.9 25/76] powerpc/fsl: Add barrier_nospec implementation for NXP PowerPC Book3E

2019-04-15 Thread Greg Kroah-Hartman
commit ebcd1bfc33c7a90df941df68a6e5d4018c022fba upstream. Implement the barrier_nospec as a isync;sync instruction sequence. The implementation uses the infrastructure built for BOOK3S 64. Signed-off-by: Diana Craciun [mpe: Split out of larger patch] Signed-off-by: Michael Ellerman Signed-off-b

[PATCH 4.9 08/76] x86/vdso: Drop implicit common-page-size linker flag

2019-04-15 Thread Greg Kroah-Hartman
GNU linker's -z common-page-size's default value is based on the target architecture. arch/x86/entry/vdso/Makefile sets it to the architecture default, which is implicit and redundant. Drop it. Fixes: 2aae950b21e4 ("x86_64: Add vDSO for x86-64 with gettimeofday/clock_gettime/getcpu") Reported-by:

[PATCH 4.9 38/76] powerpc/fsl: Flush the branch predictor at each kernel entry (32 bit)

2019-04-15 Thread Greg Kroah-Hartman
commit 7fef436295bf6c05effe682c8797dfcb0deb112a upstream. In order to protect against speculation attacks on indirect branches, the branch predictor is flushed at kernel entry to protect for the following situations: - userspace process attacking another userspace process - userspace process attac

[PATCH 4.9 40/76] powerpc/fsl: Enable runtime patching if nospectre_v2 boot arg is used

2019-04-15 Thread Greg Kroah-Hartman
commit 3bc8ea8603ae4c1e09aca8de229ad38b8091fcb3 upstream. If the user choses not to use the mitigations, replace the code sequence with nops. Signed-off-by: Diana Craciun Signed-off-by: Michael Ellerman Signed-off-by: Sasha Levin --- arch/powerpc/kernel/setup-common.c | 1 + 1 file changed, 1

[PATCH 4.9 30/76] powerpc/pseries: Query hypervisor for count cache flush settings

2019-04-15 Thread Greg Kroah-Hartman
commit ba72dc171954b782a79d25e0f4b3ed91090c3b1e upstream. Use the existing hypercall to determine the appropriate settings for the count cache flush, and then call the generic powerpc code to set it up based on the security feature flags. Signed-off-by: Michael Ellerman Signed-off-by: Sasha Levi

[PATCH 4.9 31/76] powerpc/powernv: Query firmware for count cache flush settings

2019-04-15 Thread Greg Kroah-Hartman
commit 99d54754d3d5f896a8f616b0b6520662bc99d66b upstream. Look for fw-features properties to determine the appropriate settings for the count cache flush, and then call the generic powerpc code to set it up based on the security feature flags. Signed-off-by: Michael Ellerman Signed-off-by: Sasha

[PATCH 4.9 29/76] powerpc/64s: Add support for software count cache flush

2019-04-15 Thread Greg Kroah-Hartman
commit ee13cb249fabdff8b90aaff61add347749280087 upstream. Some CPU revisions support a mode where the count cache needs to be flushed by software on context switch. Additionally some revisions may have a hardware accelerated flush, in which case the software flush sequence can be shortened. If we

[PATCH 4.9 28/76] powerpc/64s: Add new security feature flags for count cache flush

2019-04-15 Thread Greg Kroah-Hartman
commit dc8c6cce9a26a51fc19961accb978217a3ba8c75 upstream. Add security feature flags to indicate the need for software to flush the count cache on context switch, and for the presence of a hardware assisted count cache flush. Signed-off-by: Michael Ellerman Signed-off-by: Sasha Levin --- arch/

[PATCH 4.9 51/76] net: rds: force to destroy connection if t_sock is NULL in rds_tcp_kill_sock().

2019-04-15 Thread Greg Kroah-Hartman
From: Mao Wenan [ Upstream commit cb66ddd156203daefb8d71158036b27b0e2caf63 ] When it is to cleanup net namespace, rds_tcp_exit_net() will call rds_tcp_kill_sock(), if t_sock is NULL, it will not call rds_conn_destroy(), rds_conn_path_destroy() and rds_tcp_conn_free() to free connection, and the

[PATCH 4.9 26/76] powerpc/fsl: Sanitize the syscall table for NXP PowerPC 32 bit platforms

2019-04-15 Thread Greg Kroah-Hartman
commit c28218d4abbf4f2035495334d8bfcba64bda4787 upstream. Used barrier_nospec to sanitize the syscall table. Signed-off-by: Diana Craciun Signed-off-by: Michael Ellerman Signed-off-by: Sasha Levin --- arch/powerpc/kernel/entry_32.S | 10 ++ 1 file changed, 10 insertions(+) diff --git

[PATCH 4.9 32/76] powerpc/fsl: Add infrastructure to fixup branch predictor flush

2019-04-15 Thread Greg Kroah-Hartman
commit 76a5eaa38b15dda92cd6964248c39b5a6f3a4e9d upstream. In order to protect against speculation attacks (Spectre variant 2) on NXP PowerPC platforms, the branch predictor should be flushed when the privillege level is changed. This patch is adding the infrastructure to fixup at runtime the code

[PATCH 4.9 27/76] powerpc/asm: Add a patch_site macro & helpers for patching instructions

2019-04-15 Thread Greg Kroah-Hartman
commit 06d0bbc6d0f56dacac3a79900e9a9a0d5972d818 upstream. Add a macro and some helper C functions for patching single asm instructions. The gas macro means we can do something like: 1:nop patch_site 1b, patch__foo Which is less visually distracting than defining a GLOBAL symbol at

[PATCH 4.9 52/76] openvswitch: fix flow actions reallocation

2019-04-15 Thread Greg Kroah-Hartman
From: Andrea Righi [ Upstream commit f28cd2af22a0c134e4aa1c64a70f70d815d473fb ] The flow action buffer can be resized if it's not big enough to contain all the requested flow actions. However, this resize doesn't take into account the new requested size, the buffer is only increased by a factor

[PATCH 4.9 55/76] tcp: Ensure DCTCP reacts to losses

2019-04-15 Thread Greg Kroah-Hartman
From: Koen De Schepper [ Upstream commit aecfde23108b8e637d9f5c5e523b24fb97035dc3 ] RFC8257 §3.5 explicitly states that "A DCTCP sender MUST react to loss episodes in the same way as conventional TCP". Currently, Linux DCTCP performs no cwnd reduction when losses are encountered. Optionally, th

[PATCH 4.9 33/76] powerpc/fsl: Add macro to flush the branch predictor

2019-04-15 Thread Greg Kroah-Hartman
commit 1cbf8990d79ff69da8ad09e8a3df014e1494462b upstream. The BUCSR register can be used to invalidate the entries in the branch prediction mechanisms. Signed-off-by: Diana Craciun Signed-off-by: Michael Ellerman Signed-off-by: Sasha Levin --- arch/powerpc/include/asm/ppc_asm.h | 21 +

[PATCH 4.9 24/76] powerpc/64: Make meltdown reporting Book3S 64 specific

2019-04-15 Thread Greg Kroah-Hartman
commit 406d2b6ae3420f5bb2b3db6986dc6f0b6dbb637b upstream. In a subsequent patch we will enable building security.c for Book3E. However the NXP platforms are not vulnerable to Meltdown, so make the Meltdown vulnerability reporting PPC_BOOK3S_64 specific. Signed-off-by: Diana Craciun [mpe: Split o

[PATCH 4.9 43/76] powerpc/fsl: Fix the flush of branch predictor.

2019-04-15 Thread Greg Kroah-Hartman
commit 27da80719ef132cf8c80eb406d5aeb37dddf78cc upstream. The commit identified below adds MC_BTB_FLUSH macro only when CONFIG_PPC_FSL_BOOK3E is defined. This results in the following error on some configs (seen several times with kisskb randconfig_defconfig) arch/powerpc/kernel/exceptions-64e.S:

[PATCH 4.9 45/76] arm64: kaslr: Reserve size of ARM64_MEMSTART_ALIGN in linear region

2019-04-15 Thread Greg Kroah-Hartman
[ Upstream commit c8a43c18a97845e7f94ed7d181c11f41964976a2 ] When KASLR is enabled (CONFIG_RANDOMIZE_BASE=y), the top 4K of kernel virtual address space may be mapped to physical addresses despite being reserved for ERR_PTR values. Fix the randomization of the linear region so that we avoid mappi

[PATCH 4.9 49/76] ipv6: sit: reset ip header pointer in ipip6_rcv

2019-04-15 Thread Greg Kroah-Hartman
From: Lorenzo Bianconi [ Upstream commit bb9bd814ebf04f579be466ba61fc922625508807 ] ipip6 tunnels run iptunnel_pull_header on received skbs. This can determine the following use-after-free accessing iph pointer since the packet will be 'uncloned' running pskb_expand_head if it is a cloned gso sk

[PATCH 4.9 67/76] Btrfs: do not allow trimming when a fs is mounted with the nologreplay option

2019-04-15 Thread Greg Kroah-Hartman
From: Filipe Manana commit f35f06c35560a86e841631f0243b83a984dc11a9 upstream. Whan a filesystem is mounted with the nologreplay mount option, which requires it to be mounted in RO mode as well, we can not allow discard on free space inside block groups, because log trees refer to extents that ar

[PATCH 4.9 58/76] bnxt_en: Improve RX consumer index validity check.

2019-04-15 Thread Greg Kroah-Hartman
From: Michael Chan [ Upstream commit a1b0e4e684e9c300b9e759b46cb7a0147e61ddff ] There is logic to check that the RX/TPA consumer index is the expected index to work around a hardware problem. However, the potentially bad consumer index is first used to index into an array to reference an entry.

[PATCH 4.9 41/76] powerpc/fsl: Update Spectre v2 reporting

2019-04-15 Thread Greg Kroah-Hartman
commit dfa88658fb0583abb92e062c7a9cd5a5b94f2a46 upstream. Report branch predictor state flush as a mitigation for Spectre variant 2. Signed-off-by: Diana Craciun Signed-off-by: Michael Ellerman Signed-off-by: Sasha Levin --- arch/powerpc/kernel/security.c | 5 - 1 file changed, 4 insertio

[PATCH 4.9 46/76] tty: mark Siemens R3964 line discipline as BROKEN

2019-04-15 Thread Greg Kroah-Hartman
From: Greg Kroah-Hartman commit c7084edc3f6d67750f50d4183134c4fb5712a5c8 upstream. The n_r3964 line discipline driver was written in a different time, when SMP machines were rare, and users were trusted to do the right thing. Since then, the world has moved on but not this code, it has stayed ro

[PATCH 4.9 72/76] arm64: futex: Fix FUTEX_WAKE_OP atomic ops with non-zero result value

2019-04-15 Thread Greg Kroah-Hartman
From: Will Deacon commit 045afc24124d80c6998d9c770844c67912083506 upstream. Rather embarrassingly, our futex() FUTEX_WAKE_OP implementation doesn't explicitly set the return value on the non-faulting path and instead leaves it holding the result of the underlying atomic operation. This means tha

[PATCH 4.9 60/76] netns: provide pure entropy for net_hash_mix()

2019-04-15 Thread Greg Kroah-Hartman
From: Eric Dumazet [ Upstream commit 355b98553789b646ed97ad801a619ff898471b92 ] net_hash_mix() currently uses kernel address of a struct net, and is used in many places that could be used to reveal this address to a patient attacker, thus defeating KASLR, for the typical case (initial net namesp

[PATCH 4.9 71/76] ARM: dts: at91: Fix typo in ISC_D0 on PC9

2019-04-15 Thread Greg Kroah-Hartman
From: David Engraf commit e7dfb6d04e4715be1f3eb2c60d97b753fd2e4516 upstream. The function argument for the ISC_D0 on PC9 was incorrect. According to the documentation it should be 'C' aka 3. Signed-off-by: David Engraf Reviewed-by: Nicolas Ferre Signed-off-by: Ludovic Desroches Fixes: 7f16cb

[PATCH 4.9 61/76] net: ethtool: not call vzalloc for zero sized memory request

2019-04-15 Thread Greg Kroah-Hartman
From: Li RongQing [ Upstream commit 3d8830266ffc28c16032b859e38a0252e014b631 ] NULL or ZERO_SIZE_PTR will be returned for zero sized memory request, and derefencing them will lead to a segfault so it is unnecessory to call vzalloc for zero sized memory request and not call functions which maybe

[PATCH 4.9 69/76] genirq: Respect IRQCHIP_SKIP_SET_WAKE in irq_chip_set_wake_parent()

2019-04-15 Thread Greg Kroah-Hartman
From: Stephen Boyd commit 325aa19598e410672175ed50982f902d4e3f31c5 upstream. If a child irqchip calls irq_chip_set_wake_parent() but its parent irqchip has the IRQCHIP_SKIP_SET_WAKE flag set an error is returned. This is inconsistent behaviour vs. set_irq_wake_real() which returns 0 when the ir

[PATCH 4.9 66/76] ASoC: fsl_esai: fix channel swap issue when stream starts

2019-04-15 Thread Greg Kroah-Hartman
From: S.j. Wang commit 0ff4e8c61b794a4bf6c854ab071a1abaaa80f358 upstream. There is very low possibility ( < 0.1% ) that channel swap happened in beginning when multi output/input pin is enabled. The issue is that hardware can't send data to correct pin in the beginning with the normal enable flo

[PATCH 4.9 57/76] bnxt_en: Reset device on RX buffer errors.

2019-04-15 Thread Greg Kroah-Hartman
From: Michael Chan [ Upstream commit 8e44e96c6c8e8fb80b84a2ca11798a8554f710f2 ] If the RX completion indicates RX buffers errors, the RX ring will be disabled by firmware and no packets will be received on that ring from that point on. Recover by resetting the device. Fixes: c0c050c58d84 ("bnx

[PATCH 4.9 74/76] sched/fair: Do not re-read ->h_load_next during hierarchical load calculation

2019-04-15 Thread Greg Kroah-Hartman
From: Mel Gorman commit 0e9f02450da07fc7b1346c8c32c771555173e397 upstream. A NULL pointer dereference bug was reported on a distribution kernel but the same issue should be present on mainline kernel. It occured on s390 but should not be arch-specific. A partial oops looks like: Unable to ha

[PATCH 4.9 65/76] include/linux/bitrev.h: fix constant bitrev

2019-04-15 Thread Greg Kroah-Hartman
From: Arnd Bergmann commit 6147e136ff5071609b54f18982dea87706288e21 upstream. clang points out with hundreds of warnings that the bitrev macros have a problem with constant input: drivers/hwmon/sht15.c:187:11: error: variable '__x' is uninitialized when used within its own initialization

[PATCH 4.9 75/76] xtensa: fix return_address

2019-04-15 Thread Greg Kroah-Hartman
From: Max Filippov commit ada770b1e74a77fff2d5f539bf6c42c25f4784db upstream. return_address returns the address that is one level higher in the call stack than requested in its argument, because level 0 corresponds to its caller's return address. Use requested level as the number of stack frames

[PATCH 4.9 62/76] ip6_tunnel: Match to ARPHRD_TUNNEL6 for dev type

2019-04-15 Thread Greg Kroah-Hartman
From: Sheena Mira-ato [ Upstream commit b2e54b09a3d29c4db883b920274ca8dca4d9f04d ] The device type for ip6 tunnels is set to ARPHRD_TUNNEL6. However, the ip4ip6_err function is expecting the device type of the tunnel to be ARPHRD_TUNNEL. Since the device types do not match, the function exits a

[PATCH 4.9 73/76] xen: Prevent buffer overflow in privcmd ioctl

2019-04-15 Thread Greg Kroah-Hartman
From: Dan Carpenter commit 42d8644bd77dd2d747e004e367cb0c895a606f39 upstream. The "call" variable comes from the user in privcmd_ioctl_hypercall(). It's an offset into the hypercall_page[] which has (PAGE_SIZE / 32) elements. We need to put an upper bound on it to prevent an out of bounds acces

[PATCH 4.9 76/76] PCI: Add function 1 DMA alias quirk for Marvell 9170 SATA controller

2019-04-15 Thread Greg Kroah-Hartman
From: Andre Przywara commit 9cde402a59770a0669d895399c13407f63d7d209 upstream. There is a Marvell 88SE9170 PCIe SATA controller I found on a board here. Some quick testing with the ARM SMMU enabled reveals that it suffers from the same requester ID mixup problems as the other Marvell chips liste

[PATCH 4.9 63/76] ALSA: seq: Fix OOB-reads from strlcpy

2019-04-15 Thread Greg Kroah-Hartman
From: Zubin Mithra commit 212ac181c158c09038c474ba68068be49caecebb upstream. When ioctl calls are made with non-null-terminated userspace strings, strlcpy causes an OOB-read from within strlen. Fix by changing to use strscpy instead. Signed-off-by: Zubin Mithra Reviewed-by: Guenter Roeck Cc:

[PATCH 4.9 59/76] net/mlx5e: Add a lock on tir list

2019-04-15 Thread Greg Kroah-Hartman
From: Yuval Avnery [ Upstream commit 80a2a9026b24c6bd34b8d58256973e22270bedec ] Refresh tirs is looping over a global list of tirs while netdevs are adding and removing tirs from that list. That is why a lock is required. Fixes: 724b2aa15126 ("net/mlx5e: TIRs management refactoring") Signed-off

Re: [RFC PATCH v1 1/5] fs: Add support for an O_MAYEXEC flag on sys_open()

2019-04-15 Thread Steve Grubb
Hello, On Wednesday, December 12, 2018 9:43:06 AM EDT Jan Kara wrote: > On Wed 12-12-18 09:17:08, Mickaël Salaün wrote: > > When the O_MAYEXEC flag is passed, sys_open() may be subject to > > additional restrictions depending on a security policy implemented by an > > LSM through the inode_permiss

[PATCH 4.9 64/76] parisc: Detect QEMU earlier in boot process

2019-04-15 Thread Greg Kroah-Hartman
From: Helge Deller commit d006e95b5561f708d0385e9677ffe2c46f2ae345 upstream. While adding LASI support to QEMU, I noticed that the QEMU detection in the kernel happens much too late. For example, when a LASI chip is found by the kernel, it registers the LASI LED driver as well. But when we run

[PATCH 4.9 70/76] virtio: Honour may_reduce_num in vring_create_virtqueue

2019-04-15 Thread Greg Kroah-Hartman
From: Cornelia Huck commit cf94db21905333e610e479688add629397a4b384 upstream. vring_create_virtqueue() allows the caller to specify via the may_reduce_num parameter whether the vring code is allowed to allocate a smaller ring than specified. However, the split ring allocation code tries to allo

[PATCH 4.9 48/76] ipv6: Fix dangling pointer when ipv6 fragment

2019-04-15 Thread Greg Kroah-Hartman
From: Junwei Hu [ Upstream commit ef0efcd3bd3fd0589732b67fb586ffd3c8705806 ] At the beginning of ip6_fragment func, the prevhdr pointer is obtained in the ip6_find_1stfragopt func. However, all the pointers pointing into skb header may change when calling skb_checksum_help func with skb->ip_summ

[PATCH 4.9 50/76] kcm: switch order of device registration to fix a crash

2019-04-15 Thread Greg Kroah-Hartman
From: Jiri Slaby [ Upstream commit 3c446e6f96997f2a95bf0037ef463802162d2323 ] When kcm is loaded while many processes try to create a KCM socket, a crash occurs: BUG: unable to handle kernel NULL pointer dereference at 000e IP: mutex_lock+0x27/0x40 kernel/locking/mutex.c:240 PGD 8

[PATCH 4.9 47/76] tty: ldisc: add sysctl to prevent autoloading of ldiscs

2019-04-15 Thread Greg Kroah-Hartman
From: Greg Kroah-Hartman commit 7c0cca7c847e6e019d67b7d793efbbe3b947d004 upstream. By default, the kernel will automatically load the module of any line dicipline that is asked for. As this sometimes isn't the safest thing to do, provide a sysctl to disable this feature. By default, we set thi

[PATCH 4.9 56/76] vrf: check accept_source_route on the original netdevice

2019-04-15 Thread Greg Kroah-Hartman
From: Stephen Suryaputra [ Upstream commit 8c83f2df9c6578ea4c5b940d8238ad8a41b87e9e ] Configuration check to accept source route IP options should be made on the incoming netdevice when the skb->dev is an l3mdev master. The route lookup for the source route next hop also needs the incoming netde

[PATCH 4.9 44/76] powerpc/security: Fix spectre_v2 reporting

2019-04-15 Thread Greg Kroah-Hartman
commit 92edf8df0ff2ae86cc632eeca0e651fd8431d40d upstream. When I updated the spectre_v2 reporting to handle software count cache flush I got the logic wrong when there's no software count cache enabled at all. The result is that on systems with the software count cache flush disabled we print:

[PATCH 4.9 54/76] sctp: initialize _pad of sockaddr_in before copying to user memory

2019-04-15 Thread Greg Kroah-Hartman
From: Xin Long [ Upstream commit 09279e615c81ce55e04835970601ae286e3facbe ] Syzbot report a kernel-infoleak: BUG: KMSAN: kernel-infoleak in _copy_to_user+0x16b/0x1f0 lib/usercopy.c:32 Call Trace: _copy_to_user+0x16b/0x1f0 lib/usercopy.c:32 copy_to_user include/linux/uaccess.h:174 [i

[PATCH 4.9 53/76] qmi_wwan: add Olicard 600

2019-04-15 Thread Greg Kroah-Hartman
From: Bjørn Mork [ Upstream commit 6289d0facd9ebce4cc83e5da39e15643ee998dc5 ] This is a Qualcomm based device with a QMI function on interface 4. It is mode switched from 2020:2030 using a standard eject message. T: Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 6 Spd=480 MxCh= 0 D: Ver= 2.00 C

[PATCH 4.9 42/76] powerpc/fsl: Fixed warning: orphan section `__btb_flush_fixup

2019-04-15 Thread Greg Kroah-Hartman
commit 039daac5526932ec731e4499613018d263af8b3e upstream. Fixed the following build warning: powerpc-linux-gnu-ld: warning: orphan section `__btb_flush_fixup' from `arch/powerpc/kernel/head_44x.o' being placed in section `__btb_flush_fixup'. Signed-off-by: Diana Craciun Signed-off-by: Michael El

[PATCH 4.9 37/76] powerpc/fsl: Flush the branch predictor at each kernel entry (64bit)

2019-04-15 Thread Greg Kroah-Hartman
commit 10c5e83afd4a3f01712d97d3bb1ae34d5b74a185 upstream. In order to protect against speculation attacks on indirect branches, the branch predictor is flushed at kernel entry to protect for the following situations: - userspace process attacking another userspace process - userspace process attac

[PATCH 4.9 16/76] powerpc: Use barrier_nospec in copy_from_user()

2019-04-15 Thread Greg Kroah-Hartman
commit ddf35cf3764b5a182b178105f57515b42e2634f8 upstream. Based on the x86 commit doing the same. See commit 304ec1b05031 ("x86/uaccess: Use __uaccess_begin_nospec() and uaccess_try_nospec") and b3bbfb3fb5d2 ("x86: Introduce __uaccess_begin_nospec() and uaccess_try_nospec") for more detail. In a

[PATCH 4.9 34/76] powerpc/fsl: Fix spectre_v2 mitigations reporting

2019-04-15 Thread Greg Kroah-Hartman
commit 7d8bad99ba5a22892f0cad6881289fdc3875a930 upstream. Currently for CONFIG_PPC_FSL_BOOK3E the spectre_v2 file is incorrect: $ cat /sys/devices/system/cpu/vulnerabilities/spectre_v2 "Mitigation: Software count cache flush" Which is wrong. Fix it to report vulnerable for now. Fixes: ee13c

[PATCH 4.9 39/76] powerpc/fsl: Flush branch predictor when entering KVM

2019-04-15 Thread Greg Kroah-Hartman
commit e7aa61f47b23afbec41031bc47ca8d6cb6516abc upstream. Switching from the guest to host is another place where the speculative accesses can be exploited. Flush the branch predictor when entering KVM. Signed-off-by: Diana Craciun Signed-off-by: Michael Ellerman Signed-off-by: Sasha Levin ---

[PATCH 4.9 36/76] powerpc/fsl: Add nospectre_v2 command line argument

2019-04-15 Thread Greg Kroah-Hartman
commit f633a8ad636efb5d4bba1a047d4a0f1ef719aa06 upstream. When the command line argument is present, the Spectre variant 2 mitigations are disabled. Signed-off-by: Diana Craciun Signed-off-by: Michael Ellerman Signed-off-by: Sasha Levin --- arch/powerpc/include/asm/setup.h | 5 + arch/po

[PATCH 4.9 12/76] powerpc/64s: Add support for ori barrier_nospec patching

2019-04-15 Thread Greg Kroah-Hartman
commit 2eea7f067f495e33b8b116b35b5988ab2b8aec55 upstream. Based on the RFI patching. This is required to be able to disable the speculation barrier. Only one barrier type is supported and it does nothing when the firmware does not enable it. Also re-patching modules is not supported So the only m

[PATCH 4.9 05/76] powerpc/tm: Limit TM code inside PPC_TRANSACTIONAL_MEM

2019-04-15 Thread Greg Kroah-Hartman
[ Upstream commit 897bc3df8c5aebb54c32d831f917592e873d0559 ] Commit e1c3743e1a20 ("powerpc/tm: Set MSR[TS] just prior to recheckpoint") moved a code block around and this block uses a 'msr' variable outside of the CONFIG_PPC_TRANSACTIONAL_MEM, however the 'msr' variable is declared inside a CONFIG

[PATCH 4.9 00/76] 4.9.169-stable review

2019-04-15 Thread Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.9.169 release. There are 76 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know. Responses should be made by Wed Apr 17 18:36:37 UTC 2019. Anything receiv

[PATCH 4.9 18/76] powerpc/64s: Enhance the information in cpu_show_spectre_v1()

2019-04-15 Thread Greg Kroah-Hartman
commit a377514519b9a20fa1ea9adddbb4129573129cef upstream. We now have barrier_nospec as mitigation so print it in cpu_show_spectre_v1() when enabled. Signed-off-by: Michal Suchanek Signed-off-by: Michael Ellerman Signed-off-by: Sasha Levin --- arch/powerpc/kernel/security.c | 3 +++ 1 file ch

[PATCH 4.9 20/76] powerpc/64: Disable the speculation barrier from the command line

2019-04-15 Thread Greg Kroah-Hartman
commit cf175dc315f90185128fb061dc05b6fbb211aa2f upstream. The speculation barrier can be disabled from the command line with the parameter: "nospectre_v1". Signed-off-by: Diana Craciun Signed-off-by: Michael Ellerman Signed-off-by: Sasha Levin --- arch/powerpc/kernel/security.c | 12 +

[PATCH 4.9 07/76] x86: vdso: Use $LD instead of $CC to link

2019-04-15 Thread Greg Kroah-Hartman
The vdso{32,64}.so can fail to link with CC=clang when clang tries to find a suitable GCC toolchain to link these libraries with. /usr/bin/ld: arch/x86/entry/vdso/vclock_gettime.o: access beyond end of merged section (782) This happens because the host environment leaked into the cross compiler

Re: [PATCH 6/7] s390: vfio-ap: handle dynamic config/deconfig of AP adapter

2019-04-15 Thread Tony Krowiak
On 4/11/19 5:03 PM, Tony Krowiak wrote: Once an APQN is assigned to an mdev device it will remained assigned until it is explicitly unassigned from the mdev device. The associated AP queue devices, however, can come and go due to failures or deliberate actions by a sysadmin. For example, a sysadm

Re: [PATCH 02/18] ioasid: Add custom IOASID allocator

2019-04-15 Thread Alex Williamson
On Mon, 8 Apr 2019 16:59:17 -0700 Jacob Pan wrote: > Sometimes, IOASID allocation must be handled by platform specific > code. The use cases are guest vIOMMU and pvIOMMU where IOASIDs need > to be allocated by the host via enlightened or paravirt interfaces. > > This patch adds an extension to

Re: [PATCH v2 RESEND 1/2] x86/mm/KASLR: Fix the size of the direct mapping section

2019-04-15 Thread Borislav Petkov
On Sun, Apr 14, 2019 at 03:28:03PM +0800, Baoquan He wrote: > kernel_randomize_memory() uses __PHYSICAL_MASK_SHIFT to calculate > the maximum amount of system RAM supported. The size of the direct > mapping section is obtained from the smaller one of the below two > values: > > (actual system RAM

Re: [PATCH 1/7] s390: zcrypt: driver callback to indicate resource in use

2019-04-15 Thread Halil Pasic
On Mon, 15 Apr 2019 12:51:23 -0400 Tony Krowiak wrote: > Having said that, I understand your concern about a driver hogging > resources. I think I can provide a solution that serves both the > purpose of preventing problems associated with accidental removal > of AP resources as well as allowing

GREETINGS TO YOU

2019-04-15 Thread Mr Alain Kabore
DEAR: FRIEND. I am Mr.ALAIN KABORE i am An active Banker, I saw your email address while browsing through the bank DTC Screen in my office yesterday so I decided to use this very chance to know you more, I have deal of (US$8mllion US Dollars) to transfer into your account, if you are interested

[PATCH 4.14 04/69] x86/power/32: Move SYSENTER MSR restoration to fix_processor_context()

2019-04-15 Thread Greg Kroah-Hartman
[ Upstream commit 896c80bef4d3b357814a476663158aaf669d0fb3 ] x86_64 restores system call MSRs in fix_processor_context(), and x86_32 restored them along with segment registers. The 64-bit variant makes more sense, so move the 32-bit code to match the 64-bit code. No side effects are expected to

[PATCH 4.14 03/69] x86/power/64: Use struct desc_ptr for the IDT in struct saved_context

2019-04-15 Thread Greg Kroah-Hartman
[ Upstream commit 090edbe23ff57940fca7f57d9165ce57a826bd7a ] x86_64's saved_context nonsensically used separate idt_limit and idt_base fields and then cast &idt_limit to struct desc_ptr *. This was correct (with -fno-strict-aliasing), but it's confusing, served no purpose, and required #ifdeffery

[PATCH 4.14 06/69] drm/i915/gvt: do not let pin count of shadow mm go negative

2019-04-15 Thread Greg Kroah-Hartman
[ Upstream commit 663a50ceac75c2208d2ad95365bc8382fd42f44d ] shadow mm's pin count got increased in workload preparation phase, which is after workload scanning. it will get decreased in complete_current_workload() anyway after workload completion. Sometimes, if a workload meets a scanning error,

[PATCH 4.14 00/69] 4.14.112-stable review

2019-04-15 Thread Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.14.112 release. There are 69 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know. Responses should be made by Wed Apr 17 18:36:38 UTC 2019. Anything recei

[PATCH 4.14 02/69] x86/power: Fix some ordering bugs in __restore_processor_context()

2019-04-15 Thread Greg Kroah-Hartman
[ Upstream commit 5b06bbcfc2c621da3009da8decb7511500c293ed ] __restore_processor_context() had a couple of ordering bugs. It restored GSBASE after calling load_gs_index(), and the latter can call into tracing code. It also tried to restore segment registers before restoring the LDT, which is str

[PATCH 4.14 01/69] net: sfp: move sfp_register_socket call from sfp_remove to sfp_probe

2019-04-15 Thread Greg Kroah-Hartman
Commit c4ba68b8691e4 backported from upstream to 4.14 stable was probably applied wrongly, and instead of calling sfp_register_socket in sfp_probe, the socket registering code was put into sfp_remove. This is obviously wrong. The commit first appeared in 4.14.104. Fix it for the next 4.14 release.

[PATCH 4.14 18/69] kcm: switch order of device registration to fix a crash

2019-04-15 Thread Greg Kroah-Hartman
From: Jiri Slaby [ Upstream commit 3c446e6f96997f2a95bf0037ef463802162d2323 ] When kcm is loaded while many processes try to create a KCM socket, a crash occurs: BUG: unable to handle kernel NULL pointer dereference at 000e IP: mutex_lock+0x27/0x40 kernel/locking/mutex.c:240 PGD 8

[PATCH 4.14 24/69] qmi_wwan: add Olicard 600

2019-04-15 Thread Greg Kroah-Hartman
From: Bjørn Mork [ Upstream commit 6289d0facd9ebce4cc83e5da39e15643ee998dc5 ] This is a Qualcomm based device with a QMI function on interface 4. It is mode switched from 2020:2030 using a standard eject message. T: Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 6 Spd=480 MxCh= 0 D: Ver= 2.00 C

[PATCH 4.14 20/69] net/mlx5: Decrease default mr cache size

2019-04-15 Thread Greg Kroah-Hartman
From: Artemy Kovalyov [ Upstream commit e8b26b2135dedc0284490bfeac06dfc4418d0105 ] Delete initialization of high order entries in mr cache to decrease initial memory footprint. When required, the administrator can populate the entries with memory keys via the /sys interface. This approach is ve

[PATCH 4.14 22/69] net/sched: fix ->get helper of the matchall cls

2019-04-15 Thread Greg Kroah-Hartman
From: Nicolas Dichtel [ Upstream commit 0db6f8befc32c68bb13d7ffbb2e563c79e913e13 ] It returned always NULL, thus it was never possible to get the filter. Example: $ ip link add foo type dummy $ ip link add bar type dummy $ tc qdisc add dev foo clsact $ tc filter add dev foo protocol all pref 1

[PATCH 4.14 10/69] x86/vdso: Drop implicit common-page-size linker flag

2019-04-15 Thread Greg Kroah-Hartman
commit ac3e233d29f7f77f28243af0132057d378d3ea58 upstream. GNU linker's -z common-page-size's default value is based on the target architecture. arch/x86/entry/vdso/Makefile sets it to the architecture default, which is implicit and redundant. Drop it. Fixes: 2aae950b21e4 ("x86_64: Add vDSO for x8

[PATCH 4.14 17/69] ipv6: sit: reset ip header pointer in ipip6_rcv

2019-04-15 Thread Greg Kroah-Hartman
From: Lorenzo Bianconi [ Upstream commit bb9bd814ebf04f579be466ba61fc922625508807 ] ipip6 tunnels run iptunnel_pull_header on received skbs. This can determine the following use-after-free accessing iph pointer since the packet will be 'uncloned' running pskb_expand_head if it is a cloned gso sk

[PATCH 4.14 26/69] tcp: Ensure DCTCP reacts to losses

2019-04-15 Thread Greg Kroah-Hartman
From: Koen De Schepper [ Upstream commit aecfde23108b8e637d9f5c5e523b24fb97035dc3 ] RFC8257 §3.5 explicitly states that "A DCTCP sender MUST react to loss episodes in the same way as conventional TCP". Currently, Linux DCTCP performs no cwnd reduction when losses are encountered. Optionally, th

[PATCH 4.14 36/69] ALSA: seq: Fix OOB-reads from strlcpy

2019-04-15 Thread Greg Kroah-Hartman
From: Zubin Mithra commit 212ac181c158c09038c474ba68068be49caecebb upstream. When ioctl calls are made with non-null-terminated userspace strings, strlcpy causes an OOB-read from within strlen. Fix by changing to use strscpy instead. Signed-off-by: Zubin Mithra Reviewed-by: Guenter Roeck Cc:

[PATCH 4.14 35/69] net: ethtool: not call vzalloc for zero sized memory request

2019-04-15 Thread Greg Kroah-Hartman
From: Li RongQing [ Upstream commit 3d8830266ffc28c16032b859e38a0252e014b631 ] NULL or ZERO_SIZE_PTR will be returned for zero sized memory request, and derefencing them will lead to a segfault so it is unnecessory to call vzalloc for zero sized memory request and not call functions which maybe

[PATCH 4.14 13/69] arm64: kaslr: Reserve size of ARM64_MEMSTART_ALIGN in linear region

2019-04-15 Thread Greg Kroah-Hartman
[ Upstream commit c8a43c18a97845e7f94ed7d181c11f41964976a2 ] When KASLR is enabled (CONFIG_RANDOMIZE_BASE=y), the top 4K of kernel virtual address space may be mapped to physical addresses despite being reserved for ERR_PTR values. Fix the randomization of the linear region so that we avoid mappi

[PATCH 4.14 14/69] tty: mark Siemens R3964 line discipline as BROKEN

2019-04-15 Thread Greg Kroah-Hartman
From: Greg Kroah-Hartman commit c7084edc3f6d67750f50d4183134c4fb5712a5c8 upstream. The n_r3964 line discipline driver was written in a different time, when SMP machines were rare, and users were trusted to do the right thing. Since then, the world has moved on but not this code, it has stayed ro

[PATCH 4.14 12/69] stating: ccree: revert "staging: ccree: fix leak of import() after init()"

2019-04-15 Thread Greg Kroah-Hartman
commit 293edc27f8bc8a44978e9e95902b07b74f1c7523 upstream This reverts commit c5f39d07860c ("staging: ccree: fix leak of import() after init()") and commit aece09024414 ("staging: ccree: Uninitialized return in ssi_ahash_import()"). This is the wrong solution and ends up relying on uninitialized m

[PATCH 4.14 40/69] parisc: Detect QEMU earlier in boot process

2019-04-15 Thread Greg Kroah-Hartman
From: Helge Deller commit d006e95b5561f708d0385e9677ffe2c46f2ae345 upstream. While adding LASI support to QEMU, I noticed that the QEMU detection in the kernel happens much too late. For example, when a LASI chip is found by the kernel, it registers the LASI LED driver as well. But when we run

[PATCH 4.14 29/69] net/mlx5e: Add a lock on tir list

2019-04-15 Thread Greg Kroah-Hartman
From: Yuval Avnery [ Upstream commit 80a2a9026b24c6bd34b8d58256973e22270bedec ] Refresh tirs is looping over a global list of tirs while netdevs are adding and removing tirs from that list. That is why a lock is required. Fixes: 724b2aa15126 ("net/mlx5e: TIRs management refactoring") Signed-off

[PATCH 4.14 28/69] net/mlx5e: Fix error handling when refreshing TIRs

2019-04-15 Thread Greg Kroah-Hartman
From: Gavi Teitz [ Upstream commit bc87a0036826a37b43489b029af8143bd07c6cca ] Previously, a false positive would be caught if the TIRs list is empty, since the err value was initialized to -ENOMEM, and was only updated if a TIR is refreshed. This is resolved by initializing the err value to zero

[PATCH 4.14 27/69] vrf: check accept_source_route on the original netdevice

2019-04-15 Thread Greg Kroah-Hartman
From: Stephen Suryaputra [ Upstream commit 8c83f2df9c6578ea4c5b940d8238ad8a41b87e9e ] Configuration check to accept source route IP options should be made on the incoming netdevice when the skb->dev is an l3mdev master. The route lookup for the source route next hop also needs the incoming netde

[PATCH 4.14 30/69] nfp: validate the return code from dev_queue_xmit()

2019-04-15 Thread Greg Kroah-Hartman
From: Jakub Kicinski [ Upstream commit c8ba5b91a04e3e2643e48501c114108802f21cda ] dev_queue_xmit() may return error codes as well as netdev_tx_t, and it always consumes the skb. Make sure we always return a correct netdev_tx_t value. Fixes: eadfa4c3be99 ("nfp: add stats and xmit helpers for re

[PATCH 4.14 41/69] parisc: regs_return_value() should return gpr28

2019-04-15 Thread Greg Kroah-Hartman
From: Sven Schnelle commit 45efd871bf0a47648f119d1b41467f70484de5bc upstream. While working on kretprobes for PA-RISC I was wondering while the kprobes sanity test always fails on kretprobes. This is caused by returning gpr20 instead of gpr28. Signed-off-by: Sven Schnelle Signed-off-by: Helge

[PATCH 4.14 56/69] ARM: dts: at91: Fix typo in ISC_D0 on PC9

2019-04-15 Thread Greg Kroah-Hartman
From: David Engraf commit e7dfb6d04e4715be1f3eb2c60d97b753fd2e4516 upstream. The function argument for the ISC_D0 on PC9 was incorrect. According to the documentation it should be 'C' aka 3. Signed-off-by: David Engraf Reviewed-by: Nicolas Ferre Signed-off-by: Ludovic Desroches Fixes: 7f16cb

[PATCH 4.14 54/69] ARM: dts: am335x-evmsk: Correct the regulators for the audio codec

2019-04-15 Thread Greg Kroah-Hartman
From: Peter Ujfalusi commit 6691370646e844be98bb6558c024269791d20bd7 upstream. Correctly map the regulators used by tlv320aic3106. Both 1.8V and 3.3V for the codec is derived from VBAT via fixed regulators. Cc: # v4.14+ Signed-off-by: Peter Ujfalusi Signed-off-by: Tony Lindgren Signed-off-by

[PATCH 4.14 53/69] virtio: Honour may_reduce_num in vring_create_virtqueue

2019-04-15 Thread Greg Kroah-Hartman
From: Cornelia Huck commit cf94db21905333e610e479688add629397a4b384 upstream. vring_create_virtqueue() allows the caller to specify via the may_reduce_num parameter whether the vring code is allowed to allocate a smaller ring than specified. However, the split ring allocation code tries to allo

[PATCH 4.14 34/69] netns: provide pure entropy for net_hash_mix()

2019-04-15 Thread Greg Kroah-Hartman
From: Eric Dumazet [ Upstream commit 355b98553789b646ed97ad801a619ff898471b92 ] net_hash_mix() currently uses kernel address of a struct net, and is used in many places that could be used to reveal this address to a patient attacker, thus defeating KASLR, for the typical case (initial net namesp

[PATCH 4.14 31/69] bnxt_en: Improve RX consumer index validity check.

2019-04-15 Thread Greg Kroah-Hartman
From: Michael Chan [ Upstream commit a1b0e4e684e9c300b9e759b46cb7a0147e61ddff ] There is logic to check that the RX/TPA consumer index is the expected index to work around a hardware problem. However, the potentially bad consumer index is first used to index into an array to reference an entry.

[PATCH 4.14 32/69] bnxt_en: Reset device on RX buffer errors.

2019-04-15 Thread Greg Kroah-Hartman
From: Michael Chan [ Upstream commit 8e44e96c6c8e8fb80b84a2ca11798a8554f710f2 ] If the RX completion indicates RX buffers errors, the RX ring will be disabled by firmware and no packets will be received on that ring from that point on. Recover by resetting the device. Fixes: c0c050c58d84 ("bnx

[PATCH 4.14 33/69] net/sched: act_sample: fix divide by zero in the traffic path

2019-04-15 Thread Greg Kroah-Hartman
From: Davide Caratti [ Upstream commit fae2708174ae95d98d19f194e03d6e8f688ae195 ] the control path of 'sample' action does not validate the value of 'rate' provided by the user, but then it uses it as divisor in the traffic path. Validate it in tcf_sample_init(), and return -EINVAL with a proper

[PATCH 4.14 44/69] include/linux/bitrev.h: fix constant bitrev

2019-04-15 Thread Greg Kroah-Hartman
From: Arnd Bergmann commit 6147e136ff5071609b54f18982dea87706288e21 upstream. clang points out with hundreds of warnings that the bitrev macros have a problem with constant input: drivers/hwmon/sht15.c:187:11: error: variable '__x' is uninitialized when used within its own initialization

[PATCH 4.14 48/69] btrfs: prop: fix vanished compression property after failed set

2019-04-15 Thread Greg Kroah-Hartman
From: Anand Jain commit 272e5326c7837697882ce3162029ba893059b616 upstream. The compression property resets to NULL, instead of the old value if we fail to set the new compression parameter. $ btrfs prop get /btrfs compression compression=lzo $ btrfs prop set /btrfs compression zli E

[PATCH 4.14 61/69] sched/fair: Do not re-read ->h_load_next during hierarchical load calculation

2019-04-15 Thread Greg Kroah-Hartman
From: Mel Gorman commit 0e9f02450da07fc7b1346c8c32c771555173e397 upstream. A NULL pointer dereference bug was reported on a distribution kernel but the same issue should be present on mainline kernel. It occured on s390 but should not be arch-specific. A partial oops looks like: Unable to ha

<    5   6   7   8   9   10   11   12   >