Linux 4.14.15
Greg KH
maintainerI'm announcing the release of the 4.14.15 kernel.
All users of the 4.14 kernel series must upgrade.
The updated 4.14.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-4.14.y
and can be browsed at the normal kernel.org git web browser:
http://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary
thanks,
greg k-h
------------
Documentation/x86/pti.txt | 2 Makefile | 2 arch/alpha/kernel/sys_sio.c | 35 + arch/arm/boot/dts/kirkwood-openblocks_a7.dts | 10 arch/arm/configs/sunxi_defconfig | 2 arch/arm/mach-omap2/omap_hwmod_3xxx_data.c | 1 arch/arm64/boot/dts/marvell/armada-cp110-master.dtsi | 13 arch/arm64/boot/dts/marvell/armada-cp110-slave.dtsi | 9 arch/arm64/kvm/handle_exit.c | 4 arch/mips/ar7/platform.c | 2 arch/mips/kernel/mips-cm.c | 1 arch/powerpc/include/asm/exception-64e.h | 6 arch/powerpc/include/asm/exception-64s.h | 57 ++- arch/powerpc/include/asm/feature-fixups.h | 13 arch/powerpc/include/asm/hvcall.h | 17 arch/powerpc/include/asm/paca.h | 10 arch/powerpc/include/asm/plpar_wrappers.h | 14 arch/powerpc/include/asm/setup.h | 13 arch/powerpc/kernel/asm-offsets.c | 5 arch/powerpc/kernel/entry_64.S | 44 +- arch/powerpc/kernel/exceptions-64s.S | 135 ++++++- arch/powerpc/kernel/setup_64.c | 101 +++++ arch/powerpc/kernel/vmlinux.lds.S | 9 arch/powerpc/kvm/book3s_hv_rmhandlers.S | 7 arch/powerpc/kvm/book3s_rmhandlers.S | 7 arch/powerpc/kvm/book3s_segment.S | 4 arch/powerpc/lib/feature-fixups.c | 41 ++ arch/powerpc/platforms/powernv/setup.c | 49 ++ arch/powerpc/platforms/pseries/setup.c | 35 + arch/x86/entry/entry_32.S | 11 arch/x86/entry/entry_64.S | 13 arch/x86/include/asm/cpufeatures.h | 3 arch/x86/include/asm/mem_encrypt.h | 4 arch/x86/include/asm/nospec-branch.h | 16 arch/x86/include/asm/traps.h | 1 arch/x86/kernel/apic/vector.c | 7 arch/x86/kernel/cpu/bugs.c | 36 + arch/x86/kernel/cpu/intel_rdt.c | 8 arch/x86/kernel/cpu/mcheck/mce.c | 5 arch/x86/kernel/cpu/scattered.c | 1 arch/x86/kernel/head64.c | 4 arch/x86/kernel/idt.c | 12 arch/x86/kernel/kprobes/opt.c | 23 + arch/x86/kernel/process.c | 25 - arch/x86/kernel/setup.c | 8 arch/x86/kernel/tsc.c | 3 arch/x86/kernel/vmlinux.lds.S | 6 arch/x86/lib/retpoline.S | 5 arch/x86/mm/fault.c | 7 arch/x86/mm/kasan_init_64.c | 24 - arch/x86/mm/mem_encrypt.c | 356 +++++++++++++------ arch/x86/mm/mem_encrypt_boot.S | 80 ++-- drivers/ata/libata-core.c | 1 drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgf119.c | 1 drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c | 4 drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c | 4 drivers/i2c/i2c-core-smbus.c | 13 drivers/infiniband/hw/hfi1/file_ops.c | 4 drivers/infiniband/hw/mlx5/qp.c | 7 drivers/infiniband/ulp/isert/ib_isert.c | 1 drivers/input/misc/twl4030-vibra.c | 6 drivers/input/misc/twl6040-vibra.c | 3 drivers/input/mouse/alps.c | 23 - drivers/input/mouse/alps.h | 10 drivers/input/rmi4/rmi_driver.c | 4 drivers/input/touchscreen/88pm860x-ts.c | 16 drivers/md/dm-crypt.c | 20 - drivers/md/dm-integrity.c | 49 +- drivers/md/dm-thin-metadata.c | 6 drivers/md/persistent-data/dm-btree.c | 19 - drivers/mmc/host/sdhci-esdhc-imx.c | 14 drivers/net/can/usb/peak_usb/pcan_usb_fd.c | 21 - drivers/net/ethernet/marvell/mvpp2.c | 9 drivers/phy/phy-core.c | 4 drivers/scsi/libsas/sas_scsi_host.c | 17 fs/pipe.c | 17 fs/proc/array.c | 7 include/linux/delayacct.h | 8 include/linux/swapops.h | 21 + include/linux/vermagic.h | 8 kernel/delayacct.c | 42 +- kernel/futex.c | 86 +++- kernel/locking/rtmutex.c | 26 + kernel/locking/rtmutex_common.h | 1 kernel/sched/core.c | 6 kernel/time/timer.c | 2 kernel/trace/trace_events.c | 16 kernel/workqueue.c | 13 mm/page_vma_mapped.c | 63 ++- net/can/af_can.c | 36 - net/key/af_key.c | 8 scripts/Makefile.build | 14 scripts/gdb/linux/tasks.py | 2 sound/core/pcm_lib.c | 1 sound/core/seq/seq_clientmgr.c | 3 sound/core/seq/seq_clientmgr.h | 1 sound/pci/hda/patch_cirrus.c | 1 sound/pci/hda/patch_realtek.c | 1 tools/objtool/Makefile | 2 tools/objtool/arch/x86/decode.c | 2 tools/objtool/builtin-orc.c | 4 tools/objtool/elf.c | 4 tools/objtool/orc_gen.c | 2 virt/kvm/arm/mmu.c | 2 104 files changed, 1514 insertions(+), 447 deletions(-)
Alexey Dobriyan (1):
proc: fix coredump vs read /proc/*/stat race
Andi Kleen (3):
module: Add retpoline tag to VERMAGIC
x86/idt: Mark IDT tables __initconst x86/retpoline: Optimize inline assembler for vmexit_fill_RSB
Andrew Morton (1):
tools/objtool/Makefile: don't assume sync-check.sh is executable
Andrey Ryabinin (1):
x86/kasan: Panic if there is not enough memory to boot
Arnd Bergmann (1):
phy: work around 'phys' references to usb-nop-xceiv devices
Benoît Thébaudeau (1):
mmc: sdhci-esdhc-imx: Fix i.MX53 eSDHCv3 clock
Dan Carpenter (1):
IB/hfi1: Prevent a NULL dereference
David Woodhouse (1):
x86/retpoline: Fill RSB on context switch for affected CPUs
Dennis Yang (1):
dm thin metadata: THIN_MAX_CONCURRENT_LOCKS should be 6
Eric Biggers (2):
af_key: fix buffer overread in verify_address_len()
af_key: fix buffer overread in parse_exthdrs()
Eric W. Biederman (1):
x86/mm/pkeys: Fix fill_sig_info_pkey
Greg Kroah-Hartman (1):
Linux 4.14.15
Gregory CLEMENT (1):
ARM64: dts: marvell: armada-cp110: Fix clock resources for various node
Hannes Reinecke (1):
scsi: libsas: Disable asynchronous aborts for SATA devices
James Hogan (1):
MIPS: CM: Drop WARN_ON(vp != 0)
Jeremy Compostella (1):
i2c: core-smbus: prevent stack corruption on read I2C_BLOCK_DATA
Joe Lawrence (1):
pipe: avoid round_pipe_size() nr_pages overflow on 32-bit
Joe Thornber (1):
dm btree: fix serious bug in btree_split_beneath()
Johan Hovold (3):
Input: 88pm860x-ts - fix child-node lookup
Input: twl6040-vibra - fix child-node lookup
Input: twl4030-vibra - fix sibling-node lookup
Jonas Gorski (1):
MIPS: AR7: ensure the port type's FCR value is used
Josh Poimboeuf (2):
objtool: Fix seg fault with gold linker
objtool: Improve error message for bad file argument
Josh Snyder (1):
delayacct: Account blkio completion on the correct task
Kirill A. Shutemov (1):
mm, page_vma_mapped: Drop faulty pointer arithmetics in check_pte()
Laura Abbott (1):
x86: Use __nostackprotect for sme_encrypt_kernel
Len Brown (2):
x86/tsc: Future-proof native_calibrate_tsc() x86/tsc: Fix erroneous TSC rate on Skylake Xeon
Leon Romanovsky (1):
RDMA/mlx5: Fix out-of-bound access while querying AH
Li Jinyue (1):
futex: Prevent overflow by strengthen input validation
Lorenzo Pieralisi (1):
alpha/PCI: Fix noname IRQ level detection
Lukas Bulwahn (1):
objtool: Fix Clang enum conversion warning
Marc Kleine-Budde (2):
can: af_can: can_rcv(): replace WARN_ONCE by pr_warn_once
can: af_can: canfd_rcv(): replace WARN_ONCE by pr_warn_once
Marc Zyngier (1):
arm64: KVM: Fix SMCCC handling of unimplemented SMC/HVC calls
Masami Hiramatsu (3):
retpoline: Introduce start/end markers of indirect thunk kprobes/x86: Blacklist indirect thunk functions for kprobes kprobes/x86: Disable optimizing on the function jumps to indirect thunk
Maxime Ripard (1):
ARM: sunxi_defconfig: Enable CMA
Michael Ellerman (2):
powerpc/64s: Add support for RFI flush of L1-D cache powerpc/64s: Support disabling RFI flush with no_rfi_flush and nopti
Michael Neuling (2):
powerpc/pseries: Add H_GET_CPU_CHARACTERISTICS flags & wrapper powerpc/pseries: Query hypervisor for RFI flush settings
Mikulas Patocka (1):
dm integrity: don't store cipher request on the stack
Milan Broz (1):
dm crypt: fix crash by adding missing check for auth key size
Nicholas Piggin (5):
powerpc/64: Add macros for annotating the destination of rfid/hrfid powerpc/64s: Simple RFI macro conversions
powerpc/64: Convert the syscall exit path to use RFI_TO_USER/KERNEL powerpc/64: Convert fast_exception_return to use RFI_TO_USER/KERNEL powerpc/64s: Convert slb_miss_common to use RFI_TO_USER/KERNEL
Nick Desaulniers (1):
Input: synaptics-rmi4 - prevent UAF reported by KASAN
Nir Perry (1):
Input: ALPS - fix multi-touch decoding on SS4 plus touchpads
Oliver O'Halloran (1):
powerpc/powernv: Check device-tree for RFI flush settings
Ondrej Kozina (1):
dm crypt: wipe kernel key copy after IV initialization
Paolo Bonzini (1):
x86/cpufeature: Move processor tracing out of scattered features
Peter Zijlstra (1):
futex: Avoid violating the 10th rule of futex
Punit Agrawal (1):
KVM: arm/arm64: Check pagesize when allocating a hugepage at Stage 2
Rob Clark (2):
drm/nouveau/disp/gf119: add missing drive vfunc ptr drm/vmwgfx: fix memory corruption with legacy/sou connectors
Sagi Grimberg (1):
iser-target: Fix possible use-after-free in connection establishment error
Sergey Senozhatsky (1):
workqueue: avoid hard lockups in show_workqueue_state()
Simon Ser (2):
objtool: Fix seg fault with clang-compiled objects
objtool: Fix seg fault caused by missing parameter
Stephane Grosjean (1):
can: peak: fix potential bug in packet fragmentation
Steven Rostedt (VMware) (1):
tracing: Fix converting enum's from the map in trace_event_eval_update()
Takashi Iwai (4):
ALSA: seq: Make ioctls race-free
ALSA: pcm: Remove yet superfluous WARN_ON()
ALSA: hda - Apply headphone noise quirk for another Dell XPS 13 variant
ALSA: hda - Apply the existing quirk to iMac 14,1
Tero Kristo (1):
ARM: OMAP3: hwmod_data: add missing module_offs for MMC3
Thomas Gleixner (4):
timers: Unconditionally check deferrable base x86/intel_rdt/cqm: Prevent use after free x86/apic/vector: Fix off by one in error path x86/mce: Make machine check speculation protected
Thomas Petazzoni (1):
ARM: dts: kirkwood: fix pin-muxing of MPP7 on OpenBlocks A7
Tom Lendacky (7):
x86/retpoline: Add LFENCE to the retpoline/RSB filling RSB macros x86/mm: Clean up register saving in the __enc_copy() assembly code x86/mm: Use a struct to reduce parameters for SME PGD mapping x86/mm: Centralize PMD flags in sme_encrypt_kernel() x86/mm: Prepare sme_encrypt_kernel() for PAGE aligned encryption x86/mm: Encrypt the initrd earlier for BSP microcode update x86/mm: Rework wbinvd, hlt operation in stop_this_cpu()
Wei Yongjun (1):
dm crypt: fix error return code in crypt_ctr()
Xi Kangjie (1):
scripts/gdb/linux/tasks.py: fix get_thread_info
Xinyu Lin (1):
libata: apply MAX_SEC_1024 to all LITEON EP1 series devices
Yan Markman (1):
net: mvpp2: do not disable GMAC padding
zhenwei.pi (1):
x86/pti: Document fix wrong index
Greg KH
maintainerDocumentation/x86/pti.txt +1 -1
@@ -78,7 +78,7 @@ this protection comes at a cost: non-PTI SYSCALL entry code, so requires mapping fewer things into the userspace page tables. The downside is that stacks must be switched at entry time. - d. Global pages are disabled for all kernel structures not + c. Global pages are disabled for all kernel structures not mapped into both kernel and userspace page tables. This feature of the MMU allows different processes to share TLB entries mapping the kernel. Losing the feature means more
Makefile +1 -1
@@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 VERSION = 4 PATCHLEVEL = 14 -SUBLEVEL = 14 +SUBLEVEL = 15 EXTRAVERSION = NAME = Petit Gorille
arch/alpha/kernel/sys_sio.c +29 -6
@@ -102,6 +102,15 @@ sio_pci_route(void) alpha_mv.sys.sio.route_tab); } +static bool sio_pci_dev_irq_needs_level (const struct pci_dev *dev) +{ +if ((dev->class >>16 ==PCI_BASE_CLASS_BRIDGE ) && + (dev->class >>8 !=PCI_CLASS_BRIDGE_PCMCIA )) +return false; + +return true; +} +static unsigned int __init sio_collect_irq_levels (void ) {
@@ -110,8 +119,7 @@ sio_collect_irq_levels(void)/* Iterate through the devices, collecting IRQ levels. */ for_each_pci_dev (dev) { -if ((dev->class >>16 ==PCI_BASE_CLASS_BRIDGE ) && - (dev->class >>8 !=PCI_CLASS_BRIDGE_PCMCIA )) +if (!sio_pci_dev_irq_needs_level (dev))continue ;if (dev->irq)
@@ -120,8 +128,7 @@ sio_collect_irq_levels(void)return level_bits; } -static void __init -sio_fixup_irq_levels (unsigned int level_bits) +static void __sio_fixup_irq_levels (unsigned int level_bits,bool reset) {unsigned int old_level_bits;
@@ -139,12 +146,21 @@ sio_fixup_irq_levels(unsigned int level_bits)*/ old_level_bits =inb (0x4d0 ) | (inb (0x4d1 ) <<8 ); - level_bits |= (old_level_bits &0x71ff ); +if (reset) + old_level_bits &=0x71ff ; + + level_bits |= old_level_bits;outb ((level_bits >>0 ) &0xff ,0x4d0 );outb ((level_bits >>8 ) &0xff ,0x4d1 ); } +static inline void +sio_fixup_irq_levels (unsigned int level_bits) +{ +__sio_fixup_irq_levels (level_bits, true); +} +static inline int noname_map_irq (const struct pci_dev *dev,u8 slot,u8 pin) {
@@ -181,7 +197,14 @@ noname_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)const long min_idsel =6 , max_idsel =14 , irqs_per_slot =5 ;int irq =COMMON_TABLE_LOOKUP , tmp; tmp =__kernel_extbl (alpha_mv.sys.sio.route_tab, irq); -return irq >=0 ? tmp :-1 ; + + irq = irq >=0 ? tmp :-1 ; + +/* Fixup IRQ level if an actual IRQ mapping is detected */ +if (sio_pci_dev_irq_needs_level (dev) && irq >=0 ) +__sio_fixup_irq_levels (1 << irq, false); + +return irq; } static inline int
arch/arm/boot/dts/kirkwood-openblocks_a7.dts +8 -2
@@ -53,7 +53,8 @@ }; pinctrl: pin-controller@10000 { - pinctrl-0 = <&pmx_dip_switches &pmx_gpio_header>; + pinctrl-0 = <&pmx_dip_switches &pmx_gpio_header + &pmx_gpio_header_gpo>; pinctrl-names = "default"; pmx_uart0: pmx-uart0 {
@@ -85,11 +86,16 @@ * ground. */ pmx_gpio_header: pmx-gpio-header { - marvell,pins = "mpp17", "mpp7", "mpp29", "mpp28", + marvell,pins = "mpp17", "mpp29", "mpp28", "mpp35", "mpp34", "mpp40"; marvell,function = "gpio"; }; + pmx_gpio_header_gpo: pxm-gpio-header-gpo { + marvell,pins = "mpp7"; + marvell,function = "gpo"; + }; + pmx_gpio_init: pmx-init { marvell,pins = "mpp38"; marvell,function = "gpio";
arch/arm/configs/sunxi_defconfig +2 -0
@@ -10,6 +10,7 @@ CONFIG_SMP=y CONFIG_NR_CPUS=8 CONFIG_AEABI=y CONFIG_HIGHMEM=y +CONFIG_CMA=y CONFIG_ARM_APPENDED_DTB=y CONFIG_ARM_ATAG_DTB_COMPAT=y CONFIG_CPU_FREQ=y
@@ -33,6 +34,7 @@ CONFIG_CAN_SUN4I=y # CONFIG_WIRELESS is not set CONFIG_DEVTMPFS=y CONFIG_DEVTMPFS_MOUNT=y +CONFIG_DMA_CMA=y CONFIG_BLK_DEV_SD=y CONFIG_ATA=y CONFIG_AHCI_SUNXI=y
arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +1 -0
@@ -1656,6 +1656,7 @@ static struct omap_hwmod omap3xxx_mmc3_hwmod = { .main_clk = "mmchs3_fck", .prcm = { .omap2 = { + .module_offs = CORE_MOD, .prcm_reg_id = 1, .module_bit = OMAP3430_EN_MMC3_SHIFT, .idlest_reg_id = 1,
arch/arm64/boot/dts/marvell/armada-cp110-master.dtsi +8 -5
@@ -63,8 +63,10 @@ cpm_ethernet: ethernet@0 { compatible = "marvell,armada-7k-pp22"; reg = <0x0 0x100000>, <0x129000 0xb000>; - clocks = <&cpm_clk 1 3>, <&cpm_clk 1 9>, <&cpm_clk 1 5>; - clock-names = "pp_clk", "gop_clk", "mg_clk"; + clocks = <&cpm_clk 1 3>, <&cpm_clk 1 9>, + <&cpm_clk 1 5>, <&cpm_clk 1 18>; + clock-names = "pp_clk", "gop_clk", + "mg_clk","axi_clk"; marvell,system-controller = <&cpm_syscon0>; status = "disabled"; dma-coherent;
@@ -114,7 +116,8 @@ #size-cells = <0>; compatible = "marvell,orion-mdio"; reg = <0x12a200 0x10>; - clocks = <&cpm_clk 1 9>, <&cpm_clk 1 5>; + clocks = <&cpm_clk 1 9>, <&cpm_clk 1 5>, + <&cpm_clk 1 6>, <&cpm_clk 1 18>; status = "disabled"; };
@@ -295,8 +298,8 @@ compatible = "marvell,armada-cp110-sdhci"; reg = <0x780000 0x300>; interrupts = <ICU_GRP_NSR 27 IRQ_TYPE_LEVEL_HIGH>; - clock-names = "core"; - clocks = <&cpm_clk 1 4>; + clock-names = "core","axi"; + clocks = <&cpm_clk 1 4>, <&cpm_clk 1 18>; dma-coherent; status = "disabled"; };
arch/arm64/boot/dts/marvell/armada-cp110-slave.dtsi +6 -3
@@ -63,8 +63,10 @@ cps_ethernet: ethernet@0 { compatible = "marvell,armada-7k-pp22"; reg = <0x0 0x100000>, <0x129000 0xb000>; - clocks = <&cps_clk 1 3>, <&cps_clk 1 9>, <&cps_clk 1 5>; - clock-names = "pp_clk", "gop_clk", "mg_clk"; + clocks = <&cps_clk 1 3>, <&cps_clk 1 9>, + <&cps_clk 1 5>, <&cps_clk 1 18>; + clock-names = "pp_clk", "gop_clk", + "mg_clk", "axi_clk"; marvell,system-controller = <&cps_syscon0>; status = "disabled"; dma-coherent;
@@ -114,7 +116,8 @@ #size-cells = <0>; compatible = "marvell,orion-mdio"; reg = <0x12a200 0x10>; - clocks = <&cps_clk 1 9>, <&cps_clk 1 5>; + clocks = <&cps_clk 1 9>, <&cps_clk 1 5>, + <&cps_clk 1 6>, <&cps_clk 1 18>; status = "disabled"; };
arch/arm64/kvm/handle_exit.c +2 -2
@@ -44,7 +44,7 @@ static int handle_hvc(struct kvm_vcpu *vcpu, struct kvm_run *run) ret =kvm_psci_call (vcpu);if (ret <0 ) { -kvm_inject_undefined (vcpu); +vcpu_set_reg (vcpu,0 , ~0UL );return 1 ; }
@@ -53,7 +53,7 @@ static int handle_hvc(struct kvm_vcpu *vcpu, struct kvm_run *run)static int handle_smc (struct kvm_vcpu *vcpu,struct kvm_run *run) { -kvm_inject_undefined (vcpu); +vcpu_set_reg (vcpu,0 , ~0UL );return 1 ; }
arch/mips/ar7/platform.c +1 -1
@@ -575,7 +575,7 @@ static int __init ar7_register_uarts(void) uart_port.type =PORT_AR7 ; uart_port.uartclk =clk_get_rate (bus_clk) /2 ; uart_port.iotype =UPIO_MEM32 ; - uart_port.flags =UPF_FIXED_TYPE ; + uart_port.flags =UPF_FIXED_TYPE |UPF_BOOT_AUTOCONF ; uart_port.regshift =2 ; uart_port.line =0 ;
arch/mips/kernel/mips-cm.c +0 -1
@@ -292,7 +292,6 @@ void mips_cm_lock_other(unsigned int cluster, unsigned int core, *this_cpu_ptr(&cm_core_lock_flags)); }else {WARN_ON (cluster !=0 ); -WARN_ON (vp !=0 );WARN_ON (block != CM_GCR_Cx_OTHER_BLOCK_LOCAL);/*
arch/powerpc/include/asm/exception-64e.h +6 -0
@@ -209,5 +209,11 @@ exc_##label##_book3e: ori r3,r3,vector_offset@l; \ mtspr SPRN_IVOR##vector_number,r3; +#define RFI_TO_KERNEL \ + rfi + +#define RFI_TO_USER \ + rfi +#endif /* _ASM_POWERPC_EXCEPTION_64E_H */
arch/powerpc/include/asm/exception-64s.h +55 -2
75 lines not on this page · raw message
arch/powerpc/include/asm/feature-fixups.h +13 -0
@@ -187,7 +187,20 @@ label##3: \ FTR_ENTRY_OFFSET label##1b-label##3b; \ .popsection; +#define RFI_FLUSH_FIXUP_SECTION \ +951: \ + .pushsection __rfi_flush_fixup,"a"; \ + .align 2; \ +952: \ + FTR_ENTRY_OFFSET 951b-952b; \ + .popsection; + +#ifndef __ASSEMBLY__ +#include <linux/types.h> + +extern long __start___rfi_flush_fixup, __stop___rfi_flush_fixup; +void apply_feature_fixups (void );void setup_feature_keys (void );#endif
arch/powerpc/include/asm/hvcall.h +17 -0
@@ -241,6 +241,7 @@#define H_GET_HCA_INFO 0x1B8#define H_GET_PERF_COUNT 0x1BC#define H_MANAGE_TRACE 0x1C0 +#define H_GET_CPU_CHARACTERISTICS 0x1C8#define H_FREE_LOGICAL_LAN_BUFFER 0x1D4#define H_QUERY_INT_STATE 0x1E4#define H_POLL_PENDING 0x1D8
@@ -330,6 +331,17 @@#define H_SIGNAL_SYS_RESET_ALL_OTHERS -2/* >= 0 values are CPU number */ +/* H_GET_CPU_CHARACTERISTICS return values */ +#define H_CPU_CHAR_SPEC_BAR_ORI31 (1ull << 63) // IBM bit 0 +#define H_CPU_CHAR_BCCTRL_SERIALISED (1ull << 62) // IBM bit 1 +#define H_CPU_CHAR_L1D_FLUSH_ORI30 (1ull << 61) // IBM bit 2 +#define H_CPU_CHAR_L1D_FLUSH_TRIG2 (1ull << 60) // IBM bit 3 +#define H_CPU_CHAR_L1D_THREAD_PRIV (1ull << 59) // IBM bit 4 + +#define H_CPU_BEHAV_FAVOUR_SECURITY (1ull << 63) // IBM bit 0 +#define H_CPU_BEHAV_L1D_FLUSH_PR (1ull << 62) // IBM bit 1 +#define H_CPU_BEHAV_BNDS_CHK_SPEC_BAR (1ull << 61) // IBM bit 2 +/* Flag values used in H_REGISTER_PROC_TBL hcall */ #define PROC_TABLE_OP_MASK 0x18#define PROC_TABLE_DEREG 0x10
@@ -436,6 +448,11 @@ static inline unsigned int get_longbusy_msecs(int longbusy_rc) } } +struct h_cpu_char_result { +u64 character; +u64 behaviour; +}; +#endif /* __ASSEMBLY__ */ #endif /* __KERNEL__ */ #endif /* _ASM_POWERPC_HVCALL_H */
arch/powerpc/include/asm/paca.h +10 -0
@@ -231,6 +231,16 @@ struct paca_struct {struct sibling_subcore_state *sibling_subcore_state;#endif #endif +#ifdef CONFIG_PPC_BOOK3S_64 +/* +* rfi fallback flush must be in its own cacheline to prevent +* other paca data leaking into the L1d +*/ +u64 exrfi[EX_SIZE ]__aligned(0x80) ; +void *rfi_flush_fallback_area; +u64 l1d_flush_congruence; +u64 l1d_flush_sets; +#endif };extern void copy_mm_to_paca (struct mm_struct *mm);
arch/powerpc/include/asm/plpar_wrappers.h +14 -0
@@ -326,4 +326,18 @@ static inline long plapr_signal_sys_reset(long cpu) return plpar_hcall_norets(H_SIGNAL_SYS_RESET, cpu); } +static inline long plpar_get_cpu_characteristics (struct h_cpu_char_result *p) +{ +unsigned long retbuf[PLPAR_HCALL_BUFSIZE ]; +long rc; + + rc =plpar_hcall (H_GET_CPU_CHARACTERISTICS , retbuf); +if (rc ==H_SUCCESS ) { + p->character = retbuf[0 ]; + p->behaviour = retbuf[1 ]; + } + +return rc; +} +#endif /* _ASM_POWERPC_PLPAR_WRAPPERS_H */
arch/powerpc/include/asm/setup.h +13 -0
@@ -39,6 +39,19 @@ static inline void pseries_big_endian_exceptions(void) {}static inline void pseries_little_endian_exceptions (void ) {}#endif /* CONFIG_PPC_PSERIES */ +void rfi_flush_enable (bool enable); + +/* These are bit flags */ +enum l1d_flush_type { +L1D_FLUSH_NONE =0x1 , +L1D_FLUSH_FALLBACK =0x2 , +L1D_FLUSH_ORI =0x4 , +L1D_FLUSH_MTTRIG =0x8 , +}; + +void __init setup_rfi_flush (enum l1d_flush_type ,bool enable); +void do_rfi_flush_fixups (enum l1d_flush_type types); +#endif /* !__ASSEMBLY__ */ #endif /* _ASM_POWERPC_SETUP_H */
arch/powerpc/kernel/asm-offsets.c +5 -0
@@ -237,6 +237,11 @@ int main(void)OFFSET (PACA_NMI_EMERG_SP , paca_struct, nmi_emergency_sp);OFFSET (PACA_IN_MCE , paca_struct, in_mce);OFFSET (PACA_IN_NMI , paca_struct, in_nmi); +OFFSET (PACA_RFI_FLUSH_FALLBACK_AREA , paca_struct, rfi_flush_fallback_area); +OFFSET (PACA_EXRFI , paca_struct, exrfi); +OFFSET (PACA_L1D_FLUSH_CONGRUENCE , paca_struct, l1d_flush_congruence); +OFFSET (PACA_L1D_FLUSH_SETS , paca_struct, l1d_flush_sets); +#endif OFFSET (PACAHWCPUID , paca_struct, hw_cpu_id);OFFSET (PACAKEXECSTATE , paca_struct, kexec_state);
arch/powerpc/kernel/entry_64.S +36 -8
99 lines not on this page · raw message
arch/powerpc/kernel/exceptions-64s.S +123 -12
227 lines not on this page · raw message
arch/powerpc/kernel/setup_64.c +101 -0
104 lines not on this page · raw message
arch/powerpc/kernel/vmlinux.lds.S +9 -0
@@ -132,6 +132,15 @@ SECTIONS /* Read-only data */ RO_DATA(PAGE_SIZE) +#ifdef CONFIG_PPC64 + . = ALIGN(8); + __rfi_flush_fixup : AT(ADDR(__rfi_flush_fixup) - LOAD_OFFSET) { + __start___rfi_flush_fixup = .; + *(__rfi_flush_fixup) + __stop___rfi_flush_fixup = .; + } +#endif + EXCEPTION_TABLE(0) NOTES :kernel :notes
arch/powerpc/kvm/book3s_hv_rmhandlers.S +3 -4
@@ -78,7 +78,7 @@ _GLOBAL_TOC(kvmppc_hv_entry_trampoline) mtmsrd r0,1 /* clear RI in MSR */ mtsrr0 r5 mtsrr1 r6 - RFI + RFI_TO_KERNEL kvmppc_call_hv_entry: ld r4, HSTATE_KVM_VCPU(r13)
@@ -187,7 +187,7 @@ END_FTR_SECTION_IFCLR(CPU_FTR_ARCH_300) mtmsrd r6, 1 /* Clear RI in MSR */ mtsrr0 r8 mtsrr1 r7 - RFI + RFI_TO_KERNEL /* Virtual-mode return */ .Lvirt_return:
@@ -1131,8 +1131,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_ARCH_300) ld r0, VCPU_GPR(R0)(r4) ld r4, VCPU_GPR(R4)(r4) - - hrfid + HRFI_TO_GUEST b . secondary_too_late:
arch/powerpc/kvm/book3s_rmhandlers.S +5 -2
@@ -46,6 +46,9 @@ #define FUNC(name) name +#define RFI_TO_KERNEL RFI +#define RFI_TO_GUEST RFI + .macro INTERRUPT_TRAMPOLINE intno .global kvmppc_trampoline_\intno
@@ -141,7 +144,7 @@ kvmppc_handler_skip_ins: GET_SCRATCH0(r13) /* And get back into the code */ - RFI + RFI_TO_KERNEL #endif /*
@@ -164,6 +167,6 @@ _GLOBAL_TOC(kvmppc_entry_trampoline) ori r5, r5, MSR_EE mtsrr0 r7 mtsrr1 r6 - RFI + RFI_TO_KERNEL #include "book3s_segment.S"
arch/powerpc/kvm/book3s_segment.S +2 -2
@@ -156,7 +156,7 @@ no_dcbz32_on: PPC_LL r9, SVCPU_R9(r3) PPC_LL r3, (SVCPU_R3)(r3) - RFI + RFI_TO_GUEST kvmppc_handler_trampoline_enter_end:
@@ -407,5 +407,5 @@ END_FTR_SECTION_IFSET(CPU_FTR_HVMODE) cmpwi r12, BOOK3S_INTERRUPT_DOORBELL beqa BOOK3S_INTERRUPT_DOORBELL - RFI + RFI_TO_KERNEL kvmppc_handler_trampoline_exit_end:
arch/powerpc/lib/feature-fixups.c +41 -0
47 lines not on this page · raw message
arch/powerpc/platforms/powernv/setup.c +49 -0
62 lines not on this page · raw message
arch/powerpc/platforms/pseries/setup.c +35 -0
@@ -459,6 +459,39 @@ static void __init find_and_init_phbs(void)of_pci_check_probe_only (); } +static void pseries_setup_rfi_flush (void ) +{ +struct h_cpu_char_result result; +enum l1d_flush_type types; +bool enable; +long rc; + +/* Enable by default */ + enable = true; + + rc =plpar_get_cpu_characteristics (&result); +if (rc ==H_SUCCESS ) { + types =L1D_FLUSH_NONE ; + +if (result.character &H_CPU_CHAR_L1D_FLUSH_TRIG2 ) + types |=L1D_FLUSH_MTTRIG ; +if (result.character &H_CPU_CHAR_L1D_FLUSH_ORI30 ) + types |=L1D_FLUSH_ORI ; + +/* Use fallback if nothing set in hcall */ +if (types ==L1D_FLUSH_NONE ) + types =L1D_FLUSH_FALLBACK ; + +if (!(result.behaviour &H_CPU_BEHAV_L1D_FLUSH_PR )) + enable = false; + }else { +/* Default to fallback if case hcall is not available */ + types =L1D_FLUSH_FALLBACK ; + } + +setup_rfi_flush (types, enable); +} +static void __init pSeries_setup_arch (void ) {set_arch_panic_timeout (10 ,ARCH_PANIC_TIMEOUT );
@@ -476,6 +509,8 @@ static void __init pSeries_setup_arch(void)fwnmi_init (); +pseries_setup_rfi_flush (); +/* By default, only probe PCI (can be overridden by rtas_pci) */ pci_add_flags (PCI_PROBE_ONLY );
arch/x86/entry/entry_32.S +11 -0
@@ -244,6 +244,17 @@ ENTRY(__switch_to_asm) movl %ebx, PER_CPU_VAR(stack_canary)+stack_canary_offset #endif +#ifdef CONFIG_RETPOLINE + /* + * When switching from a shallower to a deeper call stack + * the RSB may either underflow or use entries populated + * with userspace addresses. On CPUs where those concerns + * exist, overwrite the RSB with entries which capture + * speculative execution to prevent attack. + */ + FILL_RETURN_BUFFER %ebx, RSB_CLEAR_LOOPS, X86_FEATURE_RSB_CTXSW +#endif + /* restore callee-saved registers */ popl %esi popl %edi
arch/x86/entry/entry_64.S +12 -1
@@ -487,6 +487,17 @@ ENTRY(__switch_to_asm) movq %rbx, PER_CPU_VAR(irq_stack_union)+stack_canary_offset #endif +#ifdef CONFIG_RETPOLINE + /* + * When switching from a shallower to a deeper call stack + * the RSB may either underflow or use entries populated + * with userspace addresses. On CPUs where those concerns + * exist, overwrite the RSB with entries which capture + * speculative execution to prevent attack. + */ + FILL_RETURN_BUFFER %r12, RSB_CLEAR_LOOPS, X86_FEATURE_RSB_CTXSW +#endif + /* restore callee-saved registers */ popq %r15 popq %r14
@@ -1247,7 +1258,7 @@ idtentry async_page_fault do_async_page_fault has_error_code=1 #endif #ifdef CONFIG_X86_MCE -idtentry machine_check has_error_code=0 paranoid=1 do_sym=*machine_check_vector(%rip) +idtentry machine_check do_mce has_error_code=0 paranoid=1 #endif /*
arch/x86/include/asm/cpufeatures.h +2 -1
@@ -206,11 +206,11 @@#define X86_FEATURE_RETPOLINE ( 7*32+12)/* Generic Retpoline mitigation for Spectre variant 2 */ #define X86_FEATURE_RETPOLINE_AMD ( 7*32+13)/* AMD Retpoline mitigation for Spectre variant 2 */ #define X86_FEATURE_INTEL_PPIN ( 7*32+14)/* Intel Processor Inventory Number */ -#define X86_FEATURE_INTEL_PT ( 7*32+15)/* Intel Processor Trace */ #define X86_FEATURE_AVX512_4VNNIW ( 7*32+16)/* AVX-512 Neural Network Instructions */ #define X86_FEATURE_AVX512_4FMAPS ( 7*32+17)/* AVX-512 Multiply Accumulation Single precision */ #define X86_FEATURE_MBA ( 7*32+18)/* Memory Bandwidth Allocation */ +#define X86_FEATURE_RSB_CTXSW ( 7*32+19)/* Fill RSB on context switches */ /* Virtualization flags: Linux defined, word 8 */ #define X86_FEATURE_TPR_SHADOW ( 8*32+ 0)/* Intel TPR Shadow */
@@ -245,6 +245,7 @@#define X86_FEATURE_AVX512IFMA ( 9*32+21)/* AVX-512 Integer Fused Multiply-Add instructions */ #define X86_FEATURE_CLFLUSHOPT ( 9*32+23)/* CLFLUSHOPT instruction */ #define X86_FEATURE_CLWB ( 9*32+24)/* CLWB instruction */ +#define X86_FEATURE_INTEL_PT ( 9*32+25)/* Intel Processor Trace */ #define X86_FEATURE_AVX512PF ( 9*32+26)/* AVX-512 Prefetch */ #define X86_FEATURE_AVX512ER ( 9*32+27)/* AVX-512 Exponential and Reciprocal */ #define X86_FEATURE_AVX512CD ( 9*32+28)/* AVX-512 Conflict Detection */
arch/x86/include/asm/mem_encrypt.h +2 -2
@@ -39,7 +39,7 @@ void __init sme_unmap_bootdata(char *real_mode_data);void __init sme_early_init (void ); -void __init sme_encrypt_kernel (void ); +void __init sme_encrypt_kernel (struct boot_params *bp);void __init sme_enable (struct boot_params *bp);/* Architecture __weak replacement functions */
@@ -61,7 +61,7 @@ static inline void __init sme_unmap_bootdata(char *real_mode_data) { }static inline void __init sme_early_init (void ) { } -static inline void __init sme_encrypt_kernel (void ) { } +static inline void __init sme_encrypt_kernel (struct boot_params *bp) { }static inline void __init sme_enable (struct boot_params *bp) { }#endif /* CONFIG_AMD_MEM_ENCRYPT */
arch/x86/include/asm/nospec-branch.h +12 -4
@@ -11,7 +11,7 @@* Fill the CPU return stack buffer. * * Each entry in the RSB, if used for a speculative 'ret', contains an -* infinite 'pause; jmp' loop to capture speculative execution. +* infinite 'pause; lfence; jmp' loop to capture speculative execution. * * This is required in various cases for retpoline and IBRS-based * mitigations for the Spectre variant 2 vulnerability. Sometimes to
@@ -38,11 +38,13 @@ call 772f; \ 773: /* speculation trap */ \ pause; \ + lfence; \ jmp 773b; \ 772: \ call 774f; \ 775: /* speculation trap */ \ pause; \ + lfence; \ jmp 775b; \ 774: \dec reg; \
@@ -73,6 +75,7 @@ call .Ldo_rop_\@ .Lspec_trap_\@:pause + lfence jmp .Lspec_trap_\@ .Ldo_rop_\@: mov \reg, (%_ASM_SP)
@@ -165,6 +168,7 @@" .align 16\n" \"901: call 903f;\n" \"902: pause;\n" \ +" lfence;\n" \" jmp 902b;\n" \" .align 16\n" \"903: addl $4, %%esp;\n" \
@@ -190,6 +194,9 @@ enum spectre_v2_mitigation { SPECTRE_V2_IBRS, }; +extern char __indirect_thunk_start[]; +extern char __indirect_thunk_end[]; +/* * On VMEXIT we must ensure that no RSB predictions learned in the guest * can be followed in the host, by overwriting the RSB completely. Both
@@ -199,16 +206,17 @@ enum spectre_v2_mitigation {static inline void vmexit_fill_RSB (void ) {#ifdef CONFIG_RETPOLINE -unsigned long loops =RSB_CLEAR_LOOPS /2 ; +unsigned long loops; asm volatile (ANNOTATE_NOSPEC_ALTERNATIVE ALTERNATIVE("jmp 910f", __stringify(__FILL_RETURN_BUFFER(%0, RSB_CLEAR_LOOPS, %1)), X86_FEATURE_RETPOLINE) "910:" - : "=&r" (loops), ASM_CALL_CONSTRAINT - : "r" (loops) : "memory" ); + : "=r" (loops), ASM_CALL_CONSTRAINT + : : "memory" );#endif } +#endif /* __ASSEMBLY__ */ #endif /* __NOSPEC_BRANCH_H__ */
arch/x86/include/asm/traps.h +1 -0
@@ -88,6 +88,7 @@ dotraplinkage void do_simd_coprocessor_error(struct pt_regs *, long);#ifdef CONFIG_X86_32 dotraplinkage void do_iret_error(struct pt_regs *, long);#endif +dotraplinkage void do_mce(struct pt_regs *, long);static inline int get_si_code (unsigned long condition) {
arch/x86/kernel/apic/vector.c +5 -2
@@ -369,8 +369,11 @@ static int x86_vector_alloc_irqs(struct irq_domain *domain, unsigned int virq, irq_data->hwirq = virq + i; err =assign_irq_vector_policy (virq + i, node, data, info, irq_data); -if (err) +if (err) { + irq_data->chip_data =NULL ; +free_apic_chip_data (data); goto error; + }/* * If the apic destination mode is physical, then the * effective affinity is restricted to a single target
@@ -383,7 +386,7 @@ static int x86_vector_alloc_irqs(struct irq_domain *domain, unsigned int virq,return 0 ; error: -x86_vector_free_irqs (domain, virq, i +1 ); +x86_vector_free_irqs (domain, virq, i);return err; }
arch/x86/kernel/cpu/bugs.c +36 -0
@@ -23,6 +23,7 @@#include <asm/alternative.h> #include <asm/pgtable.h> #include <asm/set_memory.h> +#include <asm/intel-family.h> static void __init spectre_v2_select_mitigation (void );
@@ -155,6 +156,23 @@ static enum spectre_v2_mitigation_cmd __init spectre_v2_parse_cmdline(void)return SPECTRE_V2_CMD_NONE ; } +/* Check for Skylake-like CPUs (for RSB handling) */ +static bool __init is_skylake_era (void ) +{ +if (boot_cpu_data.x86_vendor ==X86_VENDOR_INTEL && + boot_cpu_data.x86 ==6 ) { +switch (boot_cpu_data.x86_model) { +case INTEL_FAM6_SKYLAKE_MOBILE : +case INTEL_FAM6_SKYLAKE_DESKTOP : +case INTEL_FAM6_SKYLAKE_X : +case INTEL_FAM6_KABYLAKE_MOBILE : +case INTEL_FAM6_KABYLAKE_DESKTOP : +return true; + } + } +return false; +} +static void __init spectre_v2_select_mitigation (void ) {enum spectre_v2_mitigation_cmd cmd =spectre_v2_parse_cmdline ();
@@ -213,6 +231,24 @@ static void __init spectre_v2_select_mitigation(void) spectre_v2_enabled = mode;pr_info ("%s\n" , spectre_v2_strings[mode]); + +/* +* If neither SMEP or KPTI are available, there is a risk of +* hitting userspace addresses in the RSB after a context switch +* from a shallow call stack to a deeper one. To prevent this fill +* the entire RSB, even when using IBRS. +* +* Skylake era CPUs have a separate issue with *underflow* of the +* RSB, when they will predict 'ret' targets from the generic BTB. +* The proper mitigation for this is IBRS. If IBRS is not supported +* or deactivated in favour of retpolines the RSB fill on context +* switch is required. +*/ +if ((!boot_cpu_has (X86_FEATURE_PTI ) && + !boot_cpu_has (X86_FEATURE_SMEP )) ||is_skylake_era ()) { +setup_force_cpu_cap (X86_FEATURE_RSB_CTXSW ); +pr_info ("Filling RSB on context switch\n" ); + } }#undef pr_fmt
arch/x86/kernel/cpu/intel_rdt.c +4 -4
@@ -525,10 +525,6 @@ static void domain_remove_cpu(int cpu, struct rdt_resource *r)*/ if (static_branch_unlikely (&rdt_mon_enable_key))rmdir_mondata_subdir_allrdtgrp (r, d->id); -kfree (d->ctrl_val); -kfree (d->rmid_busy_llc); -kfree (d->mbm_total); -kfree (d->mbm_local);list_del (&d->list);if (is_mbm_enabled ())cancel_delayed_work (&d->mbm_over);
@@ -545,6 +541,10 @@ static void domain_remove_cpu(int cpu, struct rdt_resource *r)cancel_delayed_work (&d->cqm_limbo); } +kfree (d->ctrl_val); +kfree (d->rmid_busy_llc); +kfree (d->mbm_total); +kfree (d->mbm_local);kfree (d);return ; }
arch/x86/kernel/cpu/mcheck/mce.c +5 -0
@@ -1788,6 +1788,11 @@ static void unexpected_machine_check(struct pt_regs *regs, long error_code)void (*machine_check_vector)(struct pt_regs *,long error_code) = unexpected_machine_check; +dotraplinkage void do_mce(struct pt_regs *regs, long error_code) +{ +machine_check_vector (regs, error_code); +} +/* * Called for each booted CPU to set up machine checks. * Must be called with preempt off:
arch/x86/kernel/cpu/scattered.c +0 -1
@@ -21,7 +21,6 @@ struct cpuid_bit {static const struct cpuid_bit cpuid_bits[] = { {X86_FEATURE_APERFMPERF ,CPUID_ECX ,0 ,0x00000006 ,0 }, {X86_FEATURE_EPB ,CPUID_ECX ,3 ,0x00000006 ,0 }, - {X86_FEATURE_INTEL_PT ,CPUID_EBX ,25 ,0x00000007 ,0 }, {X86_FEATURE_AVX512_4VNNIW ,CPUID_EDX ,2 ,0x00000007 ,0 }, {X86_FEATURE_AVX512_4FMAPS ,CPUID_EDX ,3 ,0x00000007 ,0 }, {X86_FEATURE_CAT_L3 ,CPUID_EBX ,1 ,0x00000010 ,0 },
arch/x86/kernel/head64.c +2 -2
@@ -157,8 +157,8 @@ unsigned long __head __startup_64(unsigned long physaddr, p =fixup_pointer (&phys_base, physaddr); *p += load_delta -sme_get_me_mask (); -/* Encrypt the kernel (if SME is active) */ -sme_encrypt_kernel (); +/* Encrypt the kernel and related (if SME is active) */ +sme_encrypt_kernel (bp);/* * Return the SME encryption mask (if SME is active) to be used as a
arch/x86/kernel/idt.c +6 -6
@@ -56,7 +56,7 @@ struct idt_data {* Early traps running on the DEFAULT_STACK because the other interrupt * stacks work only after cpu_init(). */ -static const __initdata struct idt_data early_idts[] = { +static const __initconst struct idt_data early_idts[] = {INTG (X86_TRAP_DB , debug),SYSG (X86_TRAP_BP , int3), #ifdef CONFIG_X86_32
@@ -70,7 +70,7 @@ static const __initdata struct idt_data early_idts[] = {* the traps which use them are reinitialized with IST after cpu_init() has * set up TSS. */ -static const __initdata struct idt_data def_idts[] = { +static const __initconst struct idt_data def_idts[] = {INTG (X86_TRAP_DE , divide_error),INTG (X86_TRAP_NMI , nmi),INTG (X86_TRAP_BR , bounds),
@@ -108,7 +108,7 @@ static const __initdata struct idt_data def_idts[] = {/* * The APIC and SMP idt entries */ -static const __initdata struct idt_data apic_idts[] = { +static const __initconst struct idt_data apic_idts[] = { #ifdef CONFIG_SMPINTG (RESCHEDULE_VECTOR , reschedule_interrupt), INTG(CALL_FUNCTION_VECTOR, call_function_interrupt),
@@ -150,7 +150,7 @@ static const __initdata struct idt_data apic_idts[] = {* Early traps running on the DEFAULT_STACK because the other interrupt * stacks work only after cpu_init(). */ -static const __initdata struct idt_data early_pf_idts[] = { +static const __initconst struct idt_data early_pf_idts[] = {INTG (X86_TRAP_PF , page_fault), };
@@ -158,7 +158,7 @@ static const __initdata struct idt_data early_pf_idts[] = {* Override for the debug_idt. Same as the default, but with interrupt * stack set to DEFAULT_STACK (0). Required for NMI trap handling. */ -static const __initdata struct idt_data dbg_idts[] = { +static const __initconst struct idt_data dbg_idts[] = {INTG (X86_TRAP_DB , debug),INTG (X86_TRAP_BP , int3), };
@@ -180,7 +180,7 @@ gate_desc debug_idt_table[IDT_ENTRIES] __page_aligned_bss;* The exceptions which use Interrupt stacks. They are setup after * cpu_init() when the TSS has been initialized. */ -static const __initdata struct idt_data ist_idts[] = { +static const __initconst struct idt_data ist_idts[] = {ISTG (X86_TRAP_DB , debug,DEBUG_STACK ),ISTG (X86_TRAP_NMI , nmi,NMI_STACK ),SISTG (X86_TRAP_BP , int3,DEBUG_STACK ),
arch/x86/kernel/kprobes/opt.c +22 -1
@@ -40,6 +40,7 @@#include <asm/debugreg.h> #include <asm/set_memory.h> #include <asm/sections.h> +#include <asm/nospec-branch.h> #include "common.h"
@@ -205,7 +206,7 @@ static int copy_optimized_instructions(u8 *dest, u8 *src) }/* Check whether insn is indirect jump */ -static int insn_is_indirect_jump (struct insn *insn) +static int __insn_is_indirect_jump (struct insn *insn) { return ((insn->opcode.bytes[0] == 0xff && (X86_MODRM_REG(insn->modrm.value) & 6) == 4) || /* Jump */
@@ -239,6 +240,26 @@ static int insn_jump_into_range(struct insn *insn, unsigned long start, int len)return (start <= target && target <= start + len); } +static int insn_is_indirect_jump (struct insn *insn) +{ +int ret =__insn_is_indirect_jump (insn); + +#ifdef CONFIG_RETPOLINE +/* +* Jump to x86_indirect_thunk_* is treated as an indirect jump. +* Note that even with CONFIG_RETPOLINE=y, the kernel compiled with +* older gcc may use indirect jump. So we add this check instead of +* replace indirect-jump check. +*/ +if (!ret) + ret =insn_jump_into_range (insn, + (unsigned long )__indirect_thunk_start, + (unsigned long )__indirect_thunk_end - + (unsigned long )__indirect_thunk_start); +#endif +return ret; +} +/* Decode whole function to ensure any instructions don't jump into target */ static int can_optimize (unsigned long paddr) {
arch/x86/kernel/process.c +15 -10
@@ -380,19 +380,24 @@ void stop_this_cpu(void *dummy)disable_local_APIC ();mcheck_cpu_clear (this_cpu_ptr (&cpu_info)); +/* +* Use wbinvd on processors that support SME. This provides support +* for performing a successful kexec when going from SME inactive +* to SME active (or vice-versa). The cache must be cleared so that +* if there are entries with the same physical address, both with and +* without the encryption bit, they don't race each other when flushed +* and potentially end up with the wrong entry being committed to +* memory. +*/ +if (boot_cpu_has (X86_FEATURE_SME )) +native_wbinvd ();for (;;) {/* -* Use wbinvd followed by hlt to stop the processor. This -* provides support for kexec on a processor that supports -* SME. With kexec, going from SME inactive to SME active -* requires clearing cache entries so that addresses without -* the encryption bit set don't corrupt the same physical -* address that has the encryption bit set when caches are -* flushed. To achieve this a wbinvd is performed followed by -* a hlt. Even if the processor is not in the kexec/SME -* scenario this only adds a wbinvd to a halting processor. +* Use native_halt() so that memory contents don't change +* (stack usage and variables) after possibly issuing the +* native_wbinvd() above. */ - asmvolatile ("wbinvd; hlt" : : :"memory" ); +native_halt (); } }
arch/x86/kernel/setup.c +0 -8
@@ -376,14 +376,6 @@ static void __init reserve_initrd(void) !ramdisk_image || !ramdisk_size)return ;/* No initrd provided by bootloader */ -/* -* If SME is active, this memory will be marked encrypted by the -* kernel when it is accessed (including relocation). However, the -* ramdisk image was loaded decrypted by the bootloader, so make -* sure that it is encrypted before accessing it. -*/ -sme_early_encrypt (ramdisk_image, ramdisk_end - ramdisk_image); - initrd_start =0 ; mapped_size =memblock_mem_size (max_pfn_mapped);
arch/x86/kernel/tsc.c +2 -1
@@ -602,7 +602,6 @@ unsigned long native_calibrate_tsc(void)case INTEL_FAM6_KABYLAKE_DESKTOP : crystal_khz =24000 ;/* 24.0 MHz */ break ; -case INTEL_FAM6_SKYLAKE_X :case INTEL_FAM6_ATOM_DENVERTON : crystal_khz =25000 ;/* 25.0 MHz */ break ;
@@ -612,6 +611,8 @@ unsigned long native_calibrate_tsc(void) } } +if (crystal_khz ==0 ) +return 0 ;/* * TSC frequency determined by CPUID is a "hardware reported" * frequency and is the most accurate one so far we have. This
arch/x86/kernel/vmlinux.lds.S +6 -0
@@ -124,6 +124,12 @@ SECTIONS ASSERT(. - _entry_trampoline == PAGE_SIZE, "entry trampoline is too big"); #endif +#ifdef CONFIG_RETPOLINE + __indirect_thunk_start = .; + *(.text.__x86.indirect_thunk) + __indirect_thunk_end = .; +#endif + /* End of text section */ _etext = .; } :text = 0x9090
arch/x86/lib/retpoline.S +3 -2
@@ -9,7 +9,7 @@ #include <asm/nospec-branch.h> .macro THUNK reg - .section .text.__x86.indirect_thunk.\reg + .section .text.__x86.indirect_thunk ENTRY(__x86_indirect_thunk_\reg) CFI_STARTPROC
@@ -25,7 +25,8 @@ ENDPROC(__x86_indirect_thunk_\reg) * than one per register with the correct names. So we do it * the simple and nasty way... */ -#define EXPORT_THUNK(reg) EXPORT_SYMBOL(__x86_indirect_thunk_ ## reg) +#define __EXPORT_THUNK(sym) _ASM_NOKPROBE(sym); EXPORT_SYMBOL(sym) +#define EXPORT_THUNK(reg) __EXPORT_THUNK(__x86_indirect_thunk_ ## reg) #define GENERATE_THUNK(reg) THUNK reg ; EXPORT_THUNK(reg) GENERATE_THUNK(_ASM_AX)
arch/x86/mm/fault.c +4 -3
@@ -173,14 +173,15 @@ is_prefetch(struct pt_regs *regs, unsigned long error_code, unsigned long addr)* 6. T1 : reaches here, sees vma_pkey(vma)=5, when we really * faulted on a pte with its pkey=4. */ -static void fill_sig_info_pkey (int si_code,siginfo_t *info,u32 *pkey) +static void fill_sig_info_pkey (int si_signo,int si_code,siginfo_t *info, +u32 *pkey) {/* This is effectively an #ifdef */ if (!boot_cpu_has (X86_FEATURE_OSPKE ))return ;/* Fault not from Protection Keys: nothing to do */ -if (si_code !=SEGV_PKUERR ) +if ((si_code !=SEGV_PKUERR ) || (si_signo !=SIGSEGV ))return ;/* * force_sig_info_fault() is called from a number of
@@ -219,7 +220,7 @@ force_sig_info_fault(int si_signo, int si_code, unsigned long address, lsb =PAGE_SHIFT ; info.si_addr_lsb = lsb; -fill_sig_info_pkey (si_code, &info, pkey); +fill_sig_info_pkey (si_signo, si_code, &info, pkey);force_sig_info (si_signo, &info, tsk); }
arch/x86/mm/kasan_init_64.c +14 -10
@@ -21,10 +21,14 @@ extern struct range pfn_mapped[E820_MAX_ENTRIES];static p4d_t tmp_p4d_table[PTRS_PER_P4D ]__initdata __aligned(PAGE_SIZE) ; -static __init void *early_alloc (size_t size,int nid) +static __init void *early_alloc (size_t size,int nid,bool panic) { -return memblock_virt_alloc_try_nid_nopanic (size, size, -__pa (MAX_DMA_ADDRESS ),BOOTMEM_ALLOC_ACCESSIBLE , nid); +if (panic) +return memblock_virt_alloc_try_nid (size, size, +__pa (MAX_DMA_ADDRESS ),BOOTMEM_ALLOC_ACCESSIBLE , nid); +else +return memblock_virt_alloc_try_nid_nopanic (size, size, +__pa (MAX_DMA_ADDRESS ),BOOTMEM_ALLOC_ACCESSIBLE , nid); } static void __init kasan_populate_pmd(pmd_t *pmd, unsigned long addr,
@@ -38,14 +42,14 @@ static void __init kasan_populate_pmd(pmd_t *pmd, unsigned long addr,if (boot_cpu_has (X86_FEATURE_PSE ) && ((end - addr) ==PMD_SIZE ) &&IS_ALIGNED (addr,PMD_SIZE )) { - p =early_alloc (PMD_SIZE , nid); + p =early_alloc (PMD_SIZE , nid, false);if (p &&pmd_set_huge (pmd,__pa (p),PAGE_KERNEL ))return ;else if (p)memblock_free (__pa (p),PMD_SIZE ); } - p =early_alloc (PAGE_SIZE , nid); + p =early_alloc (PAGE_SIZE , nid, true);pmd_populate_kernel (&init_mm, pmd, p); }
@@ -57,7 +61,7 @@ static void __init kasan_populate_pmd(pmd_t *pmd, unsigned long addr,if (!pte_none (*pte))continue ; - p =early_alloc (PAGE_SIZE , nid); + p =early_alloc (PAGE_SIZE , nid, true); entry =pfn_pte (PFN_DOWN (__pa (p)),PAGE_KERNEL );set_pte_at (&init_mm, addr, pte, entry); }while (pte++, addr +=PAGE_SIZE , addr != end);
@@ -75,14 +79,14 @@ static void __init kasan_populate_pud(pud_t *pud, unsigned long addr,if (boot_cpu_has (X86_FEATURE_GBPAGES ) && ((end - addr) ==PUD_SIZE ) &&IS_ALIGNED (addr,PUD_SIZE )) { - p =early_alloc (PUD_SIZE , nid); + p =early_alloc (PUD_SIZE , nid, false);if (p &&pud_set_huge (pud,__pa (p),PAGE_KERNEL ))return ;else if (p)memblock_free (__pa (p),PUD_SIZE ); } - p =early_alloc (PAGE_SIZE , nid); + p =early_alloc (PAGE_SIZE , nid, true);pud_populate (&init_mm, pud, p); }
@@ -101,7 +105,7 @@ static void __init kasan_populate_p4d(p4d_t *p4d, unsigned long addr,unsigned long next;if (p4d_none (*p4d)) { -void *p =early_alloc (PAGE_SIZE , nid); +void *p =early_alloc (PAGE_SIZE , nid, true);p4d_populate (&init_mm, p4d, p); }
@@ -122,7 +126,7 @@ static void __init kasan_populate_pgd(pgd_t *pgd, unsigned long addr,unsigned long next;if (pgd_none (*pgd)) { - p =early_alloc (PAGE_SIZE , nid); + p =early_alloc (PAGE_SIZE , nid, true);pgd_populate (&init_mm, pgd, p); }
arch/x86/mm/mem_encrypt.c +260 -96
521 lines not on this page · raw message
arch/x86/mm/mem_encrypt_boot.S +44 -36
145 lines not on this page · raw message
drivers/ata/libata-core.c +1 -0
@@ -4439,6 +4439,7 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = {* https://bugzilla.kernel.org/show_bug.cgi?id=121671 */ { "LITEON CX1-JB*-HP", NULL, ATA_HORKAGE_MAX_SEC_1024 }, + { "LITEON EP1-*", NULL, ATA_HORKAGE_MAX_SEC_1024 },/* Devices we expect to fail diagnostics */
drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgf119.c +1 -0
@@ -174,6 +174,7 @@ gf119_sor = { .links = gf119_sor_dp_links, .power = g94_sor_dp_power, .pattern = gf119_sor_dp_pattern, + .drive = gf119_sor_dp_drive, .vcpi = gf119_sor_dp_vcpi, .audio = gf119_sor_dp_audio, .audio_sym = gf119_sor_dp_audio_sym,
drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c +2 -2
@@ -266,8 +266,8 @@ static const struct drm_connector_funcs vmw_legacy_connector_funcs = { .set_property = vmw_du_connector_set_property, .destroy = vmw_ldu_connector_destroy, .reset = vmw_du_connector_reset, - .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, - .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, + .atomic_duplicate_state = vmw_du_connector_duplicate_state, + .atomic_destroy_state = vmw_du_connector_destroy_state, .atomic_set_property = vmw_du_connector_atomic_set_property, .atomic_get_property = vmw_du_connector_atomic_get_property, };
drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c +2 -2
@@ -420,8 +420,8 @@ static const struct drm_connector_funcs vmw_sou_connector_funcs = { .set_property = vmw_du_connector_set_property, .destroy = vmw_sou_connector_destroy, .reset = vmw_du_connector_reset, - .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, - .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, + .atomic_duplicate_state = vmw_du_connector_duplicate_state, + .atomic_destroy_state = vmw_du_connector_destroy_state, .atomic_set_property = vmw_du_connector_atomic_set_property, .atomic_get_property = vmw_du_connector_atomic_get_property, };
drivers/i2c/i2c-core-smbus.c +7 -6
@@ -396,16 +396,17 @@ static s32 i2c_smbus_xfer_emulated(struct i2c_adapter *adapter, u16 addr,the underlying bus driver */ break ;case I2C_SMBUS_I2C_BLOCK_DATA : +if (data->block[0 ] >I2C_SMBUS_BLOCK_MAX ) { +dev_err (&adapter->dev,"Invalid block %s size %d\n" , + read_write ==I2C_SMBUS_READ ?"read" :"write" , + data->block[0 ]); +return -EINVAL ; + } +if (read_write ==I2C_SMBUS_READ ) { msg[1 ].len = data->block[0 ]; }else { msg[0 ].len = data->block[0 ] +1 ; -if (msg[0 ].len >I2C_SMBUS_BLOCK_MAX +1 ) { -dev_err (&adapter->dev, -"Invalid block write size %d\n" , - data->block[0 ]); -return -EINVAL ; - }for (i =1 ; i <= data->block[0 ]; i++) msgbuf0[i] = data->block[i]; }
drivers/infiniband/hw/hfi1/file_ops.c +2 -2
@@ -881,11 +881,11 @@ static int complete_subctxt(struct hfi1_filedata *fd) }if (ret) { -hfi1_rcd_put (fd->uctxt); - fd->uctxt =NULL ;spin_lock_irqsave (&fd->dd->uctxt_lock, flags);__clear_bit (fd->subctxt, fd->uctxt->in_use_ctxts);spin_unlock_irqrestore (&fd->dd->uctxt_lock, flags); +hfi1_rcd_put (fd->uctxt); + fd->uctxt =NULL ; }return ret;
drivers/infiniband/hw/mlx5/qp.c +3 -4
@@ -4303,12 +4303,11 @@ static void to_rdma_ah_attr(struct mlx5_ib_dev *ibdev,memset (ah_attr,0 ,sizeof (*ah_attr)); - ah_attr->type =rdma_ah_find_type (&ibdev->ib_dev, path->port); -rdma_ah_set_port_num (ah_attr, path->port); -if (rdma_ah_get_port_num (ah_attr) ==0 || -rdma_ah_get_port_num (ah_attr) >MLX5_CAP_GEN (dev, num_ports)) +if (!path->port || path->port >MLX5_CAP_GEN (dev, num_ports))return ; + ah_attr->type =rdma_ah_find_type (&ibdev->ib_dev, path->port); +rdma_ah_set_port_num (ah_attr, path->port);rdma_ah_set_sl (ah_attr, path->dci_cfi_prio_sl &0xf );
drivers/infiniband/ulp/isert/ib_isert.c +1 -0
@@ -741,6 +741,7 @@ isert_connect_error(struct rdma_cm_id *cma_id) {struct isert_conn *isert_conn = cma_id->qp->qp_context; +ib_drain_qp (isert_conn->qp);list_del_init (&isert_conn->node); isert_conn->cm_id =NULL ;isert_put_conn (isert_conn);
drivers/input/misc/twl4030-vibra.c +4 -2
@@ -178,12 +178,14 @@ static SIMPLE_DEV_PM_OPS(twl4030_vibra_pm_ops, twl4030_vibra_suspend, twl4030_vibra_resume);static bool twl4030_vibra_check_coexist (struct twl4030_vibra_data *pdata, -struct device_node *node) +struct device_node *parent) { +struct device_node *node; +if (pdata && pdata->coexist)return true; - node =of_find_node_by_name (node,"codec" ); + node =of_get_child_by_name (parent,"codec" );if (node) {of_node_put (node);return true;
drivers/input/misc/twl6040-vibra.c +1 -2
@@ -248,8 +248,7 @@ static int twl6040_vibra_probe(struct platform_device *pdev)int vddvibr_uV =0 ;int error; -of_node_get (twl6040_core_dev->of_node); - twl6040_core_node =of_find_node_by_name (twl6040_core_dev->of_node, + twl6040_core_node =of_get_child_by_name (twl6040_core_dev->of_node,"vibra" );if (!twl6040_core_node) {dev_err (&pdev->dev,"parent of node is missing?\n" );
drivers/input/mouse/alps.c +13 -10
@@ -1250,29 +1250,32 @@ static int alps_decode_ss4_v2(struct alps_fields *f,case SS4_PACKET_ID_MULTI :if (priv->flags &ALPS_BUTTONPAD ) {if (IS_SS4PLUS_DEV (priv->dev_id)) { - f->mt[0 ].x =SS4_PLUS_BTL_MF_X_V2 (p,0 ); - f->mt[1 ].x =SS4_PLUS_BTL_MF_X_V2 (p,1 ); + f->mt[2 ].x =SS4_PLUS_BTL_MF_X_V2 (p,0 ); + f->mt[3 ].x =SS4_PLUS_BTL_MF_X_V2 (p,1 ); + no_data_x =SS4_PLUS_MFPACKET_NO_AX_BL ; }else { f->mt[2 ].x =SS4_BTL_MF_X_V2 (p,0 ); f->mt[3 ].x =SS4_BTL_MF_X_V2 (p,1 ); + no_data_x =SS4_MFPACKET_NO_AX_BL ; } + no_data_y =SS4_MFPACKET_NO_AY_BL ; f->mt[2 ].y =SS4_BTL_MF_Y_V2 (p,0 ); f->mt[3 ].y =SS4_BTL_MF_Y_V2 (p,1 ); - no_data_x =SS4_MFPACKET_NO_AX_BL ; - no_data_y =SS4_MFPACKET_NO_AY_BL ; }else {if (IS_SS4PLUS_DEV (priv->dev_id)) { - f->mt[0 ].x =SS4_PLUS_STD_MF_X_V2 (p,0 ); - f->mt[1 ].x =SS4_PLUS_STD_MF_X_V2 (p,1 ); + f->mt[2 ].x =SS4_PLUS_STD_MF_X_V2 (p,0 ); + f->mt[3 ].x =SS4_PLUS_STD_MF_X_V2 (p,1 ); + no_data_x =SS4_PLUS_MFPACKET_NO_AX ; }else { - f->mt[0 ].x =SS4_STD_MF_X_V2 (p,0 ); - f->mt[1 ].x =SS4_STD_MF_X_V2 (p,1 ); + f->mt[2 ].x =SS4_STD_MF_X_V2 (p,0 ); + f->mt[3 ].x =SS4_STD_MF_X_V2 (p,1 ); + no_data_x =SS4_MFPACKET_NO_AX ; } + no_data_y =SS4_MFPACKET_NO_AY ; + f->mt[2 ].y =SS4_STD_MF_Y_V2 (p,0 ); f->mt[3 ].y =SS4_STD_MF_Y_V2 (p,1 ); - no_data_x =SS4_MFPACKET_NO_AX ; - no_data_y =SS4_MFPACKET_NO_AY ; } f->first_mp =0 ;
drivers/input/mouse/alps.h +6 -4
@@ -141,10 +141,12 @@ enum SS4_PACKET_ID {#define SS4_TS_Z_V2 (_b) (s8)(_b[4] & 0x7F) -#define SS4_MFPACKET_NO_AX 8160/* X-Coordinate value */ -#define SS4_MFPACKET_NO_AY 4080/* Y-Coordinate value */ -#define SS4_MFPACKET_NO_AX_BL 8176/* Buttonless X-Coordinate value */ -#define SS4_MFPACKET_NO_AY_BL 4088/* Buttonless Y-Coordinate value */ +#define SS4_MFPACKET_NO_AX 8160/* X-Coordinate value */ +#define SS4_MFPACKET_NO_AY 4080/* Y-Coordinate value */ +#define SS4_MFPACKET_NO_AX_BL 8176/* Buttonless X-Coord value */ +#define SS4_MFPACKET_NO_AY_BL 4088/* Buttonless Y-Coord value */ +#define SS4_PLUS_MFPACKET_NO_AX 4080/* SS4 PLUS, X */ +#define SS4_PLUS_MFPACKET_NO_AX_BL 4088/* Buttonless SS4 PLUS, X */ /* * enum V7_PACKET_ID - defines the packet type for V7
drivers/input/rmi4/rmi_driver.c +3 -1
@@ -230,8 +230,10 @@ static irqreturn_t rmi_irq_fn(int irq, void *dev_id)rmi_dbg (RMI_DEBUG_CORE , &rmi_dev->dev,"Failed to process interrupt request: %d\n" , ret); -if (count) +if (count) {kfree (attn_data.data); + attn_data.data =NULL ; + }if (!kfifo_is_empty (&drvdata->attn_fifo))return rmi_irq_fn (irq, dev_id);
drivers/input/touchscreen/88pm860x-ts.c +12 -4
@@ -126,7 +126,7 @@ static int pm860x_touch_dt_init(struct platform_device *pdev,int data, n, ret;if (!np)return -ENODEV ; - np =of_find_node_by_name (np,"touch" ); + np =of_get_child_by_name (np,"touch" );if (!np) {dev_err (&pdev->dev,"Can't find touch node\n" );return -EINVAL ;
@@ -144,13 +144,13 @@ static int pm860x_touch_dt_init(struct platform_device *pdev,if (data) { ret =pm860x_reg_write (i2c,PM8607_GPADC_MISC1 , data);if (ret <0 ) -return -EINVAL ; + goto err_put_node; }/* set tsi prebias time */ if (!of_property_read_u32 (np,"marvell,88pm860x-tsi-prebias" , &data)) { ret =pm860x_reg_write (i2c,PM8607_TSI_PREBIAS , data);if (ret <0 ) -return -EINVAL ; + goto err_put_node; }/* set prebias & prechg time of pen detect */ data =0 ;
@@ -161,10 +161,18 @@ static int pm860x_touch_dt_init(struct platform_device *pdev,if (data) { ret =pm860x_reg_write (i2c,PM8607_PD_PREBIAS , data);if (ret <0 ) -return -EINVAL ; + goto err_put_node; }of_property_read_u32 (np,"marvell,88pm860x-resistor-X" , res_x); + +of_node_put (np); +return 0 ; + +err_put_node: +of_node_put (np); + + return -EINVAL; }#else #define pm860x_touch_dt_init (x, y, z) (-1)
drivers/md/dm-crypt.c +15 -5
@@ -1954,10 +1954,15 @@ static int crypt_setkey(struct crypt_config *cc)/* Ignore extra keys (which are used for IV etc) */ subkey_size =crypt_subkey_size (cc); -if (crypt_integrity_hmac (cc)) +if (crypt_integrity_hmac (cc)) { +if (subkey_size < cc->key_mac_size) +return -EINVAL ; +crypt_copy_authenckey (cc->authenc_key, cc->key, subkey_size - cc->key_mac_size, cc->key_mac_size); + } +for (i =0 ; i < cc->tfms_count; i++) {if (crypt_integrity_hmac (cc)) r = crypto_aead_setkey(cc->cipher_tfm.tfms_aead[i],
@@ -2053,9 +2058,6 @@ static int crypt_set_keyring_key(struct crypt_config *cc, const char *key_string ret =crypt_setkey (cc); -/* wipe the kernel key payload copy in each case */ -memset (cc->key,0 , cc->key_size *sizeof (u8)); -if (!ret) {set_bit (DM_CRYPT_KEY_VALID , &cc->flags);kzfree (cc->key_string);
@@ -2523,6 +2525,10 @@ static int crypt_ctr_cipher(struct dm_target *ti, char *cipher_in, char *key) } } +/* wipe the kernel key payload copy */ +if (cc->key_string) +memset (cc->key,0 , cc->key_size *sizeof (u8)); +return ret; }
@@ -2740,6 +2746,7 @@ static int crypt_ctr(struct dm_target *ti, unsigned int argc, char **argv) cc->tag_pool_max_sectors * cc->on_disk_tag_size);if (!cc->tag_pool) { ti->error ="Cannot allocate integrity tags mempool" ; + ret = -ENOMEM ; goto bad; }
@@ -2961,6 +2968,9 @@ static int crypt_message(struct dm_target *ti, unsigned argc, char **argv)return ret;if (cc->iv_gen_ops && cc->iv_gen_ops->init) ret = cc->iv_gen_ops->init (cc); +/* wipe the kernel key payload copy */ +if (cc->key_string) +memset (cc->key,0 , cc->key_size *sizeof (u8));return ret; }if (argc ==2 && !strcasecmp (argv[1 ],"wipe" )) {
@@ -3007,7 +3017,7 @@ static void crypt_io_hints(struct dm_target *ti, struct queue_limits *limits)static struct target_type crypt_target = { .name ="crypt" , - .version = {1 ,18 ,0 }, + .version = {1 ,18 ,1 }, .module =THIS_MODULE , .ctr = crypt_ctr, .dtr = crypt_dtr,
drivers/md/dm-integrity.c +37 -12
98 lines not on this page · raw message
drivers/md/dm-thin-metadata.c +5 -1
@@ -80,10 +80,14 @@#define SECTOR_TO_BLOCK_SHIFT 3/* +* For btree insert: * 3 for btree insert + * 2 for btree lookup used within space map +* For btree remove: +* 2 for shadow spine + +* 4 for rebalance 3 child node */ -#define THIN_MAX_CONCURRENT_LOCKS 5 +#define THIN_MAX_CONCURRENT_LOCKS 6/* This should be plenty */ #define SPACE_MAP_ROOT_SIZE 128
drivers/md/persistent-data/dm-btree.c +2 -17
@@ -683,23 +683,8 @@ static int btree_split_beneath(struct shadow_spine *s, uint64_t key) pn->keys[1 ] = rn->keys[0 ];memcpy_disk (value_ptr (pn,1 ), &val,sizeof (__le64)); -/* -* rejig the spine. This is ugly, since it knows too -* much about the spine -*/ -if (s->nodes[0 ] != new_parent) { -unlock_block (s->info, s->nodes[0 ]); - s->nodes[0 ] = new_parent; - } -if (key <le64_to_cpu (rn->keys[0 ])) { -unlock_block (s->info, right); - s->nodes[1 ] = left; - }else { -unlock_block (s->info, left); - s->nodes[1 ] = right; - } - s->count =2 ; - +unlock_block (s->info, left); +unlock_block (s->info, right);return 0 ; }
drivers/mmc/host/sdhci-esdhc-imx.c +14 -0
@@ -687,6 +687,20 @@ static inline void esdhc_pltfm_set_clock(struct sdhci_host *host,return ; } +/* For i.MX53 eSDHCv3, SYSCTL.SDCLKFS may not be set to 0. */ +if (is_imx53_esdhc (imx_data)) { +/* +* According to the i.MX53 reference manual, if DLLCTRL[10] can +* be set, then the controller is eSDHCv3, else it is eSDHCv2. +*/ + val =readl (host->ioaddr +ESDHC_DLL_CTRL ); +writel (val |BIT (10 ), host->ioaddr +ESDHC_DLL_CTRL ); + temp =readl (host->ioaddr +ESDHC_DLL_CTRL ); +writel (val, host->ioaddr +ESDHC_DLL_CTRL ); +if (temp &BIT (10 )) + pre_div =2 ; + } + temp =sdhci_readl (host,ESDHC_SYSTEM_CONTROL ); temp &= ~(ESDHC_CLOCK_IPGEN |ESDHC_CLOCK_HCKEN |ESDHC_CLOCK_PEREN |ESDHC_CLOCK_MASK );
drivers/net/can/usb/peak_usb/pcan_usb_fd.c +11 -10
@@ -184,7 +184,7 @@ static int pcan_usb_fd_send_cmd(struct peak_usb_device *dev, void *cmd_tail)void *cmd_head =pcan_usb_fd_cmd_buffer (dev);int err =0 ;u8 *packet_ptr; -int i, n =1 , packet_len; +int packet_len;ptrdiff_t cmd_len;/* usb device unregistered? */
@@ -201,17 +201,13 @@ static int pcan_usb_fd_send_cmd(struct peak_usb_device *dev, void *cmd_tail) } packet_ptr = cmd_head; + packet_len = cmd_len;/* firmware is not able to re-assemble 512 bytes buffer in full-speed */ -if ((dev->udev->speed !=USB_SPEED_HIGH ) && - (cmd_len >PCAN_UFD_LOSPD_PKT_SIZE )) { - packet_len =PCAN_UFD_LOSPD_PKT_SIZE ; - n += cmd_len / packet_len; - }else { - packet_len = cmd_len; - } +if (unlikely (dev->udev->speed !=USB_SPEED_HIGH )) + packet_len =min (packet_len,PCAN_UFD_LOSPD_PKT_SIZE ); -for (i =0 ; i < n; i++) { + do { err = usb_bulk_msg(dev->udev, usb_sndbulkpipe(dev->udev, PCAN_USBPRO_EP_CMDOUT),
@@ -224,7 +220,12 @@ static int pcan_usb_fd_send_cmd(struct peak_usb_device *dev, void *cmd_tail) } packet_ptr += packet_len; - } + cmd_len -= packet_len; + +if (cmd_len <PCAN_UFD_LOSPD_PKT_SIZE ) + packet_len = cmd_len; + + }while (packet_len >0 );return err; }
drivers/net/ethernet/marvell/mvpp2.c +0 -9
@@ -4552,11 +4552,6 @@ static void mvpp2_port_mii_gmac_configure_mode(struct mvpp2_port *port)MVPP22_CTRL4_QSGMII_BYPASS_ACTIVE ; val &= ~MVPP22_CTRL4_EXT_PIN_GMII_SEL ;writel (val, port->base +MVPP22_GMAC_CTRL_4_REG ); - - val =readl (port->base +MVPP2_GMAC_CTRL_2_REG ); - val |=MVPP2_GMAC_DISABLE_PADDING ; - val &= ~MVPP2_GMAC_FLOW_CTRL_MASK ; -writel (val, port->base +MVPP2_GMAC_CTRL_2_REG ); }else if (phy_interface_mode_is_rgmii (port->phy_interface)) { val =readl (port->base +MVPP22_GMAC_CTRL_4_REG ); val |= MVPP22_CTRL4_EXT_PIN_GMII_SEL |
@@ -4564,10 +4559,6 @@ static void mvpp2_port_mii_gmac_configure_mode(struct mvpp2_port *port)MVPP22_CTRL4_QSGMII_BYPASS_ACTIVE ; val &= ~MVPP22_CTRL4_DP_CLK_SEL ;writel (val, port->base +MVPP22_GMAC_CTRL_4_REG ); - - val =readl (port->base +MVPP2_GMAC_CTRL_2_REG ); - val &= ~MVPP2_GMAC_DISABLE_PADDING ; -writel (val, port->base +MVPP2_GMAC_CTRL_2_REG ); }/* The port is connected to a copper PHY */
drivers/phy/phy-core.c +4 -0
@@ -395,6 +395,10 @@ static struct phy *_of_phy_get(struct device_node *np, int index)if (ret)return ERR_PTR (-ENODEV ); +/* This phy type handled by the usb-phy subsystem for now */ +if (of_device_is_compatible (args.np,"usb-nop-xceiv" )) +return ERR_PTR (-ENODEV ); +mutex_lock (&phy_provider_mutex); phy_provider =of_phy_provider_lookup (args.np);if (IS_ERR (phy_provider) || !try_module_get (phy_provider->owner)) {
drivers/scsi/libsas/sas_scsi_host.c +15 -2
@@ -486,15 +486,28 @@ static int sas_queue_reset(struct domain_device *dev, int reset_type,int sas_eh_abort_handler (struct scsi_cmnd *cmd) { -int res; +int res =TMF_RESP_FUNC_FAILED ;struct sas_task *task =TO_SAS_TASK (cmd);struct Scsi_Host *host = cmd->device->host; +struct domain_device *dev =cmd_to_domain_dev (cmd);struct sas_internal *i =to_sas_internal (host->transportt); +unsigned long flags;if (!i->dft->lldd_abort_task)return FAILED ; - res = i->dft->lldd_abort_task (task); +spin_lock_irqsave (host->host_lock, flags); +/* We cannot do async aborts for SATA devices */ +if (dev_is_sata (dev) && !host->host_eh_scheduled) { +spin_unlock_irqrestore (host->host_lock, flags); +return FAILED ; + } +spin_unlock_irqrestore (host->host_lock, flags); + +if (task) + res = i->dft->lldd_abort_task (task); +else +SAS_DPRINTK ("no task to abort\n" );if (res ==TMF_RESP_FUNC_SUCC || res ==TMF_RESP_FUNC_COMPLETE )return SUCCESS ;
fs/pipe.c +15 -2
@@ -1018,13 +1018,19 @@ const struct file_operations pipefifo_fops = {/* * Currently we rely on the pipe array holding a power-of-2 number -* of pages. +* of pages. Returns 0 on error. */ static inline unsigned int round_pipe_size (unsigned int size) {unsigned long nr_pages; +if (size < pipe_min_size) + size = pipe_min_size; + nr_pages = (size +PAGE_SIZE -1 ) >>PAGE_SHIFT ; +if (nr_pages ==0 ) +return 0 ; +return roundup_pow_of_two (nr_pages) <<PAGE_SHIFT ; }
@@ -1040,6 +1046,8 @@ static long pipe_set_size(struct pipe_inode_info *pipe, unsigned long arg)long ret =0 ; size =round_pipe_size (arg); +if (size ==0 ) +return -EINVAL ; nr_pages = size >>PAGE_SHIFT ;if (!nr_pages)
@@ -1123,13 +1131,18 @@ static long pipe_set_size(struct pipe_inode_info *pipe, unsigned long arg)int pipe_proc_fn (struct ctl_table *table,int write,void __user *buf,size_t *lenp,loff_t *ppos) { +unsigned int rounded_pipe_max_size;int ret; ret =proc_douintvec_minmax (table, write, buf, lenp, ppos);if (ret <0 || !write)return ret; - pipe_max_size =round_pipe_size (pipe_max_size); + rounded_pipe_max_size =round_pipe_size (pipe_max_size); +if (rounded_pipe_max_size ==0 ) +return -EINVAL ; + + pipe_max_size = rounded_pipe_max_size;return ret; }
fs/proc/array.c +5 -2
@@ -424,8 +424,11 @@ static int do_task_stat(struct seq_file *m, struct pid_namespace *ns,* safe because the task has stopped executing permanently. */ if (permitted && (task->flags &PF_DUMPCORE )) { - eip =KSTK_EIP (task); - esp =KSTK_ESP (task); +if (try_get_task_stack (task)) { + eip =KSTK_EIP (task); + esp =KSTK_ESP (task); +put_task_stack (task); + } } }
include/linux/delayacct.h +4 -4
@@ -71,7 +71,7 @@ extern void delayacct_init(void);extern void __delayacct_tsk_init (struct task_struct *);extern void __delayacct_tsk_exit (struct task_struct *);extern void __delayacct_blkio_start (void ); -extern void __delayacct_blkio_end (void ); +extern void __delayacct_blkio_end (struct task_struct *);extern int __delayacct_add_tsk (struct taskstats *,struct task_struct *);extern __u64 __delayacct_blkio_ticks (struct task_struct *);extern void __delayacct_freepages_start (void );
@@ -122,10 +122,10 @@ static inline void delayacct_blkio_start(void)__delayacct_blkio_start (); } -static inline void delayacct_blkio_end (void ) +static inline void delayacct_blkio_end (struct task_struct *p) {if (current->delays) -__delayacct_blkio_end (); +__delayacct_blkio_end (p);delayacct_clear_flag (DELAYACCT_PF_BLKIO ); }
@@ -169,7 +169,7 @@ static inline void delayacct_tsk_free(struct task_struct *tsk) {}static inline void delayacct_blkio_start (void ) {} -static inline void delayacct_blkio_end (void ) +static inline void delayacct_blkio_end (struct task_struct *p) {}static inline int delayacct_add_tsk (struct taskstats *d,struct task_struct *tsk)
include/linux/swapops.h +21 -0
@@ -124,6 +124,11 @@ static inline bool is_write_device_private_entry(swp_entry_t entry)return unlikely (swp_type (entry) ==SWP_DEVICE_WRITE ); } +static inline unsigned long device_private_entry_to_pfn (swp_entry_t entry) +{ +return swp_offset (entry); +} +static inline struct page *device_private_entry_to_page (swp_entry_t entry) {return pfn_to_page (swp_offset (entry));
@@ -154,6 +159,11 @@ static inline bool is_write_device_private_entry(swp_entry_t entry)return false; } +static inline unsigned long device_private_entry_to_pfn (swp_entry_t entry) +{ +return 0 ; +} +static inline struct page *device_private_entry_to_page (swp_entry_t entry) {return NULL ;
@@ -189,6 +199,11 @@ static inline int is_write_migration_entry(swp_entry_t entry)return unlikely (swp_type (entry) ==SWP_MIGRATION_WRITE ); } +static inline unsigned long migration_entry_to_pfn (swp_entry_t entry) +{ +return swp_offset (entry); +} +static inline struct page *migration_entry_to_page (swp_entry_t entry) {struct page *p =pfn_to_page (swp_offset (entry));
@@ -218,6 +233,12 @@ static inline int is_migration_entry(swp_entry_t swp) {return 0 ; } + +static inline unsigned long migration_entry_to_pfn (swp_entry_t entry) +{ +return 0 ; +} +static inline struct page *migration_entry_to_page (swp_entry_t entry) {return NULL ;
include/linux/vermagic.h +7 -1
@@ -31,11 +31,17 @@#else #define MODULE_RANDSTRUCT_PLUGIN #endif +#ifdef RETPOLINE +#define MODULE_VERMAGIC_RETPOLINE "retpoline " +#else +#define MODULE_VERMAGIC_RETPOLINE "" +#endif #define VERMAGIC_STRING \ UTS_RELEASE " " \ MODULE_VERMAGIC_SMP MODULE_VERMAGIC_PREEMPT \ MODULE_VERMAGIC_MODULE_UNLOAD MODULE_VERMAGIC_MODVERSIONS \ MODULE_ARCH_VERMAGIC \ - MODULE_RANDSTRUCT_PLUGIN + MODULE_RANDSTRUCT_PLUGIN \ + MODULE_VERMAGIC_RETPOLINE
kernel/delayacct.c +26 -16
1 line not on this page · raw message
kernel/futex.c +70 -16
86 lines not on this page · raw message
mm/page_vma_mapped.c +38 -25
63 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Part of the diff is not shown here. View the raw message.