Linux 4.4.112
Greg KH
maintainerI'm announcing the release of the 4.4.112 kernel.
All users of the 4.4 kernel series must upgrade.
The updated 4.4.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-4.4.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/ABI/testing/sysfs-devices-system-cpu | 16 Documentation/kernel-parameters.txt | 21 Documentation/x86/pti.txt | 186 +++++++ Makefile | 2 arch/arm/kvm/mmio.c | 6 arch/mips/kernel/process.c | 12 arch/mips/kernel/ptrace.c | 147 +++++- arch/x86/Kconfig | 1 arch/x86/include/asm/alternative.h | 4 arch/x86/include/asm/cpufeature.h | 5 arch/x86/include/asm/kaiser.h | 10 arch/x86/include/asm/processor.h | 4 arch/x86/include/asm/pvclock.h | 2 arch/x86/kernel/acpi/boot.c | 61 +- arch/x86/kernel/alternative.c | 7 arch/x86/kernel/cpu/Makefile | 4 arch/x86/kernel/cpu/bugs.c | 55 ++ arch/x86/kernel/cpu/bugs_64.c | 33 - arch/x86/kernel/cpu/common.c | 33 - arch/x86/kernel/cpu/microcode/intel.c | 14 arch/x86/kvm/svm.c | 19 arch/x86/kvm/vmx.c | 26 - arch/x86/kvm/x86.c | 8 arch/x86/mm/kaiser.c | 2 arch/x86/mm/pat.c | 5 arch/x86/realmode/init.c | 4 arch/x86/realmode/rm/trampoline_64.S | 3 crypto/algapi.c | 12 drivers/base/Kconfig | 3 drivers/base/cpu.c | 48 ++ drivers/block/rbd.c | 2 drivers/char/hw_random/core.c | 6 drivers/char/mem.c | 6 drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c | 2 drivers/infiniband/ulp/srpt/ib_srpt.c | 3 drivers/iommu/arm-smmu-v3.c | 8 drivers/md/dm-bufio.c | 7 drivers/media/usb/usbvision/usbvision-video.c | 7 drivers/net/can/usb/gs_usb.c | 2 drivers/net/ethernet/intel/e1000e/ich8lan.c | 11 drivers/net/ethernet/renesas/sh_eth.c | 29 + drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 6 drivers/net/usb/cx82310_eth.c | 7 drivers/net/usb/lan78xx.c | 9 drivers/net/usb/r8152.c | 132 +++-- drivers/net/usb/smsc75xx.c | 8 drivers/net/usb/sr9700.c | 9 drivers/staging/android/ashmem.c | 2 drivers/target/iscsi/iscsi_target.c | 20 drivers/target/target_core_tmr.c | 9 drivers/target/target_core_transport.c | 2 drivers/tty/sysrq.c | 6 drivers/usb/host/xhci-mem.c | 3 drivers/usb/misc/usb3503.c | 2 drivers/usb/mon/mon_bin.c | 8 drivers/usb/musb/ux500.c | 7 drivers/usb/serial/cp210x.c | 2 drivers/usb/storage/unusual_uas.h | 7 drivers/usb/usbip/usbip_common.c | 17 fs/locks.c | 16 include/linux/bpf.h | 2 include/linux/cpu.h | 7 include/linux/filter.h | 3 include/linux/phy.h | 11 include/linux/sh_eth.h | 1 include/target/target_core_base.h | 1 include/trace/events/kvm.h | 7 kernel/bpf/arraymap.c | 37 + kernel/bpf/core.c | 71 ++ kernel/bpf/syscall.c | 54 -- kernel/bpf/verifier.c | 217 ++++++--- kernel/futex.c | 8 kernel/locking/mutex.c | 5 mm/compaction.c | 50 +- mm/page-writeback.c | 11 mm/zswap.c | 24 - net/8021q/vlan.c | 7 net/bluetooth/l2cap_core.c | 20 net/core/sock_diag.c | 2 net/ipv6/ip6_output.c | 4 net/ipv6/ip6_tunnel.c | 9 net/mac80211/debugfs.c | 7 net/rds/rdma.c | 4 sound/core/oss/pcm_oss.c | 41 + sound/core/oss/pcm_plugin.c | 14 sound/core/pcm_lib.c | 4 sound/drivers/aloop.c | 98 ++-- tools/testing/selftests/vm/Makefile | 4 tools/testing/selftests/x86/Makefile | 3 tools/testing/selftests/x86/test_vsyscall.c | 500 +++++++++++++++++++++ 90 files changed, 1811 insertions(+), 523 deletions(-)
Alexei Starovoitov (4):
bpf: move fixup_bpf_calls() function
bpf: refactor fixup_bpf_calls()
bpf: adjust insn_aux_data when patching insns
bpf: prevent out-of-bounds speculation
Andrew Honig (1):
KVM: x86: Add memory barrier on vmcs field lookup
Andrey Ryabinin (2):
net/mac80211/debugfs.c: prevent build failure with CONFIG_UBSAN=y mm/page-writeback: fix dirty_ratelimit calculation
Andrii Vladyka (1):
net: core: fix module type in sock_diag_bind
Andy Lutomirski (3):
x86/vsdo: Fix build on PARAVIRT_CLOCK=y, KVM_GUEST=n x86/cpu: Factor out application of forced CPU caps selftests/x86: Add test_vsyscall
Ani Sinha (1):
sysrq: Fix warning in sysrq generated crash.
Bart Van Assche (1):
IB/srpt: Disable RDMA access by the initiator
Ben Hutchings (1):
xhci: Fix ring leak in failure path of xhci_alloc_virt_device()
Ben Seri (1):
Bluetooth: Prevent stack info leak from the EFS element.
Benjamin Poirier (1):
e1000e: Fix e1000_check_for_copper_link_ich8lan return value.
Borislav Petkov (2):
x86/cpu: Merge bugs.c and bugs_64.c x86/alternatives: Fix optimize_nops() checking
Christian Holl (1):
USB: serial: cp210x: add new device ID ELV ALC 8xxx
Cong Wang (1):
8021q: fix a memory leak for VLAN 0 device
Dan Carpenter (1):
drm/vmwgfx: Potential off by one in vmw_view_add()
Dan Streetman (2):
mm/zswap: use workqueue to destroy pool
zswap: don't param_set_charp while holding spinlock
Daniel Borkmann (2):
bpf: add bpf_patch_insn_single helper
bpf, array: fix overflow in max_entries and undefined behavior in index_mask
Dave Hansen (1):
x86/Documentation: Add PTI description
David Woodhouse (3):
x86/cpufeatures: Add X86_BUG_SPECTRE_V[12]
sysfs/cpu: Fix typos in vulnerability documentation x86/alternatives: Add missing '\n' at end of ALTERNATIVE inline asm
Davidlohr Bueso (1):
locking/mutex: Allow next waiter lockless wakeup
Diego Elio Pettenò (1):
USB: serial: cp210x: add IDs for LifeScan OneTouch Verio IQ
Eli Cooper (1):
ip6_tunnel: disable dst caching if tunnel is dual-stack
Eric Biggers (1):
crypto: algapi - fix NULL dereference in crypto_remove_spawns()
Eric Dumazet (5):
lan78xx: use skb_cow_head() to deal with cloned skbs
sr9700: use skb_cow_head() to deal with cloned skbs
smsc75xx: use skb_cow_head() to deal with cloned skbs
cx82310_eth: use skb_cow_head() to deal with cloned skbs
ipv6: fix possible mem leaks in ipv6_make_skb()
Greg Kroah-Hartman (2):
Revert "userfaultfd: selftest: vm: allow to build in vm/ directory" Linux 4.4.112
Icenowy Zheng (1):
uas: ignore UAS for Norelsys NS1068(X) chips
Ilya Dryomov (1):
rbd: set max_segments to USHRT_MAX
Jakub Kicinski (1):
bpf: don't (ab)use instructions to store state
Jean-Philippe Brucker (1):
iommu/arm-smmu-v3: Don't free page table ops twice
Jeff Layton (1):
locks: don't check for race with close when setting OFD lock
Jerome Brunet (1):
net: stmmac: enable EEE in MII, GMII or RGMII only
Jia Zhang (1):
x86/microcode/intel: Extend BDW late-loading with a revision check
Jianyu Zhan (1):
futex: Replace barrier() in unqueue_me() with READ_ONCE()
Jim Mattson (1):
kvm: vmx: Scrub hardware GPRs at VM-exit
Jiri Kosina (1):
x86/mm/pat, /dev/mem: Remove superfluous error message
Jiri Slaby (1):
hwrng: core - sleep interruptible in read
Joonsoo Kim (2):
mm/compaction: fix invalid free_pfn and compact_cached_free_pfn mm/compaction: pass only pageblock aligned range to pageblock_pfn_to_page
Lepton Wu (1):
kaiser: Set _PAGE_NX only if supported
Maciej W. Rozycki (7):
MIPS: Validate PR_SET_FP_MODE prctl(2) requests against the ABI of the task
MIPS: Factor out NT_PRFPREG regset access helpers
MIPS: Guard against any partial write attempt with PTRACE_SETREGSET
MIPS: Consistently handle buffer counter with PTRACE_SETREGSET
MIPS: Fix an FCSR access API regression with NT_PRFPREG and MSA
MIPS: Also verify sizeof `elf_fpreg_t' with PTRACE_SETREGSET
MIPS: Disallow outsized PTRACE_SETREGSET NT_PRFPREG regset accesses
Mohamed Ghannam (2):
RDS: Heap OOB write in rds_message_alloc_sgs()
RDS: null pointer dereference in rds_atomic_free_op
Nicholas Bellinger (2):
iscsi-target: Make TASK_REASSIGN use proper se_cmd->cmd_kref
target: Avoid early CMD_T_PRE_EXECUTE failures during ABORT_TASK
Oliver Neukum (1):
usbvision fix overflow of interfaces array
Pavel Tatashin (1):
x86/pti/efi: broken conversion from efi to kernel page table
Pete Zaitcev (1):
USB: fix usbmon BUG trigger
Sergei Shtylyov (2):
sh_eth: fix TSU resource handling
sh_eth: fix SH7757 GEther initialization
Shuah Khan (1):
usbip: remove kernel addresses from usb device and urb debug msgs
Stefan Agner (1):
usb: misc: usb3503: make sure reset is low for at least 100us
Suren Baghdasaryan (1):
dm bufio: fix shrinker scans when (nr_to_scan < retain_target)
Takashi Iwai (7):
ALSA: pcm: Remove incorrect snd_BUG_ON() usages
ALSA: pcm: Add missing error checks in OSS emulation plugin builder
ALSA: pcm: Abort properly at pending signal in OSS read/write loops
ALSA: pcm: Allow aborting mutex lock at OSS read/write loops
ALSA: aloop: Release cable upon open error path
ALSA: aloop: Fix inconsistent format due to incomplete rule
ALSA: aloop: Fix racy hw constraints adjustment
Thomas Gleixner (5):
x86/cpufeatures: Make CPU bugs sticky x86/cpufeatures: Add X86_BUG_CPU_INSECURE x86/pti: Rename BUG_CPU_INSECURE to BUG_CPU_MELTDOWN sysfs/cpu: Add vulnerability folder
x86/cpu: Implement CPU vulnerabilites sysfs functions
Ulf Hansson (1):
usb: musb: ux500: Fix NULL pointer dereference at system PM
Vikas C Sajjan (2):
x86/acpi: Handle SCI interrupts above legacy space gracefully x86/acpi: Reduce code duplication in mp_override_legacy_irq()
Viktor Slavkovic (1):
staging: android: ashmem: fix a race condition in ASHMEM_SET_SIZE ioctl
Wanpeng Li (1):
KVM: Fix stack-out-of-bounds read in write_mmio
Wolfgang Grandegger (1):
can: gs_usb: fix return value of the "set_bittiming" callback
hayeswang (3):
r8152: fix the wake event
r8152: use test_and_clear_bit
r8152: adjust ALDPS function
Greg KH
maintainerDocumentation/ABI/testing/sysfs-devices-system-cpu +16 -0
@@ -271,3 +271,19 @@ Description: Parameters for the CPU cache attributes - WriteBack: data is written only to the cache line and the modified cache line is written to main memory only when it is replaced + +What: /sys/devices/system/cpu/vulnerabilities + /sys/devices/system/cpu/vulnerabilities/meltdown + /sys/devices/system/cpu/vulnerabilities/spectre_v1 + /sys/devices/system/cpu/vulnerabilities/spectre_v2 +Date: January 2018 +Contact: Linux kernel mailing list <[email protected]> +Description: Information about CPU vulnerabilities + + The files are named after the code names of CPU + vulnerabilities. The output of those files reflects the + state of the CPUs in the system. Possible output values: + + "Not affected" CPU is not affected by the vulnerability + "Vulnerable" CPU is affected and no mitigation in effect + "Mitigation: $M" CPU is affected and mitigation $M is in effect
Documentation/kernel-parameters.txt +14 -7
@@ -2523,8 +2523,6 @@ bytes respectively. Such letter suffixes can also be entirely omitted. nojitter [IA-64] Disables jitter checking for ITC timers. - nopti [X86-64] Disable KAISER isolation of kernel from user. - no-kvmclock [X86,KVM] Disable paravirtualized KVM clock driver no-kvmapf [X86,KVM] Disable paravirtualized asynchronous page
@@ -3056,11 +3054,20 @@ bytes respectively. Such letter suffixes can also be entirely omitted. pt. [PARIDE] See Documentation/blockdev/paride.txt. - pti= [X86_64] - Control KAISER user/kernel address space isolation: - on - enable - off - disable - auto - default setting + pti= [X86_64] Control Page Table Isolation of user and + kernel address spaces. Disabling this feature + removes hardening, but improves performance of + system calls and interrupts. + + on - unconditionally enable + off - unconditionally disable + auto - kernel detects whether your CPU model is + vulnerable to issues that PTI mitigates + + Not specifying this option is equivalent to pti=auto. + + nopti [X86_64] + Equivalent to pti=off pty.legacy_count= [KNL] Number of legacy pty's. Overwrites compiled-in
Documentation/x86/pti.txt new file +186 -0
186 lines not on this page · raw message
Makefile +1 -1
@@ -1,6 +1,6 @@ VERSION = 4 PATCHLEVEL = 4 -SUBLEVEL = 111 +SUBLEVEL = 112 EXTRAVERSION = NAME = Blurry Fish Butt
arch/arm/kvm/mmio.c +3 -3
@@ -113,7 +113,7 @@ int kvm_handle_mmio_return(struct kvm_vcpu *vcpu, struct kvm_run *run) }trace_kvm_mmio (KVM_TRACE_MMIO_READ , len, run->mmio.phys_addr, - data); + &data); data =vcpu_data_host_to_guest (vcpu, data, len);vcpu_set_reg (vcpu, vcpu->arch.mmio_decode.rt, data); }
@@ -189,14 +189,14 @@ int io_mem_abort(struct kvm_vcpu *vcpu, struct kvm_run *run, data =vcpu_data_guest_to_host (vcpu,vcpu_get_reg (vcpu, rt), len); -trace_kvm_mmio (KVM_TRACE_MMIO_WRITE , len, fault_ipa, data); +trace_kvm_mmio (KVM_TRACE_MMIO_WRITE , len, fault_ipa, &data);mmio_write_buf (data_buf, len, data); ret =kvm_io_bus_write (vcpu,KVM_MMIO_BUS , fault_ipa, len, data_buf); }else {trace_kvm_mmio (KVM_TRACE_MMIO_READ_UNSATISFIED , len, - fault_ipa,0 ); + fault_ipa,NULL ); ret =kvm_io_bus_read (vcpu,KVM_MMIO_BUS , fault_ipa, len, data_buf);
arch/mips/kernel/process.c +12 -0
@@ -664,6 +664,18 @@ int mips_set_process_fp_mode(struct task_struct *task, unsigned int value)unsigned long switch_count;struct task_struct *t; +/* If nothing to change, return right away, successfully. */ +if (value ==mips_get_process_fp_mode (task)) +return 0 ; + +/* Only accept a mode change if 64-bit FP enabled for o32. */ +if (!IS_ENABLED (CONFIG_MIPS_O32_FP64_SUPPORT )) +return -EOPNOTSUPP ; + +/* And only for o32 tasks. */ +if (IS_ENABLED (CONFIG_64BIT ) && !test_thread_flag (TIF_32BIT_REGS )) +return -EOPNOTSUPP ; +/* Check the value is valid */ if (value & ~known_bits)return -EOPNOTSUPP ;
arch/mips/kernel/ptrace.c +122 -25
185 lines not on this page · raw message
arch/x86/Kconfig +1 -0
@@ -62,6 +62,7 @@ config X86 select GENERIC_CLOCKEVENTS_MIN_ADJUST select GENERIC_CMOS_UPDATE select GENERIC_CPU_AUTOPROBE + select GENERIC_CPU_VULNERABILITIES select GENERIC_EARLY_IOREMAP select GENERIC_FIND_FIRST_BIT select GENERIC_IOMAP
arch/x86/include/asm/alternative.h +2 -2
@@ -138,7 +138,7 @@ static inline int alternatives_text_reserved(void *start, void *end)".popsection\n" \".pushsection .altinstr_replacement, \"ax\"\n" \ ALTINSTR_REPLACEMENT(newinstr, feature, 1) \ - ".popsection" + ".popsection\n"#define ALTERNATIVE_2 (oldinstr, newinstr1, feature1, newinstr2, feature2)\ OLDINSTR_2(oldinstr, 1, 2) \
@@ -149,7 +149,7 @@ static inline int alternatives_text_reserved(void *start, void *end)".pushsection .altinstr_replacement, \"ax\"\n" \ ALTINSTR_REPLACEMENT(newinstr1, feature1, 1) \ ALTINSTR_REPLACEMENT(newinstr2, feature2, 2) \ -".popsection" +".popsection\n" /* * This must be included *after* the definition of ALTERNATIVE due to
arch/x86/include/asm/cpufeature.h +5 -0
@@ -277,6 +277,9 @@#define X86_BUG_FXSAVE_LEAK X86_BUG(6)/* FXSAVE leaks FOP/FIP/FOP */ #define X86_BUG_CLFLUSH_MONITOR X86_BUG(7)/* AAI65, CLFLUSH required before MONITOR */ #define X86_BUG_SYSRET_SS_ATTRS X86_BUG(8)/* SYSRET doesn't fix up SS attrs */ +#define X86_BUG_CPU_MELTDOWN X86_BUG(14)/* CPU is affected by meltdown attack and needs kernel page table isolation */ +#define X86_BUG_SPECTRE_V1 X86_BUG(15)/* CPU is affected by Spectre variant 1 attack with conditional branches */ +#define X86_BUG_SPECTRE_V2 X86_BUG(16)/* CPU is affected by Spectre variant 2 attack with indirect branches */ #if defined(__KERNEL__) && !defined(__ASSEMBLY__)
@@ -359,6 +362,8 @@ extern const char * const x86_bug_flags[NBUGINTS*32];set_bit (bit, (unsigned long *)cpu_caps_set); \ } while (0) +#define setup_force_cpu_bug (bit) setup_force_cpu_cap(bit) +#define cpu_has_fpu boot_cpu_has(X86_FEATURE_FPU)#define cpu_has_de boot_cpu_has(X86_FEATURE_DE)#define cpu_has_pse boot_cpu_has(X86_FEATURE_PSE)
arch/x86/include/asm/kaiser.h +10 -0
@@ -19,6 +19,16 @@#define KAISER_SHADOW_PGD_OFFSET 0x1000 +#ifdef CONFIG_PAGE_TABLE_ISOLATION +/* +* A page table address must have this alignment to stay the same when +* KAISER_SHADOW_PGD_OFFSET mask is applied +*/ +#define KAISER_KERNEL_PGD_ALIGNMENT (KAISER_SHADOW_PGD_OFFSET << 1) +#else +#define KAISER_KERNEL_PGD_ALIGNMENT PAGE_SIZE +#endif +#ifdef __ASSEMBLY__#ifdef CONFIG_PAGE_TABLE_ISOLATION
arch/x86/include/asm/processor.h +2 -2
@@ -156,8 +156,8 @@ extern struct cpuinfo_x86 boot_cpu_data;extern struct cpuinfo_x86 new_cpu_data;extern struct tss_struct doublefault_tss; -extern __u32 cpu_caps_cleared[NCAPINTS ]; -extern __u32 cpu_caps_set[NCAPINTS ]; +extern __u32 cpu_caps_cleared[NCAPINTS +NBUGINTS ]; +extern __u32 cpu_caps_set[NCAPINTS +NBUGINTS ];#ifdef CONFIG_SMP DECLARE_PER_CPU_READ_MOSTLY(struct cpuinfo_x86, cpu_info);
arch/x86/include/asm/pvclock.h +1 -1
@@ -4,7 +4,7 @@#include <linux/clocksource.h> #include <asm/pvclock-abi.h> -#ifdef CONFIG_PARAVIRT_CLOCK +#ifdef CONFIG_KVM_GUEST extern struct pvclock_vsyscall_time_info *pvclock_pvti_cpu0_va (void );#else static inline struct pvclock_vsyscall_time_info *pvclock_pvti_cpu0_va (void )
arch/x86/kernel/acpi/boot.c +38 -23
94 lines not on this page · raw message
arch/x86/kernel/alternative.c +5 -2
@@ -339,9 +339,12 @@ done: static void __init_or_module optimize_nops(struct alt_instr *a, u8 *instr) {unsigned long flags; +int i; -if (instr[0 ] !=0x90 ) -return ; +for (i =0 ; i < a->padlen; i++) { +if (instr[i] !=0x90 ) +return ; + }local_irq_save (flags);add_nops (instr + (a->instrlen - a->padlen), a->padlen);
arch/x86/kernel/cpu/Makefile +1 -3
@@ -16,13 +16,11 @@ obj-y := intel_cacheinfo.o scattered.o topology.o obj-y += common.o obj-y += rdrand.o obj-y += match.o +obj-y += bugs.o obj-$(CONFIG_PROC_FS) += proc.o obj-$(CONFIG_X86_FEATURE_NAMES) += capflags.o powerflags.o -obj-$(CONFIG_X86_32) += bugs.o -obj-$(CONFIG_X86_64) += bugs_64.o - obj-$(CONFIG_CPU_SUP_INTEL) += intel.o obj-$(CONFIG_CPU_SUP_AMD) += amd.o obj-$(CONFIG_CPU_SUP_CYRIX_32) += cyrix.o
arch/x86/kernel/cpu/bugs.c +51 -4
78 lines not on this page · raw message
arch/x86/kernel/cpu/bugs_64.c deleted +0 -33
@@ -1,33 +0,0 @@ -/* -* Copyright (C) 1994 Linus Torvalds -* Copyright (C) 2000 SuSE -*/ - -#include <linux/kernel.h> -#include <linux/init.h> -#include <asm/alternative.h> -#include <asm/bugs.h> -#include <asm/processor.h> -#include <asm/mtrr.h> -#include <asm/cacheflush.h> - -void __init check_bugs (void ) -{ -identify_boot_cpu (); -#if !defined(CONFIG_SMP ) -printk (KERN_INFO "CPU: " ); -print_cpu_info (&boot_cpu_data); -#endif -alternative_instructions (); - -/* -* Make sure the first 2MB area is not mapped by huge pages -* There are typically fixed size MTRRs in there and overlapping -* MTRRs into large pages causes slow downs. -* -* Right now we don't do that with gbpages because there seems -* very little benefit for that case. -*/ -if (!direct_gbpages) -set_memory_4k ((unsigned long )__va (0 ),1 ); -}
arch/x86/kernel/cpu/common.c +22 -11
@@ -432,8 +432,8 @@ static const char *table_lookup_model(struct cpuinfo_x86 *c)return NULL ;/* Not found */ } -__u32 cpu_caps_cleared[NCAPINTS ]; -__u32 cpu_caps_set[NCAPINTS ]; +__u32 cpu_caps_cleared[NCAPINTS +NBUGINTS ]; +__u32 cpu_caps_set[NCAPINTS +NBUGINTS ];void load_percpu_segment (int cpu) {
@@ -664,6 +664,16 @@ void cpu_detect(struct cpuinfo_x86 *c) } } +static void apply_forced_caps (struct cpuinfo_x86 *c) +{ +int i; + +for (i =0 ; i <NCAPINTS +NBUGINTS ; i++) { + c->x86_capability[i] &= ~cpu_caps_cleared[i]; + c->x86_capability[i] |= cpu_caps_set[i]; + } +} +void get_cpu_cap (struct cpuinfo_x86 *c) {u32 tfms, xlvl;
@@ -820,6 +830,13 @@ static void __init early_identify_cpu(struct cpuinfo_x86 *c) }setup_force_cpu_cap (X86_FEATURE_ALWAYS ); + +/* Assume for now that ALL x86 CPUs are insecure */ +setup_force_cpu_bug (X86_BUG_CPU_MELTDOWN ); + +setup_force_cpu_bug (X86_BUG_SPECTRE_V1 ); +setup_force_cpu_bug (X86_BUG_SPECTRE_V2 ); +fpu__init_system (c); }
@@ -955,11 +972,8 @@ static void identify_cpu(struct cpuinfo_x86 *c)if (this_cpu->c_identify) this_cpu->c_identify (c); -/* Clear/Set all flags overriden by options, after probe */ -for (i =0 ; i <NCAPINTS ; i++) { - c->x86_capability[i] &= ~cpu_caps_cleared[i]; - c->x86_capability[i] |= cpu_caps_set[i]; - } +/* Clear/Set all flags overridden by options, after probe */ +apply_forced_caps (c);#ifdef CONFIG_X86_64 c->apicid = apic->phys_pkg_id (c->initial_apicid,0 );
@@ -1020,10 +1034,7 @@ static void identify_cpu(struct cpuinfo_x86 *c)* Clear/Set all flags overriden by options, need do it * before following smp all cpus cap AND. */ -for (i =0 ; i <NCAPINTS ; i++) { - c->x86_capability[i] &= ~cpu_caps_cleared[i]; - c->x86_capability[i] |= cpu_caps_set[i]; - } +apply_forced_caps (c);/* * On SMP, boot_cpu_data holds the common feature set between
arch/x86/kernel/cpu/microcode/intel.c +11 -3
@@ -994,9 +994,17 @@ static bool is_blacklisted(unsigned int cpu) {struct cpuinfo_x86 *c = &cpu_data (cpu); -if (c->x86 ==6 && c->x86_model ==79 ) { -pr_err_once ("late loading on model 79 is disabled.\n" ); -return true; +/* +* Late loading on model 79 with microcode revision less than 0x0b000021 +* may result in a system hang. This behavior is documented in item +* BDF90, #334165 (Intel Xeon Processor E7-8800/4800 v4 Product Family). +*/ +if (c->x86 ==6 && + c->x86_model ==79 && + c->x86_mask ==0x01 && + c->microcode <0x0b000021 ) { +pr_err_once ("Erratum BDF90: late loading with revision < 0x0b000021 (0x%x) disabled.\n" , c->microcode); +pr_err_once ("Please consider either early loading through initrd/built-in or a potential BIOS update.\n" ); }return false;
arch/x86/kvm/svm.c +19 -0
@@ -3855,6 +3855,25 @@ static void svm_vcpu_run(struct kvm_vcpu *vcpu)"mov %%r13, %c[r13](%[svm]) \n\t" "mov %%r14, %c[r14](%[svm]) \n\t" "mov %%r15, %c[r15](%[svm]) \n\t" +#endif +/* +* Clear host registers marked as clobbered to prevent +* speculative use. +*/ +"xor %%" _ASM_BX", %%" _ASM_BX" \n\t" +"xor %%" _ASM_CX", %%" _ASM_CX" \n\t" +"xor %%" _ASM_DX", %%" _ASM_DX" \n\t" +"xor %%" _ASM_SI", %%" _ASM_SI" \n\t" +"xor %%" _ASM_DI", %%" _ASM_DI" \n\t" +#ifdef CONFIG_X86_64 +"xor %%r8, %%r8 \n\t" +"xor %%r9, %%r9 \n\t" +"xor %%r10, %%r10 \n\t" +"xor %%r11, %%r11 \n\t" +"xor %%r12, %%r12 \n\t" +"xor %%r13, %%r13 \n\t" +"xor %%r14, %%r14 \n\t" +"xor %%r15, %%r15 \n\t" #endif "pop %%" _ASM_BP :
arch/x86/kvm/vmx.c +23 -3
@@ -828,8 +828,16 @@ static inline short vmcs_field_to_offset(unsigned long field) {BUILD_BUG_ON (ARRAY_SIZE (vmcs_field_to_offset_table) >SHRT_MAX ); -if (field >=ARRAY_SIZE (vmcs_field_to_offset_table) || - vmcs_field_to_offset_table[field] ==0 ) +if (field >=ARRAY_SIZE (vmcs_field_to_offset_table)) +return -ENOENT ; + +/* +* FIXME: Mitigation for CVE-2017-5753. To be replaced with a +* generic mechanism. +*/ + asm("lfence" ); + +if (vmcs_field_to_offset_table[field] ==0 )return -ENOENT ;return vmcs_field_to_offset_table[field];
@@ -8623,6 +8631,7 @@ static void __noclone vmx_vcpu_run(struct kvm_vcpu *vcpu)/* Save guest registers, load host registers, keep flags */ "mov %0, %c[wordsize](%%" _ASM_SP") \n\t" "pop %0 \n\t" +"setbe %c[fail](%0)\n\t" "mov %%" _ASM_AX", %c[rax](%0) \n\t" "mov %%" _ASM_BX", %c[rbx](%0) \n\t" __ASM_SIZE(pop) " %c[rcx](%0) \n\t"
@@ -8639,12 +8648,23 @@ static void __noclone vmx_vcpu_run(struct kvm_vcpu *vcpu)"mov %%r13, %c[r13](%0) \n\t" "mov %%r14, %c[r14](%0) \n\t" "mov %%r15, %c[r15](%0) \n\t" +"xor %%r8d, %%r8d \n\t" +"xor %%r9d, %%r9d \n\t" +"xor %%r10d, %%r10d \n\t" +"xor %%r11d, %%r11d \n\t" +"xor %%r12d, %%r12d \n\t" +"xor %%r13d, %%r13d \n\t" +"xor %%r14d, %%r14d \n\t" + "xor %%r15d, %%r15d \n\t"#endif "mov %%cr2, %%" _ASM_AX" \n\t" "mov %%" _ASM_AX", %c[cr2](%0) \n\t" +"xor %%eax, %%eax \n\t" +"xor %%ebx, %%ebx \n\t" +"xor %%esi, %%esi \n\t" +"xor %%edi, %%edi \n\t" "pop %%" _ASM_BP"; pop %%" _ASM_DX" \n\t" -"setbe %c[fail](%0) \n\t" ".pushsection .rodata \n\t" ".global vmx_return \n\t" "vmx_return: " _ASM_PTR" 2b \n\t"
arch/x86/kvm/x86.c +4 -4
@@ -4114,7 +4114,7 @@ static int vcpu_mmio_read(struct kvm_vcpu *vcpu, gpa_t addr, int len, void *v) addr, n, v)) && kvm_io_bus_read(vcpu, KVM_MMIO_BUS, addr, n, v))break ; -trace_kvm_mmio (KVM_TRACE_MMIO_READ , n, addr, *(u64 *)v); +trace_kvm_mmio (KVM_TRACE_MMIO_READ , n, addr, v); handled += n; addr += n; len -= n;
@@ -4362,7 +4362,7 @@ static int read_prepare(struct kvm_vcpu *vcpu, void *val, int bytes) {if (vcpu->mmio_read_completed) {trace_kvm_mmio (KVM_TRACE_MMIO_READ , bytes, - vcpu->mmio_fragments[0 ].gpa, *(u64 *)val); + vcpu->mmio_fragments[0 ].gpa, val); vcpu->mmio_read_completed =0 ;return 1 ; }
@@ -4384,14 +4384,14 @@ static int write_emulate(struct kvm_vcpu *vcpu, gpa_t gpa,static int write_mmio (struct kvm_vcpu *vcpu,gpa_t gpa,int bytes,void *val) { -trace_kvm_mmio (KVM_TRACE_MMIO_WRITE , bytes, gpa, *(u64 *)val); +trace_kvm_mmio (KVM_TRACE_MMIO_WRITE , bytes, gpa, val);return vcpu_mmio_write (vcpu, gpa, bytes, val); }static int read_exit_mmio (struct kvm_vcpu *vcpu,gpa_t gpa,void *val,int bytes) { -trace_kvm_mmio (KVM_TRACE_MMIO_READ_UNSATISFIED , bytes, gpa,0 ); +trace_kvm_mmio (KVM_TRACE_MMIO_READ_UNSATISFIED , bytes, gpa,NULL );return X86EMUL_IO_NEEDED ; }
arch/x86/mm/kaiser.c +2 -0
@@ -198,6 +198,8 @@ static int kaiser_add_user_map(const void *__start_addr, unsigned long size,* requires that not to be #defined to 0): so mask it off here. */ flags &= ~_PAGE_GLOBAL; +if (!(__supported_pte_mask & _PAGE_NX)) + flags &= ~_PAGE_NX;for (; address < end_addr; address +=PAGE_SIZE ) { target_address =get_pa_from_mapping (address);
arch/x86/mm/pat.c +1 -4
@@ -750,11 +750,8 @@ static inline int range_is_allowed(unsigned long pfn, unsigned long size)return 1 ;while (cursor < to) { -if (!devmem_is_allowed (pfn)) { -pr_info ("x86/PAT: Program %s tried to access /dev/mem between [mem %#010Lx-%#010Lx], PAT prevents it\n" , - current->comm, from, to -1 ); +if (!devmem_is_allowed (pfn))return 0 ; - } cursor +=PAGE_SIZE ; pfn++; }
arch/x86/realmode/init.c +3 -1
@@ -4,6 +4,7 @@#include <asm/cacheflush.h> #include <asm/pgtable.h> #include <asm/realmode.h> +#include <asm/kaiser.h> struct real_mode_header *real_mode_header;u32 *trampoline_cr4_features;
@@ -15,7 +16,8 @@ void __init reserve_real_mode(void)size_t size =PAGE_ALIGN (real_mode_blob_end - real_mode_blob);/* Has to be under 1M so we can execute real-mode AP code. */ - mem =memblock_find_in_range (0 ,1 <<20 , size,PAGE_SIZE ); + mem =memblock_find_in_range (0 ,1 <<20 , size, +KAISER_KERNEL_PGD_ALIGNMENT );if (!mem)panic ("Cannot allocate trampoline\n" );
arch/x86/realmode/rm/trampoline_64.S +2 -1
@@ -30,6 +30,7 @@ #include <asm/msr.h> #include <asm/segment.h> #include <asm/processor-flags.h> +#include <asm/kaiser.h> #include "realmode.h" .text
@@ -139,7 +140,7 @@ tr_gdt: tr_gdt_end: .bss - .balign PAGE_SIZE + .balign KAISER_KERNEL_PGD_ALIGNMENT GLOBAL(trampoline_pgd) .space PAGE_SIZE .balign 8
crypto/algapi.c +12 -0
@@ -168,6 +168,18 @@ void crypto_remove_spawns(struct crypto_alg *alg, struct list_head *list, spawn->alg =NULL ; spawns = &inst->alg.cra_users; + +/* +* We may encounter an unregistered instance here, since +* an instance's spawns are set up prior to the instance +* being registered. An unregistered instance will have +* NULL ->cra_users.next, since ->cra_users isn't +* properly initialized until registration. But an +* unregistered instance cannot have any users, so treat +* it the same as ->cra_users being empty. +*/ +if (spawns->next ==NULL ) +break ; } }while ((spawns =crypto_more_spawns (alg, &stack, &top, &secondary_spawns)));
drivers/base/Kconfig +3 -0
@@ -223,6 +223,9 @@ config GENERIC_CPU_DEVICES config GENERIC_CPU_AUTOPROBE bool +config GENERIC_CPU_VULNERABILITIES + bool + config SOC_BUS bool
drivers/base/cpu.c +48 -0
58 lines not on this page · raw message
drivers/block/rbd.c +1 -1
@@ -3767,7 +3767,7 @@ static int rbd_init_disk(struct rbd_device *rbd_dev) segment_size =rbd_obj_bytes (&rbd_dev->header);blk_queue_max_hw_sectors (q, segment_size /SECTOR_SIZE ); q->limits.max_sectors =queue_max_hw_sectors (q); -blk_queue_max_segments (q, segment_size /SECTOR_SIZE ); +blk_queue_max_segments (q,USHRT_MAX );blk_queue_max_segment_size (q, segment_size);blk_queue_io_min (q, segment_size);blk_queue_io_opt (q, segment_size);
drivers/char/hw_random/core.c +5 -1
@@ -238,7 +238,10 @@ static ssize_t rng_dev_read(struct file *filp, char __user *buf, goto out; } -mutex_lock (&reading_mutex); +if (mutex_lock_interruptible (&reading_mutex)) { + err = -ERESTARTSYS ; + goto out_put; + }if (!data_avail) { bytes_read = rng_get_data(rng, rng_buffer, rng_buffer_size(),
@@ -288,6 +291,7 @@ out: out_unlock_reading:mutex_unlock (&reading_mutex); +out_put:put_rng (rng); goto out; }
drivers/char/mem.c +1 -5
@@ -70,12 +70,8 @@ static inline int range_is_allowed(unsigned long pfn, unsigned long size)u64 cursor = from;while (cursor < to) { -if (!devmem_is_allowed (pfn)) { -printk (KERN_INFO -"Program %s tried to access /dev/mem between %Lx->%Lx.\n" , - current->comm, from, to); +if (!devmem_is_allowed (pfn))return 0 ; - } cursor +=PAGE_SIZE ; pfn++; }
drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c +2 -0
@@ -2678,6 +2678,8 @@ static int vmw_cmd_dx_view_define(struct vmw_private *dev_priv, } view_type =vmw_view_cmd_to_type (header->id); +if (view_type == vmw_view_max) +return -EINVAL ; cmd =container_of (header,typeof (*cmd), header); ret = vmw_cmd_res_check(dev_priv, sw_context, vmw_res_surface, user_surface_converter,
drivers/infiniband/ulp/srpt/ib_srpt.c +1 -2
@@ -957,8 +957,7 @@ static int srpt_init_ch_qp(struct srpt_rdma_ch *ch, struct ib_qp *qp)return -ENOMEM ; attr->qp_state =IB_QPS_INIT ; - attr->qp_access_flags =IB_ACCESS_LOCAL_WRITE |IB_ACCESS_REMOTE_READ | -IB_ACCESS_REMOTE_WRITE ; + attr->qp_access_flags =IB_ACCESS_LOCAL_WRITE ; attr->port_num = ch->sport->port; attr->pkey_index =0 ;
drivers/iommu/arm-smmu-v3.c +5 -3
@@ -1541,13 +1541,15 @@ static int arm_smmu_domain_finalise(struct iommu_domain *domain)return -ENOMEM ; arm_smmu_ops.pgsize_bitmap = pgtbl_cfg.pgsize_bitmap; - smmu_domain->pgtbl_ops = pgtbl_ops; ret =finalise_stage_fn (smmu_domain, &pgtbl_cfg); -if (IS_ERR_VALUE (ret)) +if (IS_ERR_VALUE (ret)) {free_io_pgtable_ops (pgtbl_ops); +return ret; + } -return ret; + smmu_domain->pgtbl_ops = pgtbl_ops; +return 0 ; }static struct arm_smmu_group *arm_smmu_group_get (struct device *dev)
drivers/md/dm-bufio.c +5 -2
@@ -1527,7 +1527,8 @@ static unsigned long __scan(struct dm_bufio_client *c, unsigned long nr_to_scan,int l;struct dm_buffer *b, *tmp;unsigned long freed =0 ; -unsigned long count = nr_to_scan; +unsigned long count = c->n_buffers[LIST_CLEAN ] + + c->n_buffers[LIST_DIRTY ];unsigned long retain_target =get_retain_buffers (c);for (l =0 ; l <LIST_SIZE ; l++) {
@@ -1564,6 +1565,7 @@ dm_bufio_shrink_count(struct shrinker *shrink, struct shrink_control *sc) {struct dm_bufio_client *c;unsigned long count; +unsigned long retain_target; c = container_of(shrink, struct dm_bufio_client, shrinker);if (sc->gfp_mask & __GFP_FS)
@@ -1572,8 +1574,9 @@ dm_bufio_shrink_count(struct shrinker *shrink, struct shrink_control *sc)return 0 ; count = c->n_buffers[LIST_CLEAN ] + c->n_buffers[LIST_DIRTY ]; + retain_target =get_retain_buffers (c);dm_bufio_unlock (c); -return count; +return (count < retain_target) ?0 : (count - retain_target); }/*
drivers/media/usb/usbvision/usbvision-video.c +7 -0
@@ -1461,6 +1461,13 @@ static int usbvision_probe(struct usb_interface *intf,printk (KERN_INFO "%s: %s found\n" , __func__, usbvision_device_data[model].model_string); +/* +* this is a security check. +* an exploit using an incorrect bInterfaceNumber is known +*/ +if (ifnum >=USB_MAXINTERFACES || !dev->actconfig->interface[ifnum]) +return -ENODEV ; +if (usbvision_device_data[model].interface >=0 ) interface = &dev->actconfig->interface[usbvision_device_data[model].interface]->altsetting[0 ];else if (ifnum < dev->actconfig->desc.bNumInterfaces)
drivers/net/can/usb/gs_usb.c +1 -1
@@ -430,7 +430,7 @@ static int gs_usb_set_bittiming(struct net_device *netdev)dev_err (netdev->dev.parent,"Couldn't set bittimings (err=%d)" , rc); -return rc; +return (rc >0 ) ?0 : rc; }static void gs_usb_xmit_callback (struct urb *urb)
drivers/net/ethernet/intel/e1000e/ich8lan.c +8 -3
@@ -1362,6 +1362,9 @@ out:* Checks to see of the link status of the hardware has changed. If a * change in link status has been detected, then we read the PHY registers * to get the current speed/duplex if link exists. +* +* Returns a negative error code (-E1000_ERR_*) or 0 (link down) or 1 (link +* up). **/ static s32 e1000_check_for_copper_link_ich8lan (struct e1000_hw *hw) {
@@ -1377,7 +1380,7 @@ static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw)* Change or Rx Sequence Error interrupt. */ if (!mac->get_link_status) -return 0 ; +return 1 ;/* First we want to see if the MII Status Register reports * link. If so, then we want to get the current speed/duplex
@@ -1585,10 +1588,12 @@ static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw)* different link partner. */ ret_val =e1000e_config_fc_after_link_up (hw); -if (ret_val) +if (ret_val) {e_dbg ("Error configuring flow control\n" ); +return ret_val; + } -return ret_val; +return 1 ; }static s32 e1000_get_variants_ich8lan (struct e1000_adapter *adapter)
drivers/net/ethernet/renesas/sh_eth.c +24 -5
@@ -3176,18 +3176,37 @@ static int sh_eth_drv_probe(struct platform_device *pdev)/* ioremap the TSU registers */ if (mdp->cd->tsu) {struct resource *rtsu; + rtsu =platform_get_resource (pdev,IORESOURCE_MEM ,1 ); - mdp->tsu_addr =devm_ioremap_resource (&pdev->dev, rtsu); -if (IS_ERR (mdp->tsu_addr)) { - ret =PTR_ERR (mdp->tsu_addr); +if (!rtsu) { +dev_err (&pdev->dev,"no TSU resource\n" ); + ret = -ENODEV ; + goto out_release; + } +/* We can only request the TSU region for the first port +* of the two sharing this TSU for the probe to succeed... +*/ +if (devno %2 ==0 && + !devm_request_mem_region (&pdev->dev, rtsu->start, +resource_size (rtsu), +dev_name (&pdev->dev))) { +dev_err (&pdev->dev,"can't request TSU resource.\n" ); + ret = -EBUSY ; + goto out_release; + } + mdp->tsu_addr =devm_ioremap (&pdev->dev, rtsu->start, +resource_size (rtsu)); +if (!mdp->tsu_addr) { +dev_err (&pdev->dev,"TSU region ioremap() failed.\n" ); + ret = -ENOMEM ; goto out_release; } mdp->port = devno %2 ; ndev->features =NETIF_F_HW_VLAN_CTAG_FILTER ; } -/* initialize first or needed device */ -if (!devno || pd->needs_init) { +/* Need to init only the first port of the two sharing a TSU */ +if (devno %2 ==0 ) {if (mdp->cd->chip_reset) mdp->cd->chip_reset (ndev);
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +6 -0
@@ -272,8 +272,14 @@ bool stmmac_eee_init(struct stmmac_priv *priv) {char *phy_bus_name = priv->plat->phy_bus_name;unsigned long flags; +int interface = priv->plat->interface;bool ret = false; +if ((interface !=PHY_INTERFACE_MODE_MII ) && + (interface !=PHY_INTERFACE_MODE_GMII ) && + !phy_interface_mode_is_rgmii (interface)) + goto out; +/* Using PCS we cannot dial with the phy registers at this stage * so we do not support extra feature like EEE. */
drivers/net/usb/cx82310_eth.c +2 -5
@@ -293,12 +293,9 @@ static struct sk_buff *cx82310_tx_fixup(struct usbnet *dev, struct sk_buff *skb, {int len = skb->len; -if (skb_headroom (skb) <2 ) { -struct sk_buff *skb2 =skb_copy_expand (skb,2 ,0 , flags); +if (skb_cow_head (skb,2 )) {dev_kfree_skb_any (skb); - skb = skb2; -if (!skb) -return NULL ; +return NULL ; }skb_push (skb,2 );
drivers/net/usb/lan78xx.c +2 -7
@@ -2050,14 +2050,9 @@ static struct sk_buff *lan78xx_tx_prep(struct lan78xx_net *dev, {u32 tx_cmd_a, tx_cmd_b; -if (skb_headroom (skb) <TX_OVERHEAD ) { -struct sk_buff *skb2; - - skb2 =skb_copy_expand (skb,TX_OVERHEAD ,0 , flags); +if (skb_cow_head (skb,TX_OVERHEAD )) {dev_kfree_skb_any (skb); - skb = skb2; -if (!skb) -return NULL ; +return NULL ; }if (lan78xx_linearize (skb) <0 )
drivers/net/usb/r8152.c +79 -53
291 lines not on this page · raw message
drivers/net/usb/smsc75xx.c +2 -6
@@ -2193,13 +2193,9 @@ static struct sk_buff *smsc75xx_tx_fixup(struct usbnet *dev, {u32 tx_cmd_a, tx_cmd_b; -if (skb_headroom (skb) <SMSC75XX_TX_OVERHEAD ) { -struct sk_buff *skb2 = -skb_copy_expand (skb,SMSC75XX_TX_OVERHEAD ,0 , flags); +if (skb_cow_head (skb,SMSC75XX_TX_OVERHEAD )) {dev_kfree_skb_any (skb); - skb = skb2; -if (!skb) -return NULL ; +return NULL ; } tx_cmd_a = (u32)(skb->len &TX_CMD_A_LEN ) |TX_CMD_A_FCS ;
drivers/net/usb/sr9700.c +2 -7
@@ -456,14 +456,9 @@ static struct sk_buff *sr9700_tx_fixup(struct usbnet *dev, struct sk_buff *skb, len = skb->len; -if (skb_headroom (skb) <SR_TX_OVERHEAD ) { -struct sk_buff *skb2; - - skb2 =skb_copy_expand (skb,SR_TX_OVERHEAD ,0 , flags); +if (skb_cow_head (skb,SR_TX_OVERHEAD )) {dev_kfree_skb_any (skb); - skb = skb2; -if (!skb) -return NULL ; +return NULL ; }__skb_push (skb,SR_TX_OVERHEAD );
drivers/staging/android/ashmem.c +2 -0
@@ -759,10 +759,12 @@ static long ashmem_ioctl(struct file *file, unsigned int cmd, unsigned long arg)break ;case ASHMEM_SET_SIZE : ret = -EINVAL ; +mutex_lock (&ashmem_mutex);if (!asma->file) { ret =0 ; asma->size = (size_t )arg; } +mutex_unlock (&ashmem_mutex);break ;case ASHMEM_GET_SIZE : ret = asma->size;
drivers/target/iscsi/iscsi_target.c +7 -13
@@ -1759,7 +1759,6 @@ iscsit_handle_task_mgt_cmd(struct iscsi_conn *conn, struct iscsi_cmd *cmd,struct iscsi_tmr_req *tmr_req;struct iscsi_tm *hdr;int out_of_order_cmdsn =0 , ret; -bool sess_ref = false;u8 function, tcm_function =TMR_UNKNOWN ; hdr = (struct iscsi_tm *) buf;
@@ -1801,18 +1800,17 @@ iscsit_handle_task_mgt_cmd(struct iscsi_conn *conn, struct iscsi_cmd *cmd, buf); } +transport_init_se_cmd (&cmd->se_cmd, &iscsi_ops, + conn->sess->se_sess,0 ,DMA_NONE , +TCM_SIMPLE_TAG , cmd->sense_buffer +2 ); + +target_get_sess_cmd (&cmd->se_cmd, true); +/* * TASK_REASSIGN for ERL=2 / connection stays inside of * LIO-Target $FABRIC_MOD */ if (function !=ISCSI_TM_FUNC_TASK_REASSIGN ) { -transport_init_se_cmd (&cmd->se_cmd, &iscsi_ops, - conn->sess->se_sess,0 ,DMA_NONE , -TCM_SIMPLE_TAG , cmd->sense_buffer +2 ); - -target_get_sess_cmd (&cmd->se_cmd, true); - sess_ref = true; -switch (function) {case ISCSI_TM_FUNC_ABORT_TASK : tcm_function =TMR_ABORT_TASK ;
@@ -1951,12 +1949,8 @@ attach:* For connection recovery, this is also the default action for * TMR TASK_REASSIGN. */ -if (sess_ref) { -pr_debug ("Handle TMR, using sess_ref=true check\n" ); -target_put_sess_cmd (&cmd->se_cmd); - } -iscsit_add_cmd_to_response_queue (cmd, conn, cmd->i_state); +target_put_sess_cmd (&cmd->se_cmd);return 0 ; }EXPORT_SYMBOL (iscsit_handle_task_mgt_cmd);
drivers/target/target_core_tmr.c +9 -0
@@ -133,6 +133,15 @@ static bool __target_check_io_state(struct se_cmd *se_cmd,spin_unlock (&se_cmd->t_state_lock);return false; } +if (se_cmd->transport_state &CMD_T_PRE_EXECUTE ) { +if (se_cmd->scsi_status) { +pr_debug ("Attempted to abort io tag: %llu early failure" +" status: 0x%02x\n" , se_cmd->tag, + se_cmd->scsi_status); +spin_unlock (&se_cmd->t_state_lock); +return false; + } + }if (sess->sess_tearing_down || se_cmd->cmd_wait_set) {pr_debug ("Attempted to abort io tag: %llu already shutdown," " skipping\n" , se_cmd->tag);
drivers/target/target_core_transport.c +2 -0
@@ -1933,6 +1933,7 @@ void target_execute_cmd(struct se_cmd *cmd) } cmd->t_state =TRANSPORT_PROCESSING ; + cmd->transport_state &= ~CMD_T_PRE_EXECUTE ; cmd->transport_state |=CMD_T_ACTIVE |CMD_T_BUSY |CMD_T_SENT ;spin_unlock_irq (&cmd->t_state_lock);
@@ -2572,6 +2573,7 @@ int target_get_sess_cmd(struct se_cmd *se_cmd, bool ack_kref) ret = -ESHUTDOWN ; goto out; } + se_cmd->transport_state |=CMD_T_PRE_EXECUTE ;list_add_tail (&se_cmd->se_cmd_list, &se_sess->sess_cmd_list); out:spin_unlock_irqrestore (&se_sess->sess_cmd_lock, flags);
drivers/tty/sysrq.c +6 -0
@@ -133,6 +133,12 @@ static void sysrq_handle_crash(int key) {char *killer =NULL ; +/* we need to release the RCU read lock here, +* otherwise we get an annoying +* 'BUG: sleeping function called from invalid context' +* complaint from the kernel before the panic. +*/ +rcu_read_unlock (); panic_on_oops =1 ;/* force panic */ wmb (); *killer =1 ;
drivers/usb/host/xhci-mem.c +2 -1
@@ -1071,7 +1071,8 @@ int xhci_alloc_virt_device(struct xhci_hcd *xhci, int slot_id,return 1 ; fail: - +if (dev->eps[0 ].ring) +xhci_ring_free (xhci, dev->eps[0 ].ring);if (dev->in_ctx)xhci_free_container_ctx (xhci, dev->in_ctx);if (dev->out_ctx)
drivers/usb/misc/usb3503.c +2 -0
@@ -292,6 +292,8 @@ static int usb3503_probe(struct usb3503 *hub)if (gpio_is_valid (hub->gpio_reset)) { err =devm_gpio_request_one (dev, hub->gpio_reset,GPIOF_OUT_INIT_LOW ,"usb3503 reset" ); +/* Datasheet defines a hardware reset to be at least 100us */ +usleep_range (100 ,10000 );if (err) { dev_err(dev, "unable to request GPIO %d as reset pin (%d)\n",
drivers/usb/mon/mon_bin.c +7 -1
@@ -1001,7 +1001,9 @@ static long mon_bin_ioctl(struct file *file, unsigned int cmd, unsigned long argbreak ;case MON_IOCQ_RING_SIZE : +mutex_lock (&rp->fetch_lock); ret = rp->b_size; +mutex_unlock (&rp->fetch_lock);break ;case MON_IOCT_RING_SIZE :
@@ -1228,12 +1230,16 @@ static int mon_bin_vma_fault(struct vm_area_struct *vma, struct vm_fault *vmf)unsigned long offset, chunk_idx;struct page *pageptr; +mutex_lock (&rp->fetch_lock); offset = vmf->pgoff <<PAGE_SHIFT ; -if (offset >= rp->b_size) +if (offset >= rp->b_size) { +mutex_unlock (&rp->fetch_lock);return VM_FAULT_SIGBUS ; + } chunk_idx = offset /CHUNK_SIZE ; pageptr = rp->b_vec[chunk_idx].pg;get_page (pageptr); +mutex_unlock (&rp->fetch_lock); vmf->page = pageptr;return 0 ; }
drivers/usb/musb/ux500.c +5 -2
@@ -348,7 +348,9 @@ static int ux500_suspend(struct device *dev)struct ux500_glue *glue =dev_get_drvdata (dev);struct musb *musb =glue_to_musb (glue); -usb_phy_set_suspend (musb->xceiv,1 ); +if (musb) +usb_phy_set_suspend (musb->xceiv,1 ); +clk_disable_unprepare (glue->clk);return 0 ;
@@ -366,7 +368,8 @@ static int ux500_resume(struct device *dev)return ret; } -usb_phy_set_suspend (musb->xceiv,0 ); +if (musb) +usb_phy_set_suspend (musb->xceiv,0 );return 0 ; }
drivers/usb/serial/cp210x.c +2 -0
@@ -120,6 +120,7 @@ static const struct usb_device_id id_table[] = { { USB_DEVICE(0x10C4, 0x8470) }, /* Juniper Networks BX Series System Console */ { USB_DEVICE(0x10C4, 0x8477) }, /* Balluff RFID */ { USB_DEVICE(0x10C4, 0x84B6) }, /* Starizona Hyperion */ + { USB_DEVICE(0x10C4, 0x85A7) }, /* LifeScan OneTouch Verio IQ */ { USB_DEVICE(0x10C4, 0x85EA) }, /* AC-Services IBUS-IF */ { USB_DEVICE(0x10C4, 0x85EB) }, /* AC-Services CIS-IBUS */ { USB_DEVICE(0x10C4, 0x85F8) }, /* Virtenio Preon32 */
@@ -170,6 +171,7 @@ static const struct usb_device_id id_table[] = { { USB_DEVICE(0x1843, 0x0200) }, /* Vaisala USB Instrument Cable */ { USB_DEVICE(0x18EF, 0xE00F) }, /* ELV USB-I2C-Interface */ { USB_DEVICE(0x18EF, 0xE025) }, /* ELV Marble Sound Board 1 */ + { USB_DEVICE(0x18EF, 0xE030) }, /* ELV ALC 8xxx Battery Charger */ { USB_DEVICE(0x18EF, 0xE032) }, /* ELV TFD500 Data Logger */ { USB_DEVICE(0x1901, 0x0190) }, /* GE B850 CP2105 Recorder interface */ { USB_DEVICE(0x1901, 0x0193) }, /* GE B650 CP2104 PMC interface */
drivers/usb/storage/unusual_uas.h +7 -0
@@ -155,6 +155,13 @@ UNUSUAL_DEV(0x2109, 0x0711, 0x0000, 0x9999, USB_SC_DEVICE, USB_PR_DEVICE, NULL, US_FL_NO_ATA_1X), +/* Reported-by: Icenowy Zheng <[email protected]> */ +UNUSUAL_DEV (0x2537 ,0x1068 ,0x0000 ,0x9999 , +"Norelsys" , +"NS1068X" , +USB_SC_DEVICE ,USB_PR_DEVICE ,NULL , +US_FL_IGNORE_UAS ), +/* Reported-by: Takeo Nakayama <[email protected]> */ UNUSUAL_DEV(0x357d, 0x7788, 0x0000, 0x9999, "JMicron",
drivers/usb/usbip/usbip_common.c +3 -14
@@ -103,7 +103,7 @@ static void usbip_dump_usb_device(struct usb_device *udev)dev_dbg (dev," devnum(%d) devpath(%s) usb speed(%s)" , udev->devnum, udev->devpath,usb_speed_string (udev->speed)); -pr_debug ("tt %p, ttport %d\n" , udev->tt, udev->ttport); +pr_debug ("tt hub ttport %d\n" , udev->ttport);dev_dbg (dev," " );for (i =0 ; i <16 ; i++)
@@ -136,12 +136,8 @@ static void usbip_dump_usb_device(struct usb_device *udev) }pr_debug ("\n" ); -dev_dbg (dev,"parent %p, bus %p\n" , udev->parent, udev->bus); - -dev_dbg (dev, -"descriptor %p, config %p, actconfig %p, rawdescriptors %p\n" , - &udev->descriptor, udev->config, - udev->actconfig, udev->rawdescriptors); +dev_dbg (dev,"parent %s, bus %s\n" ,dev_name (&udev->parent->dev), + udev->bus->bus_name);dev_dbg (dev,"have_langid %d, string_langid %d\n" , udev->have_langid, udev->string_langid);
@@ -249,9 +245,6 @@ void usbip_dump_urb(struct urb *urb) dev = &urb->dev->dev; -dev_dbg (dev," urb :%p\n" , urb); -dev_dbg (dev," dev :%p\n" , urb->dev); -usbip_dump_usb_device (urb->dev);dev_dbg (dev," pipe :%08x " , urb->pipe);
@@ -260,11 +253,9 @@ void usbip_dump_urb(struct urb *urb)dev_dbg (dev," status :%d\n" , urb->status);dev_dbg (dev," transfer_flags :%08X\n" , urb->transfer_flags); -dev_dbg (dev," transfer_buffer :%p\n" , urb->transfer_buffer);dev_dbg (dev," transfer_buffer_length:%d\n" , urb->transfer_buffer_length);dev_dbg (dev," actual_length :%d\n" , urb->actual_length); -dev_dbg (dev," setup_packet :%p\n" , urb->setup_packet);if (urb->setup_packet &&usb_pipetype (urb->pipe) ==PIPE_CONTROL ) usbip_dump_usb_ctrlrequest(
@@ -274,8 +265,6 @@ void usbip_dump_urb(struct urb *urb)dev_dbg (dev," number_of_packets :%d\n" , urb->number_of_packets);dev_dbg (dev," interval :%d\n" , urb->interval);dev_dbg (dev," error_count :%d\n" , urb->error_count); -dev_dbg (dev," context :%p\n" , urb->context); -dev_dbg (dev," complete :%p\n" , urb->complete); }EXPORT_SYMBOL_GPL (usbip_dump_urb);
fs/locks.c +10 -6
@@ -2220,10 +2220,12 @@ int fcntl_setlk(unsigned int fd, struct file *filp, unsigned int cmd, error =do_lock_file_wait (filp, cmd, file_lock);/* -* Attempt to detect a close/fcntl race and recover by -* releasing the lock that was just acquired. +* Attempt to detect a close/fcntl race and recover by releasing the +* lock that was just acquired. There is no need to do that when we're +* unlocking though, or for OFD locks. */ -if (!error && file_lock->fl_type !=F_UNLCK ) { +if (!error && file_lock->fl_type !=F_UNLCK && + !(file_lock->fl_flags &FL_OFDLCK )) {/* * We need that spin_lock here - it prevents reordering between * update of i_flctx->flc_posix and check for it done in
@@ -2362,10 +2364,12 @@ int fcntl_setlk64(unsigned int fd, struct file *filp, unsigned int cmd, error =do_lock_file_wait (filp, cmd, file_lock);/* -* Attempt to detect a close/fcntl race and recover by -* releasing the lock that was just acquired. +* Attempt to detect a close/fcntl race and recover by releasing the +* lock that was just acquired. There is no need to do that when we're +* unlocking though, or for OFD locks. */ -if (!error && file_lock->fl_type !=F_UNLCK ) { +if (!error && file_lock->fl_type !=F_UNLCK && + !(file_lock->fl_flags &FL_OFDLCK )) {/* * We need that spin_lock here - it prevents reordering between * update of i_flctx->flc_posix and check for it done in
include/linux/bpf.h +2 -0
@@ -37,6 +37,7 @@ struct bpf_map {u32 value_size;u32 max_entries;u32 pages; +bool unpriv_array;struct user_struct *user;const struct bpf_map_ops *ops;struct work_struct work;
@@ -141,6 +142,7 @@ struct bpf_prog_aux {struct bpf_array {struct bpf_map map;u32 elem_size; +u32 index_mask;/* 'ownership' of prog_array is claimed by the first program that * is going to use this map or by the first program which FD is stored * in the map to make sure that all callers and callees have the same
include/linux/cpu.h +7 -0
@@ -40,6 +40,13 @@ extern void cpu_remove_dev_attr(struct device_attribute *attr);extern int cpu_add_dev_attr_group (struct attribute_group *attrs);extern void cpu_remove_dev_attr_group (struct attribute_group *attrs); +extern ssize_t cpu_show_meltdown (struct device *dev, +struct device_attribute *attr,char *buf); +extern ssize_t cpu_show_spectre_v1 (struct device *dev, +struct device_attribute *attr,char *buf); +extern ssize_t cpu_show_spectre_v2 (struct device *dev, +struct device_attribute *attr,char *buf); + extern __printf(4, 5) struct device *cpu_device_create(struct device *parent, void *drvdata, const struct attribute_group **groups,
include/linux/filter.h +3 -0
@@ -466,6 +466,9 @@ u64 __bpf_call_base(u64 r1, u64 r2, u64 r3, u64 r4, u64 r5);void bpf_int_jit_compile (struct bpf_prog *fp);bool bpf_helper_changes_skb_data (void *func); +struct bpf_prog *bpf_patch_insn_single (struct bpf_prog *prog,u32 off, +const struct bpf_insn *patch,u32 len); +#ifdef CONFIG_BPF_JIT typedef void (*bpf_jit_fill_hole_t )(void *area,unsigned int size);
include/linux/phy.h +11 -0
@@ -682,6 +682,17 @@ static inline bool phy_is_internal(struct phy_device *phydev)return phydev->is_internal; } +/** +* phy_interface_mode_is_rgmii - Convenience function for testing if a +* PHY interface mode is RGMII (all variants) +* @mode: the phy_interface_t enum +*/ +static inline bool phy_interface_mode_is_rgmii (phy_interface_t mode) +{ +return mode >=PHY_INTERFACE_MODE_RGMII && + mode <=PHY_INTERFACE_MODE_RGMII_TXID ; +}; +/** * phy_interface_is_rgmii - Convenience function for testing if a PHY interface * is RGMII (all variants)
include/linux/sh_eth.h +0 -1
@@ -16,7 +16,6 @@ struct sh_eth_plat_data {unsigned char mac_addr[ETH_ALEN ]; unsigned no_ether_link:1; unsigned ether_link_active_low:1; - unsigned needs_init:1; };#endif
include/target/target_core_base.h +1 -0
@@ -496,6 +496,7 @@ struct se_cmd {#define CMD_T_BUSY (1 << 9)#define CMD_T_TAS (1 << 10)#define CMD_T_FABRIC_STOP (1 << 11) +#define CMD_T_PRE_EXECUTE (1 << 12)spinlock_t t_state_lock;struct kref cmd_kref;struct completion t_transport_stop_comp;
include/trace/events/kvm.h +5 -2
@@ -204,7 +204,7 @@ TRACE_EVENT(kvm_ack_irq, { KVM_TRACE_MMIO_WRITE, "write" } TRACE_EVENT(kvm_mmio, - TP_PROTO(int type, int len, u64 gpa, u64 val), + TP_PROTO(int type, int len, u64 gpa, void *val), TP_ARGS(type, len, gpa, val), TP_STRUCT__entry(
@@ -218,7 +218,10 @@ TRACE_EVENT(kvm_mmio, __entry->type = type; __entry->len = len; __entry->gpa = gpa; - __entry->val = val; + __entry->val =0 ; +if (val) +memcpy (&__entry->val, val, +min_t (u32,sizeof (__entry->val), len)); ), TP_printk("mmio %s len %u gpa 0x%llx val 0x%llx",
kernel/bpf/arraymap.c +32 -5
@@ -20,8 +20,10 @@/* Called from syscall */ static struct bpf_map *array_map_alloc (union bpf_attr *attr) { +u32 elem_size, array_size, index_mask, max_entries; +bool unpriv = !capable (CAP_SYS_ADMIN );struct bpf_array *array; -u32 elem_size, array_size; +u64 mask64;/* check sanity of attributes */ if (attr->max_entries == 0 || attr->key_size != 4 ||
@@ -36,12 +38,33 @@ static struct bpf_map *array_map_alloc(union bpf_attr *attr) elem_size =round_up (attr->value_size,8 ); + max_entries = attr->max_entries; + +/* On 32 bit archs roundup_pow_of_two() with max_entries that has +* upper most bit set in u32 space is undefined behavior due to +* resulting 1U << 32, so do it manually here in u64 space. +*/ + mask64 =fls_long (max_entries -1 ); + mask64 =1ULL << mask64; + mask64 -=1 ; + + index_mask = mask64; +if (unpriv) { +/* round up array size to nearest power of 2, +* since cpu will speculate within index_mask limits +*/ + max_entries = index_mask +1 ; +/* Check for overflows. */ +if (max_entries < attr->max_entries) +return ERR_PTR (-E2BIG ); + } +/* check round_up into zero and u32 overflow */ if (elem_size ==0 || - attr->max_entries > (U32_MAX -PAGE_SIZE -sizeof (*array)) / elem_size) + max_entries > (U32_MAX -PAGE_SIZE -sizeof (*array)) / elem_size)return ERR_PTR (-ENOMEM ); - array_size =sizeof (*array) + attr->max_entries * elem_size; + array_size =sizeof (*array) + max_entries * elem_size;/* allocate all map elements and zero-initialize them */ array =kzalloc (array_size,GFP_USER | __GFP_NOWARN);
@@ -50,6 +73,8 @@ static struct bpf_map *array_map_alloc(union bpf_attr *attr)if (!array)return ERR_PTR (-ENOMEM ); } + array->index_mask = index_mask; + array->map.unpriv_array = unpriv;/* copy mandatory map attributes */ array->map.key_size = attr->key_size;
@@ -70,7 +95,7 @@ static void *array_map_lookup_elem(struct bpf_map *map, void *key)if (index >= array->map.max_entries)return NULL ; -return array->value + array->elem_size * index; +return array->value + array->elem_size * (index & array->index_mask); }/* Called from syscall */
@@ -111,7 +136,9 @@ static int array_map_update_elem(struct bpf_map *map, void *key, void *value,/* all elements already exist */ return -EEXIST ; -memcpy (array->value + array->elem_size * index, value, map->value_size); +memcpy (array->value + + array->elem_size * (index & array->index_mask), + value, map->value_size);return 0 ; }
kernel/bpf/core.c +71 -0
77 lines not on this page · raw message
kernel/bpf/syscall.c +0 -54
66 lines not on this page · raw message
kernel/bpf/verifier.c +157 -60
354 lines not on this page · raw message
kernel/futex.c +6 -2
@@ -1939,8 +1939,12 @@ static int unqueue_me(struct futex_q *q)/* In the common case we don't take the spinlock, which is nice. */ retry: - lock_ptr = q->lock_ptr; -barrier (); +/* +* q->lock_ptr can change between this read and the following spin_lock. +* Use READ_ONCE to forbid the compiler from reloading q->lock_ptr and +* optimizing lock_ptr out of the logic below. +*/ + lock_ptr =READ_ONCE (q->lock_ptr);if (lock_ptr !=NULL ) {spin_lock (lock_ptr);/*
kernel/locking/mutex.c +3 -2
@@ -719,6 +719,7 @@ static inline void __mutex_unlock_common_slowpath(struct mutex *lock, int nested) {unsigned long flags; +WAKE_Q (wake_q);/* * As a performance measurement, release the lock before doing other
@@ -746,11 +747,11 @@ __mutex_unlock_common_slowpath(struct mutex *lock, int nested) struct mutex_waiter, list);debug_mutex_wake_waiter (lock, waiter); - -wake_up_process (waiter->task); +wake_q_add (&wake_q, waiter->task); }spin_unlock_mutex (&lock->wait_lock, flags); +wake_up_q (&wake_q); }/*
mm/compaction.c +35 -15
133 lines not on this page · raw message
mm/page-writeback.c +6 -5
@@ -1162,6 +1162,7 @@ static void wb_update_dirty_ratelimit(struct dirty_throttle_control *dtc,unsigned long balanced_dirty_ratelimit;unsigned long step;unsigned long x; +unsigned long shift;/* * The dirty rate will match the writeout rate in long term, except
@@ -1286,11 +1287,11 @@ static void wb_update_dirty_ratelimit(struct dirty_throttle_control *dtc,* rate itself is constantly fluctuating. So decrease the track speed * when it gets close to the target. Helps eliminate pointless tremors. */ - step >>= dirty_ratelimit / (2 * step +1 ); -/* -* Limit the tracking speed to avoid overshooting. -*/ - step = (step +7 ) /8 ; + shift = dirty_ratelimit / (2 * step +1 ); +if (shift <BITS_PER_LONG ) + step =DIV_ROUND_UP (step >> shift,8 ); +else + step =0 ;if (dirty_ratelimit < balanced_dirty_ratelimit) dirty_ratelimit += step;
mm/zswap.c +16 -8
@@ -123,7 +123,7 @@ struct zswap_pool {struct crypto_comp *__percpu *tfm;struct kref kref;struct list_head list; -struct rcu_head rcu_head; +struct work_struct work;struct notifier_block notifier;char tfm_name[CRYPTO_MAX_ALG_NAME ]; };
@@ -667,9 +667,11 @@ static int __must_check zswap_pool_get(struct zswap_pool *pool)return kref_get_unless_zero (&pool->kref); } -static void __zswap_pool_release (struct rcu_head *head) +static void __zswap_pool_release (struct work_struct *work) { -struct zswap_pool *pool =container_of (head,typeof (*pool), rcu_head); +struct zswap_pool *pool =container_of (work,typeof (*pool), work); + +synchronize_rcu ();/* nobody should have been able to get a kref... */ WARN_ON (kref_get_unless_zero (&pool->kref));
@@ -689,7 +691,9 @@ static void __zswap_pool_empty(struct kref *kref)WARN_ON (pool ==zswap_pool_current ());list_del_rcu (&pool->list); -call_rcu (&pool->rcu_head, __zswap_pool_release); + +INIT_WORK (&pool->work, __zswap_pool_release); +schedule_work (&pool->work);spin_unlock (&zswap_pools_lock); }
@@ -748,18 +752,22 @@ static int __zswap_param_set(const char *val, const struct kernel_param *kp, pool =zswap_pool_find_get (type, compressor);if (pool) {zswap_pool_debug ("using existing" , pool); +WARN_ON (pool ==zswap_pool_current ());list_del_rcu (&pool->list); - }else { -spin_unlock (&zswap_pools_lock); - pool =zswap_pool_create (type, compressor); -spin_lock (&zswap_pools_lock); } +spin_unlock (&zswap_pools_lock); + +if (!pool) + pool =zswap_pool_create (type, compressor); +if (pool) ret =param_set_charp (s, kp);else ret = -EINVAL ; +spin_lock (&zswap_pools_lock); +if (!ret) { put_pool =zswap_pool_current ();list_add_rcu (&pool->list, &zswap_pools);
net/8021q/vlan.c +1 -6
@@ -111,12 +111,7 @@ void unregister_vlan_dev(struct net_device *dev, struct list_head *head)vlan_gvrp_uninit_applicant (real_dev); } -/* Take it out of our own structures, but be sure to interlock with -* HW accelerating devices or SW vlan input packet processing if -* VLAN is not 0 (leave it there for 802.1p). -*/ -if (vlan_id) -vlan_vid_del (real_dev, vlan->vlan_proto, vlan_id); +vlan_vid_del (real_dev, vlan->vlan_proto, vlan_id);/* Get rid of the vlan's reference to real_dev */ dev_put (real_dev);
net/bluetooth/l2cap_core.c +11 -9
@@ -3342,9 +3342,10 @@ static int l2cap_parse_conf_req(struct l2cap_chan *chan, void *data, size_t databreak ;case L2CAP_CONF_EFS : - remote_efs =1 ; -if (olen ==sizeof (efs)) +if (olen ==sizeof (efs)) { + remote_efs =1 ;memcpy (&efs, (void *) val, olen); + }break ;case L2CAP_CONF_EWS :
@@ -3563,16 +3564,17 @@ static int l2cap_parse_conf_rsp(struct l2cap_chan *chan, void *rsp, int len,break ;case L2CAP_CONF_EFS : -if (olen ==sizeof (efs)) +if (olen ==sizeof (efs)) {memcpy (&efs, (void *)val, olen); -if (chan->local_stype !=L2CAP_SERV_NOTRAFIC && - efs.stype !=L2CAP_SERV_NOTRAFIC && - efs.stype != chan->local_stype) -return -ECONNREFUSED ; +if (chan->local_stype !=L2CAP_SERV_NOTRAFIC && + efs.stype !=L2CAP_SERV_NOTRAFIC && + efs.stype != chan->local_stype) +return -ECONNREFUSED ; -l2cap_add_conf_opt (&ptr,L2CAP_CONF_EFS ,sizeof (efs), - (unsigned long ) &efs, endptr - ptr); +l2cap_add_conf_opt (&ptr,L2CAP_CONF_EFS ,sizeof (efs), + (unsigned long ) &efs, endptr - ptr); + }break ;case L2CAP_CONF_FCS :
net/core/sock_diag.c +1 -1
@@ -289,7 +289,7 @@ static int sock_diag_bind(struct net *net, int group)case SKNLGRP_INET6_UDP_DESTROY :if (!sock_diag_handlers[AF_INET6 ])request_module ("net-pf-%d-proto-%d-type-%d" ,PF_NETLINK , -NETLINK_SOCK_DIAG ,AF_INET ); +NETLINK_SOCK_DIAG ,AF_INET6 );break ; }return 0 ;
net/ipv6/ip6_output.c +3 -1
@@ -1785,8 +1785,10 @@ struct sk_buff *ip6_make_skb(struct sock *sk, cork.base.opt =NULL ; v6_cork.opt =NULL ; err =ip6_setup_cork (sk, &cork, &v6_cork, hlimit, tclass, opt, rt, fl6); -if (err) +if (err) { +ip6_cork_release (&cork, &v6_cork);return ERR_PTR (err); + }if (dontfrag <0 ) dontfrag =inet6_sk (sk)->dontfrag;
net/ipv6/ip6_tunnel.c +5 -4
@@ -1083,10 +1083,11 @@ static int ip6_tnl_xmit2(struct sk_buff *skb,memcpy (&fl6->daddr, addr6,sizeof (fl6->daddr));neigh_release (neigh); } - }else if (!(t->parms.flags & - (IP6_TNL_F_USE_ORIG_TCLASS |IP6_TNL_F_USE_ORIG_FWMARK ))) { -/* enable the cache only only if the routing decision does -* not depend on the current inner header value + }else if (t->parms.proto !=0 && !(t->parms.flags & + (IP6_TNL_F_USE_ORIG_TCLASS | +IP6_TNL_F_USE_ORIG_FWMARK ))) { +/* enable the cache only if neither the outer protocol nor the +* routing decision depends on the current inner header value */ use_cache = true; }
net/mac80211/debugfs.c +2 -5
@@ -91,7 +91,7 @@ static const struct file_operations reset_ops = { };#endif -static const char *hw_flag_names[NUM_IEEE80211_HW_FLAGS +1 ] = { +static const char *hw_flag_names[] = { #define FLAG(F) [IEEE80211_HW_##F] = #F FLAG(HAS_RATE_CONTROL), FLAG(RX_INCLUDES_FCS),
@@ -125,9 +125,6 @@ static const char *hw_flag_names[NUM_IEEE80211_HW_FLAGS + 1] = {FLAG (TDLS_WIDER_BW ),FLAG (SUPPORTS_AMSDU_IN_AMPDU ),FLAG (BEACON_TX_STATUS ), - -/* keep last for the build bug below */ - (void *)0x1 #undef FLAG };
@@ -147,7 +144,7 @@ static ssize_t hwflags_read(struct file *file, char __user *user_buf,/* fail compilation if somebody adds or removes * a flag without updating the name array above */ -BUILD_BUG_ON (hw_flag_names[NUM_IEEE80211_HW_FLAGS ] != (void *)0x1 ); +BUILD_BUG_ON (ARRAY_SIZE (hw_flag_names) !=NUM_IEEE80211_HW_FLAGS );for (i =0 ; i <NUM_IEEE80211_HW_FLAGS ; i++) {if (test_bit (i, local->hw.flags))
net/rds/rdma.c +4 -0
@@ -517,6 +517,9 @@ int rds_rdma_extra_size(struct rds_rdma_args *args) local_vec = (struct rds_iovec __user *)(unsigned long ) args->local_vec_addr; +if (args->nr_local ==0 ) +return -EINVAL ; +/* figure out the number of pages in the vector */ for (i =0 ; i < args->nr_local; i++) { if (copy_from_user(&vec, &local_vec[i],
@@ -866,6 +869,7 @@ int rds_cmsg_atomic(struct rds_sock *rs, struct rds_message *rm, err:if (page)put_page (page); + rm->atomic.op_active =0 ;kfree (rm->atomic.op_notifier);return ret;
sound/core/oss/pcm_oss.c +27 -14
44 lines not on this page · raw message
sound/drivers/aloop.c +50 -48
98 lines not on this page · raw message
tools/testing/selftests/x86/test_vsyscall.c new file +500 -0
500 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.