Linux 4.14.102
Greg KH
maintainerI'm announcing the release of the 4.14.102 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/devicetree/bindings/eeprom/eeprom.txt | 5 - Makefile | 2 arch/alpha/include/asm/irq.h | 6 - arch/alpha/mm/fault.c | 2 arch/arm/boot/dts/da850-evm.dts | 2 arch/arm/boot/dts/da850-lcdk.dts | 2 arch/arm/boot/dts/kirkwood-dnskw.dtsi | 4 - arch/arm/include/asm/assembler.h | 11 ++ arch/arm/include/asm/cputype.h | 1 arch/arm/include/asm/proc-fns.h | 61 ++++++++++++--- arch/arm/include/asm/thread_info.h | 4 - arch/arm/include/asm/uaccess.h | 49 ++++++++++-- arch/arm/kernel/bugs.c | 4 - arch/arm/kernel/head-common.S | 6 - arch/arm/kernel/setup.c | 40 ++++++---- arch/arm/kernel/signal.c | 80 +++++++++++--------- arch/arm/kernel/smp.c | 31 +++++++ arch/arm/kernel/sys_oabi-compat.c | 8 +- arch/arm/lib/copy_from_user.S | 6 - arch/arm/lib/copy_to_user.S | 6 + arch/arm/lib/uaccess_with_memcpy.c | 3 arch/arm/mach-integrator/impd1.c | 6 + arch/arm/mm/proc-macros.S | 10 ++ arch/arm/mm/proc-v7-bugs.c | 17 ---- arch/arm/vfp/vfpmodule.c | 20 ++--- arch/x86/events/core.c | 14 +++ arch/x86/events/intel/core.c | 9 ++ arch/x86/events/perf_event.h | 16 +++- arch/x86/ia32/ia32_aout.c | 6 + arch/x86/include/asm/uv/bios.h | 8 +- arch/x86/kvm/vmx.c | 3 arch/x86/platform/uv/bios_uv.c | 23 +++++ block/blk-flush.c | 2 drivers/acpi/numa.c | 6 - drivers/cpufreq/cpufreq.c | 12 +-- drivers/firmware/efi/runtime-wrappers.c | 7 + drivers/gpu/drm/bridge/tc358767.c | 41 ++++++++-- drivers/gpu/drm/i915/i915_gem.c | 12 ++- drivers/gpu/drm/nouveau/nvkm/engine/falcon.c | 7 + drivers/gpu/drm/nouveau/nvkm/subdev/therm/base.c | 7 + drivers/input/misc/bma150.c | 9 +- drivers/input/mouse/elan_i2c_core.c | 2 drivers/input/mouse/elantech.c | 9 ++ drivers/md/dm-crypt.c | 2 drivers/md/dm-thin.c | 55 ++++++++++++- drivers/md/raid1.c | 29 ++++--- drivers/misc/eeprom/Kconfig | 2 drivers/misc/eeprom/at24.c | 1 drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 18 ++++ drivers/nvme/host/pci.c | 10 +- drivers/pinctrl/qcom/pinctrl-msm.c | 23 ++++- fs/cifs/file.c | 8 ++ fs/cifs/smb2file.c | 4 + fs/proc/task_mmu.c | 22 +++-- include/linux/perf_event.h | 5 + include/linux/skbuff.h | 16 ++++ include/trace/events/sched.h | 12 ++- include/uapi/linux/if_ether.h | 7 + kernel/events/core.c | 16 ++++ kernel/events/ring_buffer.c | 2 kernel/futex.c | 69 +++++++++++++++-- kernel/signal.c | 7 + kernel/trace/trace_uprobe.c | 9 ++ net/core/skbuff.c | 63 ++++++++++++--- net/sched/sch_tbf.c | 10 -- sound/pci/hda/patch_conexant.c | 1 sound/usb/pcm.c | 9 ++ tools/perf/tests/shell/lib/probe_vfs_getname.sh | 3 68 files changed, 747 insertions(+), 235 deletions(-)
Adrian Bunk (2):
dt-bindings: eeprom: at24: add "atmel,24c2048" compatible string
eeprom: at24: add support for 24c2048
Andreas Ziegler (1):
tracing/uprobes: Fix output for multiple string arguments
Arnaldo Carvalho de Melo (1):
perf test shell: Use a fallback to get the pathname in vfs_getname
Borislav Petkov (1):
x86/a.out: Clear the dump structure initially
Chao Fan (1):
ACPI: NUMA: Use correct type for printing addresses on i386-PAE
Christian Lamparter (1):
pinctrl: msm: fix gpio-hog related boot issues
Daniel Axtens (2):
net: create skb_gso_validate_mac_len()
bnx2x: disable GSO where gso_size is too big for hardware
Dmitry Torokhov (1):
Revert "Input: elan_i2c - add ACPI ID for touchpad in ASUS Aspire F5-573G"
Eric W. Biederman (1):
signal: Restore the stop PTRACE_EVENT_EXIT
Greg Kroah-Hartman (1):
Linux 4.14.102
Hauke Mehrtens (2):
uapi/if_ether.h: prevent redefinition of struct ethhdr uapi/if_ether.h: move __UAPI_DEF_ETHHDR libc define
Hedi Berriche (1):
x86/platform/UV: Use efi_runtime_lock to serialise BIOS calls
Ilia Mirkin (1):
drm/nouveau/falcon: avoid touching registers if engine is off
Ingo Molnar (1):
perf/core: Fix impossible ring-buffer sizes warning
Jianchao Wang (1):
blk-mq: fix a hung issue when fsync
Jiri Olsa (1):
perf/x86: Add check_period PMU callback
Jonathan Bakker (1):
Input: bma150 - register input device after setting private data
Joonas Lahtinen (1):
drm/i915: Prevent a race during I915_GEM_MMAP ioctl with WC set
Julien Thierry (10):
ARM: 8789/1: signal: copy registers using __copy_to_user()
ARM: 8790/1: signal: always use __copy_to_user to save iwmmxt context
ARM: 8791/1: vfp: use __copy_to_user() when saving VFP state
ARM: 8792/1: oabi-compat: copy oabi events using __copy_to_user()
ARM: 8793/1: signal: replace __put_user_error with __put_user
ARM: 8794/1: uaccess: Prevent speculative use of the current addr_limit
ARM: 8795/1: spectre-v1.1: use put_user() for __put_user()
ARM: 8796/1: spectre-v1,v1.1: provide helpers for address sanitization
ARM: 8797/1: spectre-v1.1: harden __copy_to_user
ARM: 8810/1: vfp: Fix wrong assignement to ufp_exc
Jurica Vukadin (1):
ALSA: hda - Add quirk for HP EliteBook 840 G5
Linus Walleij (1):
ARM: dts: kirkwood: Fix polarity of GPIO fan lines
Liviu Dudau (1):
nvme-pci: use the same attributes when freeing host_mem_desc_bufs.
Manuel Reinhardt (1):
ALSA: usb-audio: Fix implicit fb endpoint setup by quirk
Matti Kurkela (1):
Input: elantech - enable 3rd button support on Fujitsu CELSIUS H780
Mauro Ciancio (1):
Input: elan_i2c - add ACPI ID for touchpad in Lenovo V330-15ISK
Meelis Roos (1):
alpha: Fix Eiger NR_IRQS to 128
Mikulas Patocka (1):
dm crypt: don't overallocate the integrity tag space
Nate Dailey (1):
md/raid1: don't clear bitmap bits on interrupted recovery.
Nicholas Mc Guire (1):
gpio: pl061: handle failed allocations
Nikos Tsironis (1):
dm thin: fix bug where bio that overwrites thin block ignores FUA
Pavankumar Kondeti (1):
sched, trace: Fix prev_state output in sched_switch tracepoint
Peter Ujfalusi (2):
ARM: dts: da850-evm: Correct the sound card name
ARM: dts: da850-lcdk: Correct the sound card name
Ross Lagerwall (1):
cifs: Limit memory used by lock request calls to a page
Russell King (7):
ARM: make lookup_processor_type() non-__init
ARM: split out processor lookup
ARM: clean up per-processor check_bugs method call
ARM: add PROC_VTABLE and PROC_TABLE macros
ARM: spectre-v2: per-CPU vtables to work around big.Little systems
ARM: ensure that processor vtables is not lost after boot
ARM: fix the cockup in the previous patch
Sandeep Patil (1):
mm: proc: smaps_rollup: fix pss_locked calculation
Sergei Trofimovich (1):
alpha: fix page fault handling for r16-r18 targets
Sudeep Holla (1):
cpufreq: check if policy is inactive early in __cpufreq_get()
Takashi Iwai (1):
drm/nouveau: Don't disable polling in fallback mode
Thomas Gleixner (1):
futex: Cure exit race
Tomi Valkeinen (5):
drm/bridge: tc358767: add defines for DP1_SRCCTRL & PHY_2LANE drm/bridge: tc358767: fix single lane configuration drm/bridge: tc358767: fix initial DP0/1_SRCCTRL value drm/bridge: tc358767: reject modes which require too much BW drm/bridge: tc358767: fix output H/V syncs
Xiaoyao Li (1):
kvm: vmx: Fix entry number check for add_atomic_switch_msr()
Greg KH
maintainerDocumentation/devicetree/bindings/eeprom/eeprom.txt +3 -2
@@ -6,7 +6,8 @@ Required properties: "atmel,24c00", "atmel,24c01", "atmel,24c02", "atmel,24c04", "atmel,24c08", "atmel,24c16", "atmel,24c32", "atmel,24c64", - "atmel,24c128", "atmel,24c256", "atmel,24c512", "atmel,24c1024" + "atmel,24c128", "atmel,24c256", "atmel,24c512", "atmel,24c1024", + "atmel,24c2048" "catalyst,24c32"
@@ -23,7 +24,7 @@ Required properties: device with <type> and manufacturer "atmel" should be used. Possible types are: "24c00", "24c01", "24c02", "24c04", "24c08", "24c16", "24c32", "24c64", - "24c128", "24c256", "24c512", "24c1024", "spd" + "24c128", "24c256", "24c512", "24c1024", "24c2048", "spd" - reg : the I2C address of the EEPROM
Makefile +1 -1
@@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 VERSION = 4 PATCHLEVEL = 14 -SUBLEVEL = 101 +SUBLEVEL = 102 EXTRAVERSION = NAME = Petit Gorille
arch/alpha/include/asm/irq.h +3 -3
@@ -56,15 +56,15 @@#elif defined(CONFIG_ALPHA_DP264 ) || \ defined(CONFIG_ALPHA_LYNX ) || \ - defined(CONFIG_ALPHA_SHARK ) || \ - defined(CONFIG_ALPHA_EIGER ) + defined(CONFIG_ALPHA_SHARK )# define NR_IRQS 64#elif defined(CONFIG_ALPHA_TITAN )#define NR_IRQS 80#elif defined(CONFIG_ALPHA_RAWHIDE ) || \ - defined(CONFIG_ALPHA_TAKARA ) + defined(CONFIG_ALPHA_TAKARA ) || \ + defined(CONFIG_ALPHA_EIGER )# define NR_IRQS 128#elif defined(CONFIG_ALPHA_WILDFIRE )
arch/alpha/mm/fault.c +1 -1
@@ -78,7 +78,7 @@ __load_new_mm_context(struct mm_struct *next_mm)/* Macro for exception fixup code to access integer registers. */ #define dpf_reg (r) \ (((unsigned long *)regs)[(r) <= 8 ? (r) : (r) <= 15 ? (r)-16 : \ - (r) <= 18 ? (r)+8 : (r)-10]) + (r) <= 18 ? (r)+10 : (r)-10]) asmlinkage void do_page_fault(unsigned long address, unsigned long mmcsr,
arch/arm/boot/dts/da850-evm.dts +1 -1
@@ -169,7 +169,7 @@ sound { compatible = "simple-audio-card"; - simple-audio-card,name = "DA850/OMAP-L138 EVM"; + simple-audio-card,name = "DA850-OMAPL138 EVM"; simple-audio-card,widgets = "Line", "Line In", "Line", "Line Out";
arch/arm/boot/dts/da850-lcdk.dts +1 -1
@@ -28,7 +28,7 @@ sound { compatible = "simple-audio-card"; - simple-audio-card,name = "DA850/OMAP-L138 LCDK"; + simple-audio-card,name = "DA850-OMAPL138 LCDK"; simple-audio-card,widgets = "Line", "Line In", "Line", "Line Out";
arch/arm/boot/dts/kirkwood-dnskw.dtsi +2 -2
@@ -36,8 +36,8 @@ compatible = "gpio-fan"; pinctrl-0 = <&pmx_fan_high_speed &pmx_fan_low_speed>; pinctrl-names = "default"; - gpios = <&gpio1 14 GPIO_ACTIVE_LOW - &gpio1 13 GPIO_ACTIVE_LOW>; + gpios = <&gpio1 14 GPIO_ACTIVE_HIGH + &gpio1 13 GPIO_ACTIVE_HIGH>; gpio-fan,speed-map = <0 0 3000 1 6000 2>;
arch/arm/include/asm/assembler.h +11 -0
@@ -467,6 +467,17 @@ THUMB( orr \reg , \reg , #PSR_T_BIT )#endif .endm + .macro uaccess_mask_range_ptr, addr:req, size:req, limit:req, tmp:req +#ifdef CONFIG_CPU_SPECTRE + sub \tmp, \limit, #1 + subs \tmp, \tmp, \addr @ tmp = limit - 1 - addr + addhs \tmp, \tmp, #1 @ if (tmp >= 0) { + subhss \tmp, \tmp, \size @ tmp = limit - (addr + size) } + movlo \addr, #0 @ if (tmp < 0) addr = NULL + csdb +#endif + .endm + .macro uaccess_disable, tmp, isb=1 #ifdef CONFIG_CPU_SW_DOMAIN_PAN/*
arch/arm/include/asm/cputype.h +1 -0
@@ -107,6 +107,7 @@#define ARM_CPU_PART_SCORPION 0x510002d0extern unsigned int processor_id; +struct proc_info_list *lookup_processor (u32 midr);#ifdef CONFIG_CPU_CP15 #define read_cpuid (reg) \
arch/arm/include/asm/proc-fns.h +49 -12
82 lines not on this page · raw message
arch/arm/include/asm/thread_info.h +2 -2
@@ -124,8 +124,8 @@ extern void vfp_flush_hwstate(struct thread_info *);struct user_vfp ;struct user_vfp_exc ; -extern int vfp_preserve_user_clear_hwstate (struct user_vfp __user *, -struct user_vfp_exc __user *); +extern int vfp_preserve_user_clear_hwstate (struct user_vfp *, +struct user_vfp_exc *);extern int vfp_restore_user_hwstate (struct user_vfp *,struct user_vfp_exc *);#endif
arch/arm/include/asm/uaccess.h +43 -6
79 lines not on this page · raw message
arch/arm/kernel/bugs.c +2 -2
@@ -6,8 +6,8 @@void check_other_bugs (void ) {#ifdef MULTI_CPU -if (processor.check_bugs) - processor.check_bugs (); +if (cpu_check_bugs) +cpu_check_bugs ();#endif }
arch/arm/kernel/head-common.S +3 -3
@@ -122,6 +122,9 @@ __mmap_switched_data: .long init_thread_union + THREAD_START_SP @ sp .size __mmap_switched_data, . - __mmap_switched_data + __FINIT + .text + /* * This provides a C-API version of __lookup_processor_type */
@@ -133,9 +136,6 @@ ENTRY(lookup_processor_type) ldmfd sp!, {r4 - r6, r9, pc} ENDPROC(lookup_processor_type) - __FINIT - .text - /* * Read processor ID register (CP#15, CR0), and look up in the linker-built * supported processor list. Note that we can't use the absolute addresses
arch/arm/kernel/setup.c +25 -15
@@ -115,6 +115,11 @@ EXPORT_SYMBOL(elf_hwcap2);#ifdef MULTI_CPU struct processor processor__ro_after_init ; +#if defined(CONFIG_BIG_LITTLE ) && defined(CONFIG_HARDEN_BRANCH_PREDICTOR ) +struct processor *cpu_vtable[NR_CPUS ] = { + [0 ] = &processor, +}; +#endif #endif #ifdef MULTI_TLB struct cpu_tlb_fns cpu_tlb__ro_after_init ;
@@ -667,28 +672,33 @@ static void __init smp_build_mpidr_hash(void) }#endif -static void __init setup_processor (void ) +/* +* locate processor in the list of supported processor types. The linker +* builds this table for us from the entries in arch/arm/mm/proc-*.S +*/ +struct proc_info_list *lookup_processor (u32 midr) { -struct proc_info_list *list; +struct proc_info_list *list =lookup_processor_type (midr); -/* -* locate processor in the list of supported processor -* types. The linker builds this table for us from the -* entries in arch/arm/mm/proc-*.S -*/ - list =lookup_processor_type (read_cpuid_id ());if (!list) { -pr_err ("CPU configuration botched (ID %08x), unable to continue.\n" , -read_cpuid_id ()); -while (1 ); +pr_err ("CPU%u: configuration botched (ID %08x), CPU halted\n" , +smp_processor_id (), midr); +while (1 ) +/* can't use cpu_relax() here as it may require MMU setup */ ; } +return list; +} + +static void __init setup_processor (void ) +{ +unsigned int midr =read_cpuid_id (); +struct proc_info_list *list =lookup_processor (midr); + cpu_name = list->cpu_name; __cpu_architecture =__get_cpu_architecture (); -#ifdef MULTI_CPU - processor = *list->proc; -#endif +init_proc_vtable (list->proc);#ifdef MULTI_TLB cpu_tlb = *list->tlb;#endif
@@ -700,7 +710,7 @@ static void __init setup_processor(void)#endif pr_info ("CPU: %s [%08x] revision %d (ARMv%s), cr=%08lx\n" , - cpu_name,read_cpuid_id (),read_cpuid_id () &15 , + list->cpu_name, midr, midr &15 , proc_arch[cpu_architecture ()],get_cr ()); snprintf(init_utsname()->machine, __NEW_UTS_LEN + 1, "%s%c",
arch/arm/kernel/signal.c +44 -36
131 lines not on this page · raw message
arch/arm/kernel/smp.c +31 -0
@@ -42,6 +42,7 @@#include <asm/mmu_context.h> #include <asm/pgtable.h> #include <asm/pgalloc.h> +#include <asm/procinfo.h> #include <asm/processor.h> #include <asm/sections.h> #include <asm/tlbflush.h>
@@ -102,6 +103,30 @@ static unsigned long get_arch_pgd(pgd_t *pgd)#endif } +#if defined(CONFIG_BIG_LITTLE ) && defined(CONFIG_HARDEN_BRANCH_PREDICTOR ) +static int secondary_biglittle_prepare (unsigned int cpu) +{ +if (!cpu_vtable[cpu]) + cpu_vtable[cpu] =kzalloc (sizeof (*cpu_vtable[cpu]),GFP_KERNEL ); + +return cpu_vtable[cpu] ?0 : -ENOMEM ; +} + +static void secondary_biglittle_init (void ) +{ +init_proc_vtable (lookup_processor (read_cpuid_id ())->proc); +} +#else +static int secondary_biglittle_prepare (unsigned int cpu) +{ +return 0 ; +} + +static void secondary_biglittle_init (void ) +{ +} +#endif +int __cpu_up (unsigned int cpu,struct task_struct *idle) {int ret;
@@ -109,6 +134,10 @@ int __cpu_up(unsigned int cpu, struct task_struct *idle)if (!smp_ops.smp_boot_secondary)return -ENOSYS ; + ret =secondary_biglittle_prepare (cpu); +if (ret) +return ret; +/* * We need to tell the secondary core where to find * its stack and the page tables.
@@ -360,6 +389,8 @@ asmlinkage void secondary_start_kernel(void)struct mm_struct *mm = &init_mm;unsigned int cpu; +secondary_biglittle_init (); +/* * The identity mapping is uncached (strongly ordered), so * switch away from it before attempting any exclusive accesses.
arch/arm/kernel/sys_oabi-compat.c +6 -2
@@ -277,6 +277,7 @@ asmlinkage long sys_oabi_epoll_wait(int epfd, int maxevents, int timeout) {struct epoll_event *kbuf; +struct oabi_epoll_event e;mm_segment_t fs;long ret, err, i;
@@ -295,8 +296,11 @@ asmlinkage long sys_oabi_epoll_wait(int epfd,set_fs (fs); err =0 ;for (i =0 ; i < ret; i++) { -__put_user_error (kbuf[i].events, &events->events, err); -__put_user_error (kbuf[i].data, &events->data, err); + e.events = kbuf[i].events; + e.data = kbuf[i].data; + err =__copy_to_user (events, &e,sizeof (e)); +if (err) +break ; events++; }kfree (kbuf);
arch/arm/lib/copy_from_user.S +1 -5
@@ -93,11 +93,7 @@ ENTRY(arm_copy_from_user) #ifdef CONFIG_CPU_SPECTRE get_thread_info r3 ldr r3, [r3, #TI_ADDR_LIMIT] - adds ip, r1, r2 @ ip=addr+size - sub r3, r3, #1 @ addr_limit - 1 - cmpcc ip, r3 @ if (addr+size > addr_limit - 1) - movcs r1, #0 @ addr = NULL - csdb + uaccess_mask_range_ptr r1, r2, r3, ip #endif #include "copy_template.S"
arch/arm/lib/copy_to_user.S +5 -1
@@ -94,6 +94,11 @@ ENTRY(__copy_to_user_std) WEAK(arm_copy_to_user) +#ifdef CONFIG_CPU_SPECTRE + get_thread_info r3 + ldr r3, [r3, #TI_ADDR_LIMIT] + uaccess_mask_range_ptr r0, r2, r3, ip +#endif #include "copy_template.S"
@@ -108,4 +113,3 @@ ENDPROC(__copy_to_user_std) rsb r0, r0, r2 copy_abort_end .popsection -
arch/arm/lib/uaccess_with_memcpy.c +2 -1
@@ -152,7 +152,8 @@ arm_copy_to_user(void __user *to, const void *from, unsigned long n) n =__copy_to_user_std (to, from, n);uaccess_restore (ua_flags); }else { - n =__copy_to_user_memcpy (to, from, n); + n =__copy_to_user_memcpy (uaccess_mask_range_ptr (to, n), + from, n); }return n; }
arch/arm/mach-integrator/impd1.c +5 -1
@@ -393,7 +393,11 @@ static int __ref impd1_probe(struct lm_device *dev)sizeof (*lookup) +3 *sizeof (struct gpiod_lookup ), GFP_KERNEL); chipname =devm_kstrdup (&dev->dev, devname,GFP_KERNEL ); - mmciname =kasprintf (GFP_KERNEL ,"lm%x:00700" , dev->id); + mmciname =devm_kasprintf (&dev->dev,GFP_KERNEL , +"lm%x:00700" , dev->id); +if (!lookup || !chipname || !mmciname) +return -ENOMEM ; + lookup->dev_id = mmciname;/* * Offsets on GPIO block 1:
arch/arm/mm/proc-macros.S +10 -0
@@ -274,6 +274,13 @@ .endm .macro define_processor_functions name:req, dabort:req, pabort:req, nommu=0, suspend=0, bugs=0 +/* + * If we are building for big.Little with branch predictor hardening, + * we need the processor function tables to remain available after boot. + */ +#if defined(CONFIG_BIG_LITTLE) && defined(CONFIG_HARDEN_BRANCH_PREDICTOR) + .section ".rodata" +#endif .type \name\()_processor_functions, #object .align 2 ENTRY(\name\()_processor_functions)
@@ -309,6 +316,9 @@ ENTRY(\name\()_processor_functions) .endif .size \name\()_processor_functions, . - \name\()_processor_functions +#if defined(CONFIG_BIG_LITTLE) && defined(CONFIG_HARDEN_BRANCH_PREDICTOR) + .previous +#endif .endm .macro define_cache_functions name:req
arch/arm/mm/proc-v7-bugs.c +2 -15
@@ -52,8 +52,6 @@ static void cpu_v7_spectre_init(void)case ARM_CPU_PART_CORTEX_A17 :case ARM_CPU_PART_CORTEX_A73 :case ARM_CPU_PART_CORTEX_A75 : -if (processor.switch_mm != cpu_v7_bpiall_switch_mm) - goto bl_error;per_cpu (harden_branch_predictor_fn, cpu) = harden_branch_predictor_bpiall; spectre_v2_method ="BPIALL" ;
@@ -61,8 +59,6 @@ static void cpu_v7_spectre_init(void)case ARM_CPU_PART_CORTEX_A15 :case ARM_CPU_PART_BRAHMA_B15 : -if (processor.switch_mm != cpu_v7_iciallu_switch_mm) - goto bl_error;per_cpu (harden_branch_predictor_fn, cpu) = harden_branch_predictor_iciallu; spectre_v2_method ="ICIALLU" ;
@@ -88,11 +84,9 @@ static void cpu_v7_spectre_init(void) ARM_SMCCC_ARCH_WORKAROUND_1, &res);if ((int )res.a0 !=0 )break ; -if (processor.switch_mm != cpu_v7_hvc_switch_mm && cpu) - goto bl_error;per_cpu (harden_branch_predictor_fn, cpu) = call_hvc_arch_workaround_1; - processor.switch_mm = cpu_v7_hvc_switch_mm; + cpu_do_switch_mm = cpu_v7_hvc_switch_mm; spectre_v2_method ="hypervisor" ;break ;
@@ -101,11 +95,9 @@ static void cpu_v7_spectre_init(void) ARM_SMCCC_ARCH_WORKAROUND_1, &res);if ((int )res.a0 !=0 )break ; -if (processor.switch_mm != cpu_v7_smc_switch_mm && cpu) - goto bl_error;per_cpu (harden_branch_predictor_fn, cpu) = call_smc_arch_workaround_1; - processor.switch_mm = cpu_v7_smc_switch_mm; + cpu_do_switch_mm = cpu_v7_smc_switch_mm; spectre_v2_method ="firmware" ;break ;
@@ -119,11 +111,6 @@ static void cpu_v7_spectre_init(void)if (spectre_v2_method)pr_info ("CPU%u: Spectre v2: using %s workaround\n" , smp_processor_id(), spectre_v2_method); -return ; - -bl_error: -pr_err ("CPU%u: Spectre v2: incorrect context switching function, system vulnerable\n" , - cpu); }#else static void cpu_v7_spectre_init (void )
arch/arm/vfp/vfpmodule.c +8 -12
@@ -554,12 +554,11 @@ void vfp_flush_hwstate(struct thread_info *thread)* Save the current VFP state into the provided structures and prepare * for entry into a new function (signal handler). */ -int vfp_preserve_user_clear_hwstate (struct user_vfp __user *ufp, -struct user_vfp_exc __user *ufp_exc) +int vfp_preserve_user_clear_hwstate (struct user_vfp *ufp, +struct user_vfp_exc *ufp_exc) {struct thread_info *thread =current_thread_info ();struct vfp_hard_struct *hwstate = &thread->vfpstate.hard; -int err =0 ;/* Ensure that the saved hwstate is up-to-date. */ vfp_sync_hwstate (thread);
@@ -568,22 +567,19 @@ int vfp_preserve_user_clear_hwstate(struct user_vfp __user *ufp,* Copy the floating point registers. There can be unused * registers see asm/hwcap.h for details. */ - err |=__copy_to_user (&ufp->fpregs, &hwstate->fpregs, -sizeof (hwstate->fpregs)); +memcpy (&ufp->fpregs, &hwstate->fpregs,sizeof (hwstate->fpregs)); +/* * Copy the status and control register. */ -__put_user_error (hwstate->fpscr, &ufp->fpscr, err); + ufp->fpscr = hwstate->fpscr;/* * Copy the exception registers. */ -__put_user_error (hwstate->fpexc, &ufp_exc->fpexc, err); -__put_user_error (hwstate->fpinst, &ufp_exc->fpinst, err); -__put_user_error (hwstate->fpinst2, &ufp_exc->fpinst2, err); - -if (err) -return -EFAULT ; + ufp_exc->fpexc = hwstate->fpexc; + ufp_exc->fpinst = hwstate->fpinst; + ufp_exc->fpinst2 = hwstate->fpinst2;/* Ensure that VFP is disabled. */ vfp_flush_hwstate (thread);
arch/x86/events/core.c +14 -0
@@ -2250,6 +2250,19 @@ void perf_check_microcode(void) x86_pmu.check_microcode (); } +static int x86_pmu_check_period (struct perf_event *event,u64 value) +{ +if (x86_pmu.check_period && x86_pmu.check_period (event, value)) +return -EINVAL ; + +if (value && x86_pmu.limit_period) { +if (x86_pmu.limit_period (event, value) > value) +return -EINVAL ; + } + +return 0 ; +} +static struct pmu pmu = { .pmu_enable = x86_pmu_enable, .pmu_disable = x86_pmu_disable,
@@ -2274,6 +2287,7 @@ static struct pmu pmu = { .event_idx = x86_pmu_event_idx, .sched_task = x86_pmu_sched_task, .task_ctx_size = sizeof(struct x86_perf_task_context), + .check_period = x86_pmu_check_period, }; void arch_perf_update_userpage(struct perf_event *event,
arch/x86/events/intel/core.c +9 -0
@@ -3445,6 +3445,11 @@ static void intel_pmu_sched_task(struct perf_event_context *ctx,intel_pmu_lbr_sched_task (ctx, sched_in); } +static int intel_pmu_check_period (struct perf_event *event,u64 value) +{ +return intel_pmu_has_bts_period (event, value) ? -EINVAL :0 ; +} +PMU_FORMAT_ATTR (offcore_rsp,"config1:0-63" );PMU_FORMAT_ATTR (ldlat,"config1:0-15" );
@@ -3525,6 +3530,8 @@ static __initconst const struct x86_pmu core_pmu = { .cpu_starting = intel_pmu_cpu_starting, .cpu_dying = intel_pmu_cpu_dying, .cpu_dead = intel_pmu_cpu_dead, + + .check_period = intel_pmu_check_period, };static struct attribute *intel_pmu_attrs[];
@@ -3568,6 +3575,8 @@ static __initconst const struct x86_pmu intel_pmu = { .guest_get_msrs = intel_guest_get_msrs, .sched_task = intel_pmu_sched_task, + + .check_period = intel_pmu_check_period, };static __init void intel_clovertown_quirk (void )
arch/x86/events/perf_event.h +14 -2
@@ -639,6 +639,11 @@ struct x86_pmu {* Intel host/guest support (KVM) */ struct perf_guest_switch_msr *(*guest_get_msrs)(int *nr); + +/* +* Check period value for PERF_EVENT_IOC_PERIOD ioctl. +*/ +int (*check_period) (struct perf_event *event,u64 period); };struct x86_perf_task_context {
@@ -848,7 +853,7 @@ static inline int amd_pmu_init(void)#ifdef CONFIG_CPU_SUP_INTEL -static inline bool intel_pmu_has_bts (struct perf_event *event) +static inline bool intel_pmu_has_bts_period (struct perf_event *event,u64 period) {struct hw_perf_event *hwc = &event->hw;unsigned int hw_event, bts_event;
@@ -859,7 +864,14 @@ static inline bool intel_pmu_has_bts(struct perf_event *event) hw_event = hwc->config &INTEL_ARCH_EVENT_MASK ; bts_event = x86_pmu.event_map (PERF_COUNT_HW_BRANCH_INSTRUCTIONS ); -return hw_event == bts_event && hwc->sample_period ==1 ; +return hw_event == bts_event && period ==1 ; +} + +static inline bool intel_pmu_has_bts (struct perf_event *event) +{ +struct hw_perf_event *hwc = &event->hw; + +return intel_pmu_has_bts_period (event, hwc->sample_period); }int intel_pmu_save_and_restart (struct perf_event *event);
arch/x86/ia32/ia32_aout.c +4 -2
@@ -51,7 +51,7 @@ static unsigned long get_dr(int n)/* * fill in the user structure for a core dump.. */ -static void dump_thread32 (struct pt_regs *regs,struct user32 *dump) +static void fill_dump (struct pt_regs *regs,struct user32 *dump) {u32 fs, gs;memset (dump,0 ,sizeof (*dump));
@@ -157,10 +157,12 @@ static int aout_core_dump(struct coredump_params *cprm) fs =get_fs ();set_fs (KERNEL_DS ); has_dumped =1 ; + +fill_dump (cprm->regs, &dump); +strncpy (dump.u_comm, current->comm,sizeof (current->comm)); dump.u_ar0 = offsetof(struct user32 , regs); dump.signal = cprm->siginfo->si_signo; -dump_thread32 (cprm->regs, &dump);/* * If the size of the dump file exceeds the rlimit, then see
arch/x86/include/asm/uv/bios.h +7 -1
@@ -48,7 +48,8 @@ enum {BIOS_STATUS_SUCCESS =0 ,BIOS_STATUS_UNIMPLEMENTED = -ENOSYS ,BIOS_STATUS_EINVAL = -EINVAL , - BIOS_STATUS_UNAVAIL = -EBUSY +BIOS_STATUS_UNAVAIL = -EBUSY , + BIOS_STATUS_ABORT = -EINTR, };/* Address map parameters */
@@ -167,4 +168,9 @@ extern long system_serial_number;extern struct kobject *sgi_uv_kobj;/* /sys/firmware/sgi_uv */ +/* +* EFI runtime lock; cf. firmware/efi/runtime-wrappers.c for details +*/ +extern struct semaphore __efi_uv_runtime_lock; +#endif /* _ASM_X86_UV_BIOS_H */
arch/x86/kvm/vmx.c +2 -1
@@ -2230,7 +2230,8 @@ static void add_atomic_switch_msr(struct vcpu_vmx *vmx, unsigned msr,if (!entry_only) j =find_msr (&m->host, msr); -if (i ==NR_AUTOLOAD_MSRS || j ==NR_AUTOLOAD_MSRS ) { +if ((i <0 && m->guest.nr ==NR_AUTOLOAD_MSRS ) || + (j <0 && m->host.nr ==NR_AUTOLOAD_MSRS )) {printk_once (KERN_WARNING "Not enough msr switch entries. " "Can't add msr %x\n" , msr);return ;
arch/x86/platform/uv/bios_uv.c +21 -2
@@ -29,7 +29,8 @@struct uv_systab *uv_systab; -s64 uv_bios_call (enum uv_bios_cmd which,u64 a1,u64 a2,u64 a3,u64 a4,u64 a5) +static s64 __uv_bios_call (enum uv_bios_cmd which,u64 a1,u64 a2,u64 a3, +u64 a4,u64 a5) {struct uv_systab *tab = uv_systab;s64 ret;
@@ -51,6 +52,19 @@ s64 uv_bios_call(enum uv_bios_cmd which, u64 a1, u64 a2, u64 a3, u64 a4, u64 a5)return ret; } + +s64 uv_bios_call (enum uv_bios_cmd which,u64 a1,u64 a2,u64 a3,u64 a4,u64 a5) +{ +s64 ret; + +if (down_interruptible (&__efi_uv_runtime_lock)) +return BIOS_STATUS_ABORT ; + + ret =__uv_bios_call (which, a1, a2, a3, a4, a5); +up (&__efi_uv_runtime_lock); + +return ret; +}EXPORT_SYMBOL_GPL (uv_bios_call); s64 uv_bios_call_irqsave(enum uv_bios_cmd which, u64 a1, u64 a2, u64 a3,
@@ -59,10 +73,15 @@ s64 uv_bios_call_irqsave(enum uv_bios_cmd which, u64 a1, u64 a2, u64 a3,unsigned long bios_flags;s64 ret; +if (down_interruptible (&__efi_uv_runtime_lock)) +return BIOS_STATUS_ABORT ; +local_irq_save (bios_flags); - ret =uv_bios_call (which, a1, a2, a3, a4, a5); + ret =__uv_bios_call (which, a1, a2, a3, a4, a5);local_irq_restore (bios_flags); +up (&__efi_uv_runtime_lock); +return ret; }
block/blk-flush.c +1 -1
@@ -402,7 +402,7 @@ static void mq_flush_data_end_io(struct request *rq, blk_status_t error)blk_flush_complete_seq (rq, fq,REQ_FSEQ_DATA , error);spin_unlock_irqrestore (&fq->mq_flush_lock, flags); -blk_mq_run_hw_queue (hctx, true); +blk_mq_sched_restart (hctx); }/**
drivers/acpi/numa.c +3 -3
@@ -147,9 +147,9 @@ acpi_table_print_srat_entry(struct acpi_subtable_header *header) {struct acpi_srat_mem_affinity *p = (struct acpi_srat_mem_affinity *)header; - pr_debug("SRAT Memory (0x%lx length 0x%lx) in proximity domain %d %s%s%s\n", - (unsigned long)p->base_address, - (unsigned long)p->length, + pr_debug("SRAT Memory (0x%llx length 0x%llx) in proximity domain %d %s%s%s\n", + (unsigned long long)p->base_address, + (unsigned long long)p->length, p->proximity_domain, (p->flags & ACPI_SRAT_MEM_ENABLED) ? "enabled" : "disabled",
drivers/cpufreq/cpufreq.c +4 -8
@@ -1523,17 +1523,16 @@ static unsigned int __cpufreq_get(struct cpufreq_policy *policy) {unsigned int ret_freq =0 ; -if (!cpufreq_driver->get) +if (unlikely (policy_is_inactive (policy)) || !cpufreq_driver->get)return ret_freq; ret_freq = cpufreq_driver->get (policy->cpu);/* -* Updating inactive policies is invalid, so avoid doing that. Also -* if fast frequency switching is used with the given policy, the check +* If fast frequency switching is used with the given policy, the check * against policy->cur is pointless, so skip it in that case too. */ -if (unlikely (policy_is_inactive (policy)) || policy->fast_switch_enabled) +if (policy->fast_switch_enabled)return ret_freq; if (ret_freq && policy->cur &&
@@ -1562,10 +1561,7 @@ unsigned int cpufreq_get(unsigned int cpu)if (policy) {down_read (&policy->rwsem); - -if (!policy_is_inactive (policy)) - ret_freq =__cpufreq_get (policy); - + ret_freq =__cpufreq_get (policy);up_read (&policy->rwsem);cpufreq_cpu_put (policy);
drivers/firmware/efi/runtime-wrappers.c +7 -0
@@ -49,6 +49,13 @@ void efi_call_virt_check_flags(unsigned long flags, const char *call)local_irq_restore (flags); } +/* +* Expose the EFI runtime lock to the UV platform +*/ +#ifdef CONFIG_X86_UV +extern struct semaphore __efi_uv_runtime_lock __alias(efi_runtime_lock); +#endif +/* * According to section 7.1 of the UEFI spec, Runtime Services are not fully * reentrant, and there are particular combinations of calls that need to be
drivers/gpu/drm/bridge/tc358767.c +32 -9
100 lines not on this page · raw message
drivers/gpu/drm/i915/i915_gem.c +11 -1
@@ -1633,6 +1633,16 @@ i915_gem_sw_finish_ioctl(struct drm_device *dev, void *data,return 0 ; } +static inline bool +__vma_matches (struct vm_area_struct *vma,struct file *filp, +unsigned long addr,unsigned long size) +{ +if (vma->vm_file != filp) +return false; + +return vma->vm_start == addr && (vma->vm_end - vma->vm_start) == size; +} +/** * i915_gem_mmap_ioctl - Maps the contents of an object, returning the address * it is mapped to.
@@ -1691,7 +1701,7 @@ i915_gem_mmap_ioctl(struct drm_device *dev, void *data,return -EINTR ; } vma =find_vma (mm, addr); -if (vma) +if (vma &&__vma_matches (vma, obj->base.filp, addr, args->size)) vma->vm_page_prot =pgprot_writecombine (vm_get_page_prot (vma->vm_flags));else
drivers/gpu/drm/nouveau/nvkm/engine/falcon.c +5 -2
@@ -22,6 +22,7 @@#include <engine/falcon.h> #include <core/gpuobj.h> +#include <subdev/mc.h> #include <subdev/timer.h> #include <engine/fifo.h>
@@ -107,8 +108,10 @@ nvkm_falcon_fini(struct nvkm_engine *engine, bool suspend) } } -nvkm_mask (device, base +0x048 ,0x00000003 ,0x00000000 ); -nvkm_wr32 (device, base +0x014 ,0xffffffff ); +if (nvkm_mc_enabled (device, engine->subdev.index)) { +nvkm_mask (device, base +0x048 ,0x00000003 ,0x00000000 ); +nvkm_wr32 (device, base +0x014 ,0xffffffff ); + }return 0 ; }
drivers/gpu/drm/nouveau/nvkm/subdev/therm/base.c +4 -3
@@ -131,11 +131,12 @@ nvkm_therm_update(struct nvkm_therm *therm, int mode) duty =nvkm_therm_update_linear (therm);break ;case NVBIOS_THERM_FAN_OTHER : -if (therm->cstate) +if (therm->cstate) { duty = therm->cstate; -else + poll = false; + }else { duty =nvkm_therm_update_linear_fallback (therm); - poll = false; + }break ; } immd = false;
drivers/input/misc/bma150.c +5 -4
@@ -481,13 +481,14 @@ static int bma150_register_input_device(struct bma150_data *bma150) idev->close = bma150_irq_close;input_set_drvdata (idev, bma150); + bma150->input = idev; + error =input_register_device (idev);if (error) {input_free_device (idev);return error; } - bma150->input = idev;return 0 ; }
@@ -510,15 +511,15 @@ static int bma150_register_polled_device(struct bma150_data *bma150)bma150_init_input_device (bma150, ipoll_dev->input); + bma150->input_polled = ipoll_dev; + bma150->input = ipoll_dev->input; + error =input_register_polled_device (ipoll_dev);if (error) {input_free_polled_device (ipoll_dev);return error; } - bma150->input_polled = ipoll_dev; - bma150->input = ipoll_dev->input; -return 0 ; }
drivers/input/mouse/elan_i2c_core.c +1 -1
@@ -1251,7 +1251,6 @@ MODULE_DEVICE_TABLE(i2c, elan_id);static const struct acpi_device_id elan_acpi_id[] = { {"ELAN0000" ,0 }, {"ELAN0100" ,0 }, - {"ELAN0501" ,0 }, {"ELAN0600" ,0 }, {"ELAN0602" ,0 }, {"ELAN0605" ,0 },
@@ -1262,6 +1261,7 @@ static const struct acpi_device_id elan_acpi_id[] = { { "ELAN060C", 0 }, { "ELAN0611", 0 }, { "ELAN0612", 0 }, + { "ELAN0617", 0 }, { "ELAN0618", 0 }, { "ELAN061C", 0 }, { "ELAN061D", 0 },
drivers/input/mouse/elantech.c +9 -0
@@ -1121,6 +1121,8 @@ static int elantech_get_resolution_v4(struct psmouse *psmouse,* Asus UX31 0x361f00 20, 15, 0e clickpad * Asus UX32VD 0x361f02 00, 15, 0e clickpad * Avatar AVIU-145A2 0x361f00 ? clickpad +* Fujitsu CELSIUS H760 0x570f02 40, 14, 0c 3 hw buttons (**) +* Fujitsu CELSIUS H780 0x5d0f02 41, 16, 0d 3 hw buttons (**) * Fujitsu LIFEBOOK E544 0x470f00 d0, 12, 09 2 hw buttons * Fujitsu LIFEBOOK E546 0x470f00 50, 12, 09 2 hw buttons * Fujitsu LIFEBOOK E547 0x470f00 50, 12, 09 2 hw buttons
@@ -1173,6 +1175,13 @@ static const struct dmi_system_id elantech_dmi_has_middle_button[] = { DMI_MATCH(DMI_PRODUCT_NAME, "CELSIUS H760"), }, }, + { +/* Fujitsu H780 also has a middle button */ + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"FUJITSU" ), + DMI_MATCH(DMI_PRODUCT_NAME, "CELSIUS H780"), + }, + }, #endif { } };
drivers/md/dm-crypt.c +1 -1
@@ -935,7 +935,7 @@ static int dm_crypt_integrity_io_alloc(struct dm_crypt_io *io, struct bio *bio)if (IS_ERR (bip))return PTR_ERR (bip); - tag_len = io->cc->on_disk_tag_size *bio_sectors (bio); + tag_len = io->cc->on_disk_tag_size * (bio_sectors (bio) >> io->cc->sector_shift); bip->bip_iter.bi_size = tag_len; bip->bip_iter.bi_sector = io->cc->start + io->sector;
drivers/md/dm-thin.c +50 -5
108 lines not on this page · raw message
drivers/md/raid1.c +18 -11
@@ -1854,6 +1854,20 @@ static void end_sync_read(struct bio *bio)reschedule_retry (r1_bio); } +static void abort_sync_write (struct mddev *mddev,struct r1bio *r1_bio) +{ +sector_t sync_blocks =0 ; +sector_t s = r1_bio->sector; +long sectors_to_go = r1_bio->sectors; + +/* make sure these bits don't get cleared. */ +do { +bitmap_end_sync (mddev->bitmap, s, &sync_blocks,1 ); + s += sync_blocks; + sectors_to_go -= sync_blocks; + }while (sectors_to_go >0 ); +} +static void end_sync_write (struct bio *bio) {int uptodate = !bio->bi_status;
@@ -1865,16 +1879,7 @@ static void end_sync_write(struct bio *bio)struct md_rdev *rdev = conf->mirrors[find_bio_disk (r1_bio, bio)].rdev;if (!uptodate) { -sector_t sync_blocks =0 ; -sector_t s = r1_bio->sector; -long sectors_to_go = r1_bio->sectors; -/* make sure these bits doesn't get cleared. */ -do { -bitmap_end_sync (mddev->bitmap, s, - &sync_blocks,1 ); - s += sync_blocks; - sectors_to_go -= sync_blocks; - }while (sectors_to_go >0 ); +abort_sync_write (mddev, r1_bio);set_bit (WriteErrorSeen, &rdev->flags);if (!test_and_set_bit (WantReplacement, &rdev->flags)) set_bit(MD_RECOVERY_NEEDED, &
@@ -2164,8 +2169,10 @@ static void sync_request_write(struct mddev *mddev, struct r1bio *r1_bio) (i == r1_bio->read_disk || !test_bit(MD_RECOVERY_SYNC, &mddev->recovery)))) continue; -if (test_bit (Faulty, &conf->mirrors[i].rdev->flags)) +if (test_bit (Faulty, &conf->mirrors[i].rdev->flags)) { +abort_sync_write (mddev, r1_bio);continue ; + }bio_set_op_attrs (wbio,REQ_OP_WRITE ,0 );if (test_bit (FailFast, &conf->mirrors[i].rdev->flags))
drivers/misc/eeprom/Kconfig +1 -1
@@ -12,7 +12,7 @@ config EEPROM_AT24 ones like at24c64, 24lc02 or fm24c04: 24c00, 24c01, 24c02, spd (readonly 24c02), 24c04, 24c08, - 24c16, 24c32, 24c64, 24c128, 24c256, 24c512, 24c1024 + 24c16, 24c32, 24c64, 24c128, 24c256, 24c512, 24c1024, 24c2048 Unless you like data loss puzzles, always be sure that any chip you configure as a 24c32 (32 kbit) or larger is NOT really a
drivers/misc/eeprom/at24.c +1 -0
@@ -170,6 +170,7 @@ static const struct i2c_device_id at24_ids[] = { { "24c256", AT24_DEVICE_MAGIC(262144 / 8, AT24_FLAG_ADDR16) }, { "24c512", AT24_DEVICE_MAGIC(524288 / 8, AT24_FLAG_ADDR16) }, { "24c1024", AT24_DEVICE_MAGIC(1048576 / 8, AT24_FLAG_ADDR16) }, + { "24c2048", AT24_DEVICE_MAGIC(2097152 / 8, AT24_FLAG_ADDR16) }, { "at24", 0 }, { /* END OF LIST */ } };
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +18 -0
@@ -12978,6 +12978,24 @@ static netdev_features_t bnx2x_features_check(struct sk_buff *skb, struct net_device *dev, netdev_features_t features) { +/* +* A skb with gso_size + header length > 9700 will cause a +* firmware panic. Drop GSO support. +* +* Eventually the upper layer should not pass these packets down. +* +* For speed, if the gso_size is <= 9000, assume there will +* not be 700 bytes of headers and pass it through. Only do a +* full (slow) validation if the gso_size is > 9000. +* +* (Due to the way SKB_BY_FRAGS works this will also do a full +* validation in that case.) +*/ +if (unlikely (skb_is_gso (skb) && + (skb_shinfo (skb)->gso_size >9000 ) && + !skb_gso_validate_mac_len (skb,9700 ))) + features &= ~NETIF_F_GSO_MASK ; + features =vlan_features_check (skb, features);return vxlan_features_check (skb, features); }
drivers/nvme/host/pci.c +6 -4
@@ -1624,8 +1624,9 @@ static void nvme_free_host_mem(struct nvme_dev *dev)struct nvme_host_mem_buf_desc *desc = &dev->host_mem_descs[i];size_t size =le32_to_cpu (desc->size) * dev->ctrl.page_size; -dma_free_coherent (dev->dev, size, dev->host_mem_desc_bufs[i], -le64_to_cpu (desc->addr)); +dma_free_attrs (dev->dev, size, dev->host_mem_desc_bufs[i], +le64_to_cpu (desc->addr), +DMA_ATTR_NO_KERNEL_MAPPING |DMA_ATTR_NO_WARN ); }kfree (dev->host_mem_desc_bufs);
@@ -1691,8 +1692,9 @@ static int __nvme_alloc_host_mem(struct nvme_dev *dev, u64 preferred,while (--i >=0 ) {size_t size =le32_to_cpu (descs[i].size) * dev->ctrl.page_size; -dma_free_coherent (dev->dev, size, bufs[i], -le64_to_cpu (descs[i].addr)); +dma_free_attrs (dev->dev, size, bufs[i], +le64_to_cpu (descs[i].addr), +DMA_ATTR_NO_KERNEL_MAPPING |DMA_ATTR_NO_WARN ); }kfree (bufs);
drivers/pinctrl/qcom/pinctrl-msm.c +18 -5
@@ -839,11 +839,24 @@ static int msm_gpio_init(struct msm_pinctrl *pctrl)return ret; } - ret =gpiochip_add_pin_range (&pctrl->chip,dev_name (pctrl->dev),0 ,0 , chip->ngpio); -if (ret) { -dev_err (pctrl->dev,"Failed to add pin range\n" ); -gpiochip_remove (&pctrl->chip); -return ret; +/* +* For DeviceTree-supported systems, the gpio core checks the +* pinctrl's device node for the "gpio-ranges" property. +* If it is present, it takes care of adding the pin ranges +* for the driver. In this case the driver can skip ahead. +* +* In order to remain compatible with older, existing DeviceTree +* files which don't set the "gpio-ranges" property or systems that +* utilize ACPI the driver has to call gpiochip_add_pin_range(). +*/ +if (!of_property_read_bool (pctrl->dev->of_node,"gpio-ranges" )) { + ret =gpiochip_add_pin_range (&pctrl->chip, +dev_name (pctrl->dev),0 ,0 , chip->ngpio); +if (ret) { +dev_err (pctrl->dev,"Failed to add pin range\n" ); +gpiochip_remove (&pctrl->chip); +return ret; + } } ret = gpiochip_irqchip_add(chip,
fs/cifs/file.c +8 -0
@@ -1128,6 +1128,10 @@ cifs_push_mandatory_locks(struct cifsFileInfo *cfile)return -EINVAL ; } +BUILD_BUG_ON (sizeof (struct smb_hdr ) +sizeof (LOCKING_ANDX_RANGE ) > +PAGE_SIZE ); + max_buf = min_t(unsigned int, max_buf - sizeof(struct smb_hdr), +PAGE_SIZE ); max_num = (max_buf -sizeof (struct smb_hdr )) /sizeof (LOCKING_ANDX_RANGE ); buf =kcalloc (max_num,sizeof (LOCKING_ANDX_RANGE ),GFP_KERNEL );
@@ -1466,6 +1470,10 @@ cifs_unlock_range(struct cifsFileInfo *cfile, struct file_lock *flock,if (max_buf < (sizeof (struct smb_hdr ) +sizeof (LOCKING_ANDX_RANGE )))return -EINVAL ; +BUILD_BUG_ON (sizeof (struct smb_hdr ) +sizeof (LOCKING_ANDX_RANGE ) > +PAGE_SIZE ); + max_buf = min_t(unsigned int, max_buf - sizeof(struct smb_hdr), +PAGE_SIZE ); max_num = (max_buf -sizeof (struct smb_hdr )) /sizeof (LOCKING_ANDX_RANGE ); buf =kcalloc (max_num,sizeof (LOCKING_ANDX_RANGE ),GFP_KERNEL );
fs/cifs/smb2file.c +4 -0
@@ -130,6 +130,8 @@ smb2_unlock_range(struct cifsFileInfo *cfile, struct file_lock *flock,if (max_buf <sizeof (struct smb2_lock_element ))return -EINVAL ; +BUILD_BUG_ON (sizeof (struct smb2_lock_element ) >PAGE_SIZE ); + max_buf = min_t(unsigned int, max_buf, PAGE_SIZE); max_num = max_buf /sizeof (struct smb2_lock_element ); buf =kcalloc (max_num,sizeof (struct smb2_lock_element ),GFP_KERNEL );if (!buf)
@@ -266,6 +268,8 @@ smb2_push_mandatory_locks(struct cifsFileInfo *cfile)return -EINVAL ; } +BUILD_BUG_ON (sizeof (struct smb2_lock_element ) >PAGE_SIZE ); + max_buf = min_t(unsigned int, max_buf, PAGE_SIZE); max_num = max_buf /sizeof (struct smb2_lock_element ); buf =kcalloc (max_num,sizeof (struct smb2_lock_element ),GFP_KERNEL );if (!buf) {
fs/proc/task_mmu.c +14 -8
@@ -459,7 +459,7 @@ struct mem_size_stats { };static void smaps_account (struct mem_size_stats *mss,struct page *page, -bool compound,bool young,bool dirty) +bool compound,bool young,bool dirty,bool locked) {int i, nr = compound ?1 <<compound_order (page) :1 ;unsigned long size = nr *PAGE_SIZE ;
@@ -486,24 +486,31 @@ static void smaps_account(struct mem_size_stats *mss, struct page *page,else mss->private_clean += size; mss->pss += (u64 )size <<PSS_SHIFT ; +if (locked) + mss->pss_locked += (u64 )size <<PSS_SHIFT ;return ; }for (i =0 ; i < nr; i++, page++) {int mapcount =page_mapcount (page); +unsigned long pss = (PAGE_SIZE <<PSS_SHIFT );if (mapcount >=2 ) {if (dirty ||PageDirty (page)) mss->shared_dirty +=PAGE_SIZE ;else mss->shared_clean +=PAGE_SIZE ; - mss->pss += (PAGE_SIZE <<PSS_SHIFT ) / mapcount; + mss->pss += pss / mapcount; +if (locked) + mss->pss_locked += pss / mapcount; }else {if (dirty ||PageDirty (page)) mss->private_dirty +=PAGE_SIZE ;else mss->private_clean +=PAGE_SIZE ; - mss->pss +=PAGE_SIZE <<PSS_SHIFT ; + mss->pss += pss; +if (locked) + mss->pss_locked += pss; } } }
@@ -526,6 +533,7 @@ static void smaps_pte_entry(pte_t *pte, unsigned long addr, {struct mem_size_stats *mss = walk->private;struct vm_area_struct *vma = walk->vma; +bool locked = !!(vma->vm_flags &VM_LOCKED );struct page *page =NULL ;if (pte_present (*pte)) {
@@ -568,7 +576,7 @@ static void smaps_pte_entry(pte_t *pte, unsigned long addr,if (!page)return ; -smaps_account (mss, page, false,pte_young (*pte),pte_dirty (*pte)); +smaps_account (mss, page, false,pte_young (*pte),pte_dirty (*pte), locked); }#ifdef CONFIG_TRANSPARENT_HUGEPAGE
@@ -577,6 +585,7 @@ static void smaps_pmd_entry(pmd_t *pmd, unsigned long addr, {struct mem_size_stats *mss = walk->private;struct vm_area_struct *vma = walk->vma; +bool locked = !!(vma->vm_flags &VM_LOCKED );struct page *page;/* FOLL_DUMP will return -EFAULT on huge zero page */
@@ -591,7 +600,7 @@ static void smaps_pmd_entry(pmd_t *pmd, unsigned long addr,/* pass */ ; else VM_BUG_ON_PAGE(1, page); -smaps_account (mss, page, true,pmd_young (*pmd),pmd_dirty (*pmd)); +smaps_account (mss, page, true,pmd_young (*pmd),pmd_dirty (*pmd), locked); }#else static void smaps_pmd_entry(pmd_t *pmd, unsigned long addr,
@@ -792,11 +801,8 @@ static int show_smap(struct seq_file *m, void *v, int is_pid) } }#endif -/* mmap_sem is held in m_start */ walk_page_vma (vma, &smaps_walk); -if (vma->vm_flags &VM_LOCKED ) - mss->pss_locked += mss->pss;if (!rollup_mode) {show_map_vma (m, vma, is_pid);
include/linux/perf_event.h +5 -0
@@ -446,6 +446,11 @@ struct pmu {* Filter events for PMU-specific reasons. */ int (*filter_match) (struct perf_event *event);/* optional */ + +/* +* Check period value for PERF_EVENT_IOC_PERIOD ioctl. +*/ +int (*check_period) (struct perf_event *event,u64 value);/* optional */ };/**
include/linux/skbuff.h +16 -0
@@ -3317,6 +3317,7 @@ int skb_shift(struct sk_buff *tgt, struct sk_buff *skb, int shiftlen);void skb_scrub_packet (struct sk_buff *skb,bool xnet);unsigned int skb_gso_transport_seglen (const struct sk_buff *skb);bool skb_gso_validate_mtu (const struct sk_buff *skb,unsigned int mtu); +bool skb_gso_validate_mac_len (const struct sk_buff *skb,unsigned int len);struct sk_buff *skb_segment (struct sk_buff *skb,netdev_features_t features);struct sk_buff *skb_vlan_untag (struct sk_buff *skb);int skb_ensure_writable (struct sk_buff *skb,int write_len);
@@ -4087,6 +4088,21 @@ static inline unsigned int skb_gso_network_seglen(const struct sk_buff *skb)return hdr_len +skb_gso_transport_seglen (skb); } +/** +* skb_gso_mac_seglen - Return length of individual segments of a gso packet +* +* @skb: GSO skb +* +* skb_gso_mac_seglen is used to determine the real size of the +* individual segments, including MAC/L2, Layer3 (IP, IPv6) and L4 +* headers (TCP/UDP). +*/ +static inline unsigned int skb_gso_mac_seglen (const struct sk_buff *skb) +{ +unsigned int hdr_len =skb_transport_header (skb) -skb_mac_header (skb); +return hdr_len +skb_gso_transport_seglen (skb); +} +/* Local Checksum Offload. * Compute outer checksum based on the assumption that the * inner checksum will be offloaded later.
include/trace/events/sched.h +11 -1
@@ -107,6 +107,8 @@ DEFINE_EVENT(sched_wakeup_template, sched_wakeup_new,#ifdef CREATE_TRACE_POINTS static inline long __trace_sched_switch_state (bool preempt,struct task_struct *p) { +unsigned int state; +#ifdef CONFIG_SCHED_DEBUG BUG_ON (p != current);#endif /* CONFIG_SCHED_DEBUG */
@@ -118,7 +120,15 @@ static inline long __trace_sched_switch_state(bool preempt, struct task_struct *if (preempt)return TASK_REPORT_MAX ; - return 1 << __get_task_state(p); +/* +* task_state_index() uses fls() and returns a value from 0-8 range. +* Decrement it by 1 (except TASK_RUNNING state i.e 0) before using +* it for left shift operation to get the correct task->state +* mapping. +*/ + state =__get_task_state (p); + + return state ? (1 << (state - 1)) : state; }#endif /* CREATE_TRACE_POINTS */
include/uapi/linux/if_ether.h +7 -0
@@ -150,11 +150,18 @@* This is an Ethernet frame header. */ +/* allow libcs like musl to deactivate this, glibc does not implement this. */ +#ifndef __UAPI_DEF_ETHHDR +#define __UAPI_DEF_ETHHDR 1 +#endif + +#if __UAPI_DEF_ETHHDRstruct ethhdr {unsigned char h_dest[ETH_ALEN ];/* destination eth addr */ unsigned char h_source[ETH_ALEN ];/* source ether addr */ __be16 h_proto;/* packet type ID field */ } __attribute__((packed)); +#endif #endif /* _UAPI_LINUX_IF_ETHER_H */
kernel/events/core.c +16 -0
@@ -4738,6 +4738,11 @@ static void __perf_event_period(struct perf_event *event, } } +static int perf_event_check_period (struct perf_event *event,u64 value) +{ +return event->pmu->check_period (event, value); +} +static int perf_event_period (struct perf_event *event,u64 __user *arg) {u64 value;
@@ -4754,6 +4759,9 @@ static int perf_event_period(struct perf_event *event, u64 __user *arg)if (event->attr.freq && value > sysctl_perf_event_sample_rate)return -EINVAL ; +if (perf_event_check_period (event, value)) +return -EINVAL ; +event_function_call (event, __perf_event_period, &value);return 0 ;
@@ -8951,6 +8959,11 @@ static int perf_pmu_nop_int(struct pmu *pmu)return 0 ; } +static int perf_event_nop_int (struct perf_event *event,u64 value) +{ +return 0 ; +} + static DEFINE_PER_CPU(unsigned int, nop_txn_flags);static void perf_pmu_start_txn (struct pmu *pmu,unsigned int flags)
@@ -9251,6 +9264,9 @@ int perf_pmu_register(struct pmu *pmu, const char *name, int type) pmu->pmu_disable = perf_pmu_nop_void; } +if (!pmu->check_period) + pmu->check_period = perf_event_nop_int; +if (!pmu->event_idx) pmu->event_idx = perf_event_idx_default;
kernel/events/ring_buffer.c +1 -1
@@ -719,7 +719,7 @@ struct ring_buffer *rb_alloc(int nr_pages, long watermark, int cpu, int flags) size =sizeof (struct ring_buffer ); size += nr_pages *sizeof (void *); -if (order_base_2 (size) >=MAX_ORDER ) +if (order_base_2 (size) >=PAGE_SHIFT +MAX_ORDER ) goto fail; rb =kzalloc (size,GFP_KERNEL );
kernel/futex.c +63 -6
107 lines not on this page · raw message
kernel/signal.c +5 -2
@@ -2268,9 +2268,12 @@ int get_signal(struct ksignal *ksig) }/* Has this task already been marked for death? */ - ksig->info.si_signo = signr =SIGKILL ; -if (signal_group_exit (signal)) +if (signal_group_exit (signal)) { + ksig->info.si_signo = signr =SIGKILL ; +sigdelset (¤t->pending.signal,SIGKILL ); +recalc_sigpending (); goto fatal; + }for (;;) {struct k_sigaction *ka;
kernel/trace/trace_uprobe.c +8 -1
@@ -153,7 +153,14 @@ static void FETCH_FUNC_NAME(memory, string)(struct pt_regs *regs, ret =strncpy_from_user (dst, src, maxlen);if (ret == maxlen) - dst[--ret] ='\0' ; + dst[ret -1 ] ='\0' ; +else if (ret >=0 ) +/* +* Include the terminating null byte. In this case it +* was copied by strncpy_from_user but not accounted +* for in ret. +*/ + ret++;if (ret <0 ) {/* Failed to fetch string */ ((u8 *)get_rloc_data (dest))[0 ] ='\0' ;
net/core/skbuff.c +50 -13
87 lines not on this page · raw message
net/sched/sch_tbf.c +0 -10
@@ -142,16 +142,6 @@ static u64 psched_ns_t2l(const struct psched_ratecfg *r,return len; } -/* -* Return length of individual segments of a gso packet, -* including all headers (MAC, IP, TCP/UDP) -*/ -static unsigned int skb_gso_mac_seglen (const struct sk_buff *skb) -{ -unsigned int hdr_len =skb_transport_header (skb) -skb_mac_header (skb); -return hdr_len +skb_gso_transport_seglen (skb); -} -/* GSO packet is too big, segment it so that tbf can transmit * each segment in time */
sound/pci/hda/patch_conexant.c +1 -0
@@ -962,6 +962,7 @@ static const struct snd_pci_quirk cxt5066_fixups[] = {SND_PCI_QUIRK (0x103c ,0x807C ,"HP EliteBook 820 G3" ,CXT_FIXUP_HP_DOCK ),SND_PCI_QUIRK (0x103c ,0x80FD ,"HP ProBook 640 G2" ,CXT_FIXUP_HP_DOCK ),SND_PCI_QUIRK (0x103c ,0x828c ,"HP EliteBook 840 G4" ,CXT_FIXUP_HP_DOCK ), +SND_PCI_QUIRK (0x103c ,0x83b2 ,"HP EliteBook 840 G5" ,CXT_FIXUP_HP_DOCK ),SND_PCI_QUIRK (0x103c ,0x83b3 ,"HP EliteBook 830 G5" ,CXT_FIXUP_HP_DOCK ),SND_PCI_QUIRK (0x103c ,0x83d3 ,"HP ProBook 640 G4" ,CXT_FIXUP_HP_DOCK ), SND_PCI_QUIRK(0x103c, 0x8174, "HP Spectre x360", CXT_FIXUP_HP_SPECTRE),
sound/usb/pcm.c +8 -1
@@ -313,6 +313,9 @@ static int search_roland_implicit_fb(struct usb_device *dev, int ifnum,return 0 ; } +/* Setup an implicit feedback endpoint from a quirk. Returns 0 if no quirk +* applies. Returns 1 if a quirk was found. +*/ static int set_sync_ep_implicit_fb_quirk(struct snd_usb_substream *subs, struct usb_device *dev, struct usb_interface_descriptor *altsd,
@@ -391,7 +394,7 @@ static int set_sync_ep_implicit_fb_quirk(struct snd_usb_substream *subs, subs->data_endpoint->sync_master = subs->sync_endpoint; -return 0 ; +return 1 ; } static int set_sync_endpoint(struct snd_usb_substream *subs,
@@ -430,6 +433,10 @@ static int set_sync_endpoint(struct snd_usb_substream *subs,if (err <0 )return err; +/* endpoint set by quirk */ +if (err >0 ) +return 0 ; +if (altsd->bNumEndpoints <2 )return 0 ;
tools/perf/tests/shell/lib/probe_vfs_getname.sh +2 -1
@@ -13,7 +13,8 @@ add_probe_vfs_getname() { local verbose=$1 if [ $had_vfs_getname -eq 1 ] ; then line=$(perf probe -L getname_flags 2>&1 | egrep 'result.*=.*filename;' | sed -r 's/[[:space:]]+([[:digit:]]+)[[:space:]]+result->uptr.*/\1/') - perf probe $verbose "vfs_getname=getname_flags:${line} pathname=result->name:string" + perf probe -q "vfs_getname=getname_flags:${line} pathname=result->name:string" || \ + perf probe $verbose "vfs_getname=getname_flags:${line} pathname=filename:string" fi }