Linux 4.14.97
Greg KH
maintainerI'm announcing the release of the 4.14.97 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
------------
Makefile | 2 arch/arc/include/asm/perf_event.h | 3 arch/arc/lib/memset-archs.S | 40 +++- arch/arc/mm/init.c | 3 arch/s390/kernel/early.c | 4 arch/s390/kernel/setup.c | 2 arch/s390/kernel/smp.c | 12 + arch/x86/entry/vdso/vma.c | 2 arch/x86/include/asm/mmu_context.h | 18 + arch/x86/include/asm/pvclock.h | 19 +- arch/x86/kernel/kvmclock.c | 7 arch/x86/kernel/pvclock.c | 14 + arch/x86/kvm/x86.c | 9 arch/x86/lib/kaslr.c | 4 arch/x86/xen/suspend.c | 4 arch/x86/xen/time.c | 118 ++++++++++++ arch/x86/xen/xen-ops.h | 2 drivers/acpi/nfit/core.c | 61 +++++- drivers/char/mwave/mwavedd.c | 7 drivers/hv/hv_balloon.c | 10 - drivers/hv/ring_buffer.c | 31 +-- drivers/hv/vmbus_drv.c | 91 ++++++--- drivers/input/joystick/xpad.c | 3 drivers/input/misc/uinput.c | 5 drivers/irqchip/irq-gic-v3-its.c | 25 +- drivers/md/dm-crypt.c | 25 +- drivers/md/dm-thin-metadata.c | 4 drivers/md/dm-thin-metadata.h | 2 drivers/md/dm-thin.c | 10 - drivers/misc/mei/hw-me-regs.h | 2 drivers/misc/mei/pci-me.c | 2 drivers/mmc/host/Kconfig | 1 drivers/net/can/dev.c | 27 +- drivers/net/ethernet/amd/xgbe/xgbe-common.h | 2 drivers/net/ethernet/amd/xgbe/xgbe-dev.c | 22 +- drivers/net/ethernet/stmicro/stmmac/common.h | 3 drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c | 15 - drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 22 ++ drivers/net/phy/mdio_bus.c | 1 drivers/net/ppp/pppoe.c | 1 drivers/nvme/target/rdma.c | 17 + drivers/ptp/ptp_kvm.c | 5 drivers/s390/char/sclp_config.c | 2 drivers/staging/rtl8188eu/os_dep/usb_intf.c | 1 drivers/tty/n_hdlc.c | 1 drivers/tty/serial/serial_core.c | 12 - drivers/tty/tty_io.c | 3 drivers/tty/vt/vt.c | 1 drivers/usb/dwc3/gadget.c | 2 drivers/usb/host/xhci-mtk.c | 6 drivers/usb/host/xhci-pci.c | 1 drivers/usb/host/xhci-plat.c | 6 drivers/usb/host/xhci-tegra.c | 1 drivers/usb/host/xhci.c | 2 drivers/usb/serial/pl2303.c | 1 drivers/usb/serial/pl2303.h | 2 drivers/usb/serial/usb-serial-simple.c | 3 drivers/vhost/net.c | 3 drivers/vhost/vhost.c | 97 ++++++++-- drivers/vhost/vhost.h | 3 drivers/xen/events/events_base.c | 2 fs/btrfs/dev-replace.c | 9 fs/cifs/cifssmb.c | 35 ++- fs/cifs/connect.c | 21 ++ fs/cifs/smb2ops.c | 62 ++++-- fs/f2fs/node.c | 4 include/linux/compiler-clang.h | 14 + include/linux/compiler-gcc.h | 4 include/linux/compiler-intel.h | 4 include/linux/hyperv.h | 5 include/linux/overflow.h | 205 ++++++++++++++++++++++ include/linux/skbuff.h | 1 include/net/ip_fib.h | 2 include/xen/interface/vcpu.h | 42 ++++ kernel/time/posix-cpu-timers.c | 1 net/bridge/br_forward.c | 9 net/bridge/br_netfilter_ipv6.c | 1 net/bridge/netfilter/nft_reject_bridge.c | 1 net/can/bcm.c | 27 ++ net/ipv4/fib_frontend.c | 4 net/ipv4/fib_trie.c | 15 + net/ipv4/inet_fragment.c | 2 net/ipv4/ip_input.c | 1 net/ipv4/tcp.c | 2 net/openvswitch/flow_netlink.c | 2 net/sched/cls_api.c | 3 sound/pci/hda/patch_conexant.c | 1 sound/soc/codecs/rt5514-spi.c | 2 sound/soc/intel/atom/sst-mfld-platform-pcm.c | 8 tools/perf/util/unwind-libdw.c | 4 tools/testing/selftests/seccomp/seccomp_bpf.c | 61 ------ tools/testing/selftests/x86/protection_keys.c | 41 +++- 92 files changed, 1072 insertions(+), 327 deletions(-)
Alexander Popov (1):
KVM: x86: Fix single-step debugging
Anand Jain (1):
btrfs: dev-replace: go back to suspended state if target device is missing
Anthony Wong (1):
ALSA: hda - Add mute LED support for HP ProBook 470 G5
Charles Yeh (1):
USB: serial: pl2303: add new PID to support PL2303TB
Christian Borntraeger (1):
s390/early: improve machine detection
Cong Wang (1):
net_sched: refetch skb protocol for each filter
Dan Williams (2):
acpi/nfit: Block function zero DSMs
acpi/nfit: Fix command-supported detection
Daniel Drake (1):
x86/kaslr: Fix incorrect i8254 outb() parameters
Dave Hansen (2):
x86/pkeys: Properly copy pkey state at fork() x86/selftests/pkeys: Fork() to check for state being preserved
David Hildenbrand (1):
s390/smp: Fix calling smp_call_ipl_cpu() from ipl CPU
Dexuan Cui (1):
Drivers: hv: vmbus: Check for ring when getting debug info
Dmitry Torokhov (1):
Input: uinput - fix undefined behavior in uinput_validate_absinfo()
Eugeniy Paltsev (3):
ARCv2: lib: memeset: fix doing prefetchw outside of buffer
ARC: adjust memblock_reserve of kernel memory
ARC: perf: map generic branches to correct hardware condition
Gerald Schaefer (1):
s390/smp: fix CPU hotplug deadlock with CPU rescan
Greg Kroah-Hartman (2):
tty: Handle problem if line discipline does not have receive_buf Linux 4.14.97
Gustavo A. R. Silva (2):
ASoC: rt5514-spi: Fix potential NULL pointer dereference char/mwave: fix potential Spectre v1 vulnerability
Ido Schimmel (1):
net: ipv4: Fix memory leak in network namespace dismantle
Israel Rukshin (1):
nvmet-rdma: Add unlikely for response allocated check
Jack Pham (1):
usb: dwc3: gadget: Clear req->needs_extra_trb flag on cleanup
Jason Wang (1):
vhost: log dirty page correctly
Jeff Mahoney (1):
btrfs: fix error handling in btrfs_dev_replace_start
Joao Martins (4):
ptp_kvm: probe for kvm guest availability x86/pvclock: add setter for pvclock_pvti_cpu0_va x86/xen/time: set pvclock flags on xen_time_init() x86/xen/time: setup vcpu 0 time info page
Joe Thornber (1):
dm thin: fix passdown_double_checking_shared_status()
Jose Abreu (1):
net: stmmac: Use correct values in TQS/RQS fields
Juergen Gross (1):
xen: Fix x86 sched_clock() interface for xen
Kangjie Lu (1):
ASoC: atom: fix a missing check of snd_pcm_lib_malloc_pages
Lendacky, Thomas (1):
amd-xgbe: Fix mdio access for non-zero ports and clause 45 PHYs
Manfred Schlaegl (1):
can: dev: __can_get_echo_skb(): fix bogous check for non-existing skb by removing it
Marc Zyngier (1):
irqchip/gic-v3-its: Align PCI Multi-MSI allocation on their size
Martin Vuille (1):
perf unwind: Unwind with libdw doesn't take symfs into account
Mathias Nyman (1):
xhci: Fix leaking USB3 shared_hcd at xhci removal
Max Schulze (1):
USB: serial: simple: add Motorola Tetra TPG2200 device id
Michael Straube (1):
staging: rtl8188eu: Add device code for D-Link DWA-121 rev B1
Milan Broz (1):
dm crypt: fix parsing of extended IV arguments
Milian Wolff (1):
perf unwind: Take pgoff into account when reporting elf to libdwfl
Nicolas Pitre (1):
vt: invoke notifier on screen size change
Oliver Hartkopp (1):
can: bcm: check timer values before ktime conversion
Pan Bian (1):
f2fs: read page index before freeing
Paolo Abeni (1):
ipfrag: really prevent allocation on netns exit
Paul Fulghum (1):
tty/n_hdlc: fix __might_sleep warning
Pavel Shilovsky (4):
CIFS: Fix possible hang during async MTU reads and writes
CIFS: Fix credits calculations for reads with errors
CIFS: Fix credit calculation for encrypted reads with errors
CIFS: Do not reconnect TCP session in add_credits()
Pavel Tatashin (1):
x86/xen/time: Output xen sched_clock time from 0
Raju Rangoju (1):
nvmet-rdma: fix null dereference under heavy load
Rasmus Villemoes (1):
compiler.h: enable builtin overflow checkers and add fallback code
Ross Lagerwall (2):
net: Fix usage of pskb_trim_rcsum
openvswitch: Avoid OOB read when parsing flow nlattrs
Samir Virmani (1):
uart: Fix crash in uart_write and uart_put_char
Sasha Levin (1):
Revert "seccomp: add a selftest for get_metadata"
Sean Christopherson (1):
KVM: x86: Fix a 4.14 backport regression related to userspace/guest FPU
Thomas Gleixner (1):
posix-cpu-timers: Unbreak timer rearming
Thomas Petazzoni (1):
net: phy: mdio_bus: add missing device_del() in mdiobus_register() error handling
Tom Panfil (1):
Input: xpad - add support for SteelSeries Stratus Duo
Tomas Winkler (1):
mei: me: add denverton innovation engine device IDs
Vijay Viswanath (1):
mmc: Kconfig: Enable CONFIG_MMC_SDHCI_IO_ACCESSORS
Vitaly Kuznetsov (1):
hv_balloon: avoid touching uninitialized struct page during tail onlining
Willem de Bruijn (1):
tcp: allow MSG_ZEROCOPY transmission also in CLOSE_WAIT state
Yunjian Wang (1):
net: bridge: Fix ethernet header pointer before check skb forwardable
Greg KH
maintainerMakefile +1 -1
@@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 VERSION = 4 PATCHLEVEL = 14 -SUBLEVEL = 96 +SUBLEVEL = 97 EXTRAVERSION = NAME = Petit Gorille
arch/arc/include/asm/perf_event.h +2 -1
@@ -103,7 +103,8 @@ static const char * const arc_pmu_ev_hw_map[] = {/* counts condition */ [PERF_COUNT_HW_INSTRUCTIONS ] ="iall" , - [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = "ijmp", /* Excludes ZOL jumps */ + /* All jump instructions that are taken */ + [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = "ijmptak", [PERF_COUNT_ARC_BPOK ] ="bpok" ,/* NP-NT, PT-T, PNT-NT */ #ifdef CONFIG_ISA_ARCV2 [PERF_COUNT_HW_BRANCH_MISSES] = "bpmp",
arch/arc/lib/memset-archs.S +32 -8
@@ -7,11 +7,39 @@ */ #include <linux/linkage.h> +#include <asm/cache.h> -#undef PREALLOC_NOT_AVAIL +/* + * The memset implementation below is optimized to use prefetchw and prealloc + * instruction in case of CPU with 64B L1 data cache line (L1_CACHE_SHIFT == 6) + * If you want to implement optimized memset for other possible L1 data cache + * line lengths (32B and 128B) you should rewrite code carefully checking + * we don't call any prefetchw/prealloc instruction for L1 cache lines which + * don't belongs to memset area. + */ + +#if L1_CACHE_SHIFT == 6 + +.macro PREALLOC_INSTR reg, off + prealloc [\reg, \off] +.endm + +.macro PREFETCHW_INSTR reg, off + prefetchw [\reg, \off] +.endm + +#else + +.macro PREALLOC_INSTR +.endm + +.macro PREFETCHW_INSTR +.endm + +#endif ENTRY_CFI(memset) - prefetchw [r0] ; Prefetch the write location + PREFETCHW_INSTR r0, 0 ; Prefetch the first write location mov.f 0, r2 ;;; if size is zero jz.d [blink]
@@ -48,11 +76,8 @@ ENTRY_CFI(memset) lpnz @.Lset64bytes ;; LOOP START -#ifdef PREALLOC_NOT_AVAIL - prefetchw [r3, 64] ;Prefetch the next write location -#else - prealloc [r3, 64] -#endif + PREALLOC_INSTR r3, 64 ; alloc next line w/o fetching + #ifdef CONFIG_ARC_HAS_LL64 std.ab r4, [r3, 8] std.ab r4, [r3, 8]
@@ -85,7 +110,6 @@ ENTRY_CFI(memset) lsr.f lp_count, r2, 5 ;Last remaining max 124 bytes lpnz .Lset32bytes ;; LOOP START - prefetchw [r3, 32] ;Prefetch the next write location #ifdef CONFIG_ARC_HAS_LL64 std.ab r4, [r3, 8] std.ab r4, [r3, 8]
arch/arc/mm/init.c +2 -1
@@ -138,7 +138,8 @@ void __init setup_arch_memory(void)*/ memblock_add_node (low_mem_start, low_mem_sz,0 ); -memblock_reserve (low_mem_start,__pa (_end) - low_mem_start); +memblock_reserve (CONFIG_LINUX_LINK_BASE , +__pa (_end) -CONFIG_LINUX_LINK_BASE );#ifdef CONFIG_BLK_DEV_INITRD if (initrd_start)
arch/s390/kernel/early.c +2 -2
@@ -226,10 +226,10 @@ static noinline __init void detect_machine_type(void)if (stsi (vmms,3 ,2 ,2 ) || !vmms->count)return ; -/* Running under KVM? If not we assume z/VM */ +/* Detect known hypervisors */ if (!memcmp (vmms->vm[0 ].cpi,"\xd2\xe5\xd4" ,3 )) S390_lowcore.machine_flags |=MACHINE_FLAG_KVM ; -else +else if (!memcmp (vmms->vm[0 ].cpi,"\xa9\x61\xe5\xd4" ,4 )) S390_lowcore.machine_flags |=MACHINE_FLAG_VM ; }
arch/s390/kernel/setup.c +2 -0
@@ -884,6 +884,8 @@ void __init setup_arch(char **cmdline_p)pr_info ("Linux is running under KVM in 64-bit mode\n" ); else if (MACHINE_IS_LPAR) pr_info("Linux is running natively in 64-bit mode\n"); + else + pr_info("Linux is running as a guest in 64-bit mode\n");/* Have one command line that is parsed and saved in /proc/cmdline */ /* boot_command_line has been already set up in early.c */
arch/s390/kernel/smp.c +10 -2
@@ -387,9 +387,13 @@ void smp_call_online_cpu(void (*func)(void *), void *data)*/ void smp_call_ipl_cpu (void (*func)(void *),void *data) { +struct lowcore *lc = pcpu_devices->lowcore; + +if (pcpu_devices[0 ].address ==stap ()) + lc = &S390_lowcore; +pcpu_delegate (&pcpu_devices[0 ], func, data, - pcpu_devices->lowcore->panic_stack - -PANIC_FRAME_OFFSET +PAGE_SIZE ); + lc->panic_stack -PANIC_FRAME_OFFSET +PAGE_SIZE ); }int smp_find_processor_id (u16 address)
@@ -1168,7 +1172,11 @@ static ssize_t __ref rescan_store(struct device *dev, {int rc; + rc =lock_device_hotplug_sysfs (); +if (rc) +return rc; rc =smp_rescan_cpus (); +unlock_device_hotplug ();return rc ? rc : count; } static DEVICE_ATTR(rescan, 0200, NULL, rescan_store);
arch/x86/entry/vdso/vma.c +1 -1
@@ -112,7 +112,7 @@ static int vvar_fault(const struct vm_special_mapping *sm, __pa_symbol(&__vvar_page) >> PAGE_SHIFT); }else if (sym_offset == image->sym_pvclock_page) {struct pvclock_vsyscall_time_info *pvti = -pvclock_pvti_cpu0_va (); +pvclock_get_pvti_cpu0_va ();if (pvti &&vclock_was_used (VCLOCK_PVCLOCK )) { ret = vm_insert_pfn( vma,
arch/x86/include/asm/mmu_context.h +18 -0
@@ -182,6 +182,10 @@ static inline void switch_ldt(struct mm_struct *prev, struct mm_struct *next)void enter_lazy_tlb (struct mm_struct *mm,struct task_struct *tsk); +/* +* Init a new mm. Used on mm copies, like at fork() +* and on mm's that are brand-new, like at execve(). +*/ static inline int init_new_context (struct task_struct *tsk,struct mm_struct *mm) {
@@ -232,8 +236,22 @@ do { \ } while (0)#endif +static inline void arch_dup_pkeys (struct mm_struct *oldmm, +struct mm_struct *mm) +{ +#ifdef CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS +if (!cpu_feature_enabled (X86_FEATURE_OSPKE )) +return ; + +/* Duplicate the oldmm pkey state in mm: */ + mm->context.pkey_allocation_map = oldmm->context.pkey_allocation_map; + mm->context.execute_only_pkey = oldmm->context.execute_only_pkey; +#endif +} +static inline int arch_dup_mmap (struct mm_struct *oldmm,struct mm_struct *mm) { +arch_dup_pkeys (oldmm, mm);paravirt_arch_dup_mmap (oldmm, mm);return ldt_dup_context (oldmm, mm); }
arch/x86/include/asm/pvclock.h +10 -9
@@ -5,15 +5,6 @@#include <linux/clocksource.h> #include <asm/pvclock-abi.h> -#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 ) -{ -return NULL ; -} -#endif -/* some helper functions for xen and kvm pv clock sources */ u64 pvclock_clocksource_read (struct pvclock_vcpu_time_info *src);u8 pvclock_read_flags (struct pvclock_vcpu_time_info *src);
@@ -102,4 +93,14 @@ struct pvclock_vsyscall_time_info {#define PVTI_SIZE sizeof(struct pvclock_vsyscall_time_info) +#ifdef CONFIG_PARAVIRT_CLOCK +void pvclock_set_pvti_cpu0_va (struct pvclock_vsyscall_time_info *pvti); +struct pvclock_vsyscall_time_info *pvclock_get_pvti_cpu0_va (void ); +#else +static inline struct pvclock_vsyscall_time_info *pvclock_get_pvti_cpu0_va (void ) +{ +return NULL ; +} +#endif +#endif /* _ASM_X86_PVCLOCK_H */
arch/x86/kernel/kvmclock.c +1 -6
@@ -47,12 +47,6 @@ early_param("no-kvmclock", parse_no_kvmclock);static struct pvclock_vsyscall_time_info *hv_clock;static struct pvclock_wall_clock wall_clock; -struct pvclock_vsyscall_time_info *pvclock_pvti_cpu0_va (void ) -{ -return hv_clock; -} -EXPORT_SYMBOL_GPL (pvclock_pvti_cpu0_va); -/* * The wallclock is the time of day when we booted. Since then, some time may * have elapsed since the hypervisor wrote the data. So we try to account for
@@ -335,6 +329,7 @@ int __init kvm_setup_vsyscall_timeinfo(void)return 1 ; } +pvclock_set_pvti_cpu0_va (hv_clock);put_cpu (); kvm_clock.archdata.vclock_mode =VCLOCK_PVCLOCK ;
arch/x86/kernel/pvclock.c +14 -0
@@ -25,8 +25,10 @@#include <asm/fixmap.h> #include <asm/pvclock.h> +#include <asm/vgtod.h> static u8 valid_flags__read_mostly =0 ; +static struct pvclock_vsyscall_time_info *pvti_cpu0_va__read_mostly ;void pvclock_set_flags (u8 flags) {
@@ -144,3 +146,15 @@ void pvclock_read_wallclock(struct pvclock_wall_clock *wall_clock,set_normalized_timespec (ts, now.tv_sec, now.tv_nsec); } + +void pvclock_set_pvti_cpu0_va (struct pvclock_vsyscall_time_info *pvti) +{ +WARN_ON (vclock_was_used (VCLOCK_PVCLOCK )); + pvti_cpu0_va = pvti; +} + +struct pvclock_vsyscall_time_info *pvclock_get_pvti_cpu0_va (void ) +{ +return pvti_cpu0_va; +} +EXPORT_SYMBOL_GPL (pvclock_get_pvti_cpu0_va);
arch/x86/kvm/x86.c +2 -7
@@ -5923,8 +5923,7 @@ int x86_emulate_instruction(struct kvm_vcpu *vcpu,toggle_interruptibility (vcpu, ctxt->interruptibility); vcpu->arch.emulate_regs_need_sync_to_vcpu = false;kvm_rip_write (vcpu, ctxt->eip); -if (r ==EMULATE_DONE && - (ctxt->tf || (vcpu->guest_debug &KVM_GUESTDBG_SINGLESTEP ))) +if (r ==EMULATE_DONE && ctxt->tf)kvm_vcpu_do_singlestep (vcpu, &r);if (!ctxt->have_exception ||exception_type (ctxt->exception.vector) ==EXCPT_TRAP )
@@ -7423,14 +7422,12 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) } } -kvm_load_guest_fpu (vcpu); -if (unlikely (vcpu->arch.complete_userspace_io)) {int (*cui)(struct kvm_vcpu *) = vcpu->arch.complete_userspace_io; vcpu->arch.complete_userspace_io =NULL ; r =cui (vcpu);if (r <=0 ) - goto out_fpu; + goto out; }else WARN_ON (vcpu->arch.pio.count || vcpu->mmio_needed);
@@ -7439,8 +7436,6 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)else r =vcpu_run (vcpu); -out_fpu: -kvm_put_guest_fpu (vcpu); out:kvm_put_guest_fpu (vcpu);post_kvm_run_save (vcpu);
arch/x86/lib/kaslr.c +2 -2
@@ -36,8 +36,8 @@ static inline u16 i8254(void)u16 status, timer; do { - outb(I8254_PORT_CONTROL, - I8254_CMD_READBACK | I8254_SELECT_COUNTER0); + outb(I8254_CMD_READBACK | I8254_SELECT_COUNTER0, + I8254_PORT_CONTROL); status = inb(I8254_PORT_COUNTER0); timer = inb(I8254_PORT_COUNTER0); timer |= inb(I8254_PORT_COUNTER0) << 8;
arch/x86/xen/suspend.c +4 -0
@@ -22,6 +22,8 @@ static DEFINE_PER_CPU(u64, spec_ctrl);void xen_arch_pre_suspend (void ) { +xen_save_time_memory_area (); +if (xen_pv_domain ())xen_pv_pre_suspend (); }
@@ -32,6 +34,8 @@ void xen_arch_post_suspend(int cancelled)xen_pv_post_suspend (cancelled); elsexen_hvm_post_suspend (cancelled ); + +xen_restore_time_memory_area (); }static void xen_vcpu_notify_restore (void *data)
arch/x86/xen/time.c +115 -3
165 lines not on this page · raw message
arch/x86/xen/xen-ops.h +2 -0
@@ -70,6 +70,8 @@ void xen_setup_runstate_info(int cpu);void xen_teardown_timer (int cpu);u64 xen_clocksource_read (void );void xen_setup_cpu_clockevents (void ); +void xen_save_time_memory_area (void ); +void xen_restore_time_memory_area (void );void __init xen_init_time_ops (void );void __init xen_hvm_init_time_ops (void );
drivers/acpi/nfit/core.c +47 -14
102 lines not on this page · raw message
drivers/char/mwave/mwavedd.c +7 -0
@@ -59,6 +59,7 @@#include <linux/mutex.h> #include <linux/delay.h> #include <linux/serial_8250.h> +#include <linux/nospec.h> #include "smapi.h" #include "mwavedd.h" #include "3780i.h"
@@ -289,6 +290,8 @@ static long mwave_ioctl(struct file *file, unsigned int iocmd, ipcnum);return -EINVAL ; } + ipcnum =array_index_nospec (ipcnum, +ARRAY_SIZE (pDrvData->IPCs)); PRINTK_3(TRACE_MWAVE, "mwavedd::mwave_ioctl IOCTL_MW_REGISTER_IPC" " ipcnum %x entry usIntCount %x\n",
@@ -317,6 +320,8 @@ static long mwave_ioctl(struct file *file, unsigned int iocmd, " Invalid ipcnum %x\n", ipcnum);return -EINVAL ; } + ipcnum =array_index_nospec (ipcnum, +ARRAY_SIZE (pDrvData->IPCs)); PRINTK_3(TRACE_MWAVE, "mwavedd::mwave_ioctl IOCTL_MW_GET_IPC" " ipcnum %x, usIntCount %x\n",
@@ -383,6 +388,8 @@ static long mwave_ioctl(struct file *file, unsigned int iocmd, ipcnum);return -EINVAL ; } + ipcnum =array_index_nospec (ipcnum, +ARRAY_SIZE (pDrvData->IPCs));mutex_lock (&mwave_mutex);if (pDrvData->IPCs[ipcnum].bIsEnabled == true) { pDrvData->IPCs[ipcnum].bIsEnabled = false;
drivers/hv/hv_balloon.c +6 -4
@@ -846,12 +846,14 @@ static unsigned long handle_pg_range(unsigned long pg_start, pfn_cnt -= pgs_ol;/* * Check if the corresponding memory block is already -* online by checking its last previously backed page. -* In case it is we need to bring rest (which was not -* backed previously) online too. +* online. It is possible to observe struct pages still +* being uninitialized here so check section instead. +* In case the section is online we need to bring the +* rest of pfns (which were not backed previously) +* online too. */ if (start_pfn > has->start_pfn && - !PageReserved (pfn_to_page (start_pfn -1 ))) +online_section_nr (pfn_to_section_nr (start_pfn)))hv_bring_pgs_online (has, start_pfn, pgs_ol); }
drivers/hv/ring_buffer.c +15 -16
@@ -141,26 +141,25 @@ static u32 hv_copyto_ringbuffer( }/* Get various debug metrics for the specified ring buffer. */ -void hv_ringbuffer_get_debuginfo (const struct hv_ring_buffer_info *ring_info, -struct hv_ring_buffer_debug_info *debug_info) +int hv_ringbuffer_get_debuginfo (const struct hv_ring_buffer_info *ring_info, +struct hv_ring_buffer_debug_info *debug_info) {u32 bytes_avail_towrite;u32 bytes_avail_toread; -if (ring_info->ring_buffer) { -hv_get_ringbuffer_availbytes (ring_info, - &bytes_avail_toread, - &bytes_avail_towrite); - - debug_info->bytes_avail_toread = bytes_avail_toread; - debug_info->bytes_avail_towrite = bytes_avail_towrite; - debug_info->current_read_index = - ring_info->ring_buffer->read_index; - debug_info->current_write_index = - ring_info->ring_buffer->write_index; - debug_info->current_interrupt_mask = - ring_info->ring_buffer->interrupt_mask; - } +if (!ring_info->ring_buffer) +return -EINVAL ; + +hv_get_ringbuffer_availbytes (ring_info, + &bytes_avail_toread, + &bytes_avail_towrite); + debug_info->bytes_avail_toread = bytes_avail_toread; + debug_info->bytes_avail_towrite = bytes_avail_towrite; + debug_info->current_read_index = ring_info->ring_buffer->read_index; + debug_info->current_write_index = ring_info->ring_buffer->write_index; + debug_info->current_interrupt_mask + = ring_info->ring_buffer->interrupt_mask; +return 0 ; }EXPORT_SYMBOL_GPL (hv_ringbuffer_get_debuginfo);
drivers/hv/vmbus_drv.c +61 -30
181 lines not on this page · raw message
drivers/input/joystick/xpad.c +3 -0
@@ -255,6 +255,8 @@ static const struct xpad_device { { 0x0f30, 0x0202, "Joytech Advanced Controller", 0, XTYPE_XBOX }, { 0x0f30, 0x8888, "BigBen XBMiniPad Controller", 0, XTYPE_XBOX }, { 0x102c, 0xff0c, "Joytech Wireless Advanced Controller", 0, XTYPE_XBOX }, + { 0x1038, 0x1430, "SteelSeries Stratus Duo", 0, XTYPE_XBOX360 }, + { 0x1038, 0x1431, "SteelSeries Stratus Duo", 0, XTYPE_XBOX360 }, { 0x11c9, 0x55f0, "Nacon GC-100XF", 0, XTYPE_XBOX360 }, { 0x12ab, 0x0004, "Honey Bee Xbox360 dancepad", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX360 }, { 0x12ab, 0x0301, "PDP AFTERGLOW AX.1", 0, XTYPE_XBOX360 },
@@ -431,6 +433,7 @@ static const struct usb_device_id xpad_table[] = {XPAD_XBOXONE_VENDOR (0x0e6f ),/* 0x0e6f X-Box One controllers */ XPAD_XBOX360_VENDOR (0x0f0d ),/* Hori Controllers */ XPAD_XBOXONE_VENDOR (0x0f0d ),/* Hori Controllers */ +XPAD_XBOX360_VENDOR (0x1038 ),/* SteelSeries Controllers */ XPAD_XBOX360_VENDOR (0x11c9 ),/* Nacon GC100XF */ XPAD_XBOX360_VENDOR (0x12ab ),/* X-Box 360 dance pads */ XPAD_XBOX360_VENDOR(0x1430), /* RedOctane X-Box 360 controllers */
drivers/input/misc/uinput.c +3 -2
@@ -39,6 +39,7 @@#include <linux/fs.h> #include <linux/miscdevice.h> #include <linux/uinput.h> +#include <linux/overflow.h> #include <linux/input/mt.h> #include "../input-compat.h"
@@ -356,7 +357,7 @@ static int uinput_open(struct inode *inode, struct file *file)static int uinput_validate_absinfo (struct input_dev *dev,unsigned int code,const struct input_absinfo *abs) { -int min, max; +int min, max, range; min = abs->minimum; max = abs->maximum;
@@ -368,7 +369,7 @@ static int uinput_validate_absinfo(struct input_dev *dev, unsigned int code,return -EINVAL ; } -if (abs->flat > max - min) { +if (!check_sub_overflow (max, min, &range) && abs->flat > range) {printk (KERN_DEBUG "%s: abs_flat #%02x out of range: %d (min:%d/max:%d)\n" ,UINPUT_NAME , code, abs->flat, min, max);
drivers/irqchip/irq-gic-v3-its.c +13 -12
@@ -2086,13 +2086,14 @@ static void its_free_device(struct its_device *its_dev)kfree (its_dev); } -static int its_alloc_device_irq (struct its_device *dev,irq_hw_number_t *hwirq) +static int its_alloc_device_irq (struct its_device *dev,int nvecs,irq_hw_number_t *hwirq) {int idx; - idx =find_first_zero_bit (dev->event_map.lpi_map, - dev->event_map.nr_lpis); -if (idx == dev->event_map.nr_lpis) + idx =bitmap_find_free_region (dev->event_map.lpi_map, + dev->event_map.nr_lpis, +get_count_order (nvecs)); +if (idx <0 )return -ENOSPC ; *hwirq = dev->event_map.lpi_base + idx;
@@ -2188,21 +2189,21 @@ static int its_irq_domain_alloc(struct irq_domain *domain, unsigned int virq,int err;int i; -for (i =0 ; i < nr_irqs; i++) { - err =its_alloc_device_irq (its_dev, &hwirq); -if (err) -return err; + err =its_alloc_device_irq (its_dev, nr_irqs, &hwirq); +if (err) +return err; - err =its_irq_gic_domain_alloc (domain, virq + i, hwirq); +for (i =0 ; i < nr_irqs; i++) { + err =its_irq_gic_domain_alloc (domain, virq + i, hwirq + i);if (err)return err;irq_domain_set_hwirq_and_chip (domain, virq + i, - hwirq, &its_irq_chip, its_dev); + hwirq + i, &its_irq_chip, its_dev);irqd_set_single_target (irq_desc_get_irq_data (irq_to_desc (virq + i)));pr_debug ("ID:%d pID:%d vID:%d\n" , - (int )(hwirq - its_dev->event_map.lpi_base), - (int ) hwirq, virq + i); + (int )(hwirq + i - its_dev->event_map.lpi_base), + (int )(hwirq + i), virq + i); }return 0 ;
drivers/md/dm-crypt.c +17 -8
@@ -2413,9 +2413,21 @@ static int crypt_ctr_cipher_new(struct dm_target *ti, char *cipher_in, char *key* capi:cipher_api_spec-iv:ivopts */ tmp = &cipher_in[strlen ("capi:" )]; - cipher_api =strsep (&tmp,"-" ); - *ivmode =strsep (&tmp,":" ); - *ivopts = tmp; + +/* Separate IV options if present, it can contain another '-' in hash name */ + *ivopts =strrchr (tmp,':' ); +if (*ivopts) { + **ivopts ='\0' ; + (*ivopts)++; + } +/* Parse IV mode */ + *ivmode =strrchr (tmp,'-' ); +if (*ivmode) { + **ivmode ='\0' ; + (*ivmode)++; + } +/* The rest is crypto API spec */ + cipher_api = tmp;if (*ivmode && !strcmp (*ivmode,"lmk" )) cc->tfms_count =64 ;
@@ -2485,11 +2497,8 @@ static int crypt_ctr_cipher_old(struct dm_target *ti, char *cipher_in, char *key goto bad_mem; chainmode =strsep (&tmp,"-" ); - *ivopts =strsep (&tmp,"-" ); - *ivmode =strsep (&*ivopts,":" ); - -if (tmp) -DMWARN ("Ignoring unexpected additional cipher options" ); + *ivmode =strsep (&tmp,":" ); + *ivopts = tmp;/* * For compatibility with the original dm-crypt mapping format, if
drivers/md/dm-thin-metadata.c +2 -2
@@ -1687,7 +1687,7 @@ int dm_thin_remove_range(struct dm_thin_device *td,return r; } -int dm_pool_block_is_used (struct dm_pool_metadata *pmd,dm_block_t b,bool *result) +int dm_pool_block_is_shared (struct dm_pool_metadata *pmd,dm_block_t b,bool *result) {int r;uint32_t ref_count;
@@ -1695,7 +1695,7 @@ int dm_pool_block_is_used(struct dm_pool_metadata *pmd, dm_block_t b, bool *resudown_read (&pmd->root_lock); r =dm_sm_get_count (pmd->data_sm, b, &ref_count);if (!r) - *result = (ref_count !=0 ); + *result = (ref_count >1 );up_read (&pmd->root_lock);return r;
drivers/md/dm-thin-metadata.h +1 -1
@@ -195,7 +195,7 @@ int dm_pool_get_metadata_dev_size(struct dm_pool_metadata *pmd,int dm_pool_get_data_dev_size (struct dm_pool_metadata *pmd,dm_block_t *result); -int dm_pool_block_is_used (struct dm_pool_metadata *pmd,dm_block_t b,bool *result); +int dm_pool_block_is_shared (struct dm_pool_metadata *pmd,dm_block_t b,bool *result);int dm_pool_inc_data_range (struct dm_pool_metadata *pmd,dm_block_t b,dm_block_t e);int dm_pool_dec_data_range (struct dm_pool_metadata *pmd,dm_block_t b,dm_block_t e);
drivers/md/dm-thin.c +5 -5
@@ -1042,7 +1042,7 @@ static void passdown_double_checking_shared_status(struct dm_thin_new_mapping *m* passdown we have to check that these blocks are now unused. */ int r =0 ; -bool used = true; +bool shared = true;struct thin_c *tc = m->tc;struct pool *pool = tc->pool;dm_block_t b = m->data_block, e, end = m->data_block + m->virt_end - m->virt_begin;
@@ -1052,11 +1052,11 @@ static void passdown_double_checking_shared_status(struct dm_thin_new_mapping *mwhile (b != end) {/* find start of unmapped run */ for (; b < end; b++) { - r =dm_pool_block_is_used (pool->pmd, b, &used); + r =dm_pool_block_is_shared (pool->pmd, b, &shared);if (r) goto out; -if (!used) +if (!shared)break ; }
@@ -1065,11 +1065,11 @@ static void passdown_double_checking_shared_status(struct dm_thin_new_mapping *m/* find end of run */ for (e = b +1 ; e != end; e++) { - r =dm_pool_block_is_used (pool->pmd, e, &used); + r =dm_pool_block_is_shared (pool->pmd, e, &shared);if (r) goto out; -if (used) +if (shared)break ; }
drivers/misc/mei/hw-me-regs.h +2 -0
@@ -127,6 +127,8 @@#define MEI_DEV_ID_BXT_M 0x1A9A/* Broxton M */ #define MEI_DEV_ID_APL_I 0x5A9A/* Apollo Lake I */ +#define MEI_DEV_ID_DNV_IE 0x19E5/* Denverton IE */ +#define MEI_DEV_ID_GLK 0x319A/* Gemini Lake */ #define MEI_DEV_ID_KBP 0xA2BA/* Kaby Point */
drivers/misc/mei/pci-me.c +2 -0
@@ -93,6 +93,8 @@ static const struct pci_device_id mei_me_pci_tbl[] = { {MEI_PCI_DEVICE(MEI_DEV_ID_BXT_M, MEI_ME_PCH8_CFG)}, {MEI_PCI_DEVICE(MEI_DEV_ID_APL_I, MEI_ME_PCH8_CFG)}, + {MEI_PCI_DEVICE(MEI_DEV_ID_DNV_IE, MEI_ME_PCH8_CFG)}, + {MEI_PCI_DEVICE(MEI_DEV_ID_GLK, MEI_ME_PCH8_CFG)}, {MEI_PCI_DEVICE(MEI_DEV_ID_KBP, MEI_ME_PCH8_CFG)},
drivers/mmc/host/Kconfig +1 -0
@@ -429,6 +429,7 @@ config MMC_SDHCI_MSM tristate "Qualcomm SDHCI Controller Support" depends on ARCH_QCOM || (ARM && COMPILE_TEST) depends on MMC_SDHCI_PLTFM + select MMC_SDHCI_IO_ACCESSORS help This selects the Secure Digital Host Controller Interface (SDHCI) support present in Qualcomm SOCs. The controller supports
drivers/net/can/dev.c +13 -14
@@ -479,8 +479,6 @@ EXPORT_SYMBOL_GPL(can_put_echo_skb);struct sk_buff *__can_get_echo_skb (struct net_device *dev,unsigned int idx,u8 *len_ptr) {struct can_priv *priv =netdev_priv (dev); -struct sk_buff *skb = priv->echo_skb[idx]; -struct canfd_frame *cf;if (idx >= priv->echo_skb_max) { netdev_err(dev, "%s: BUG! Trying to access can_priv::echo_skb out of bounds (%u/max %u)\n",
@@ -488,20 +486,21 @@ struct sk_buff *__can_get_echo_skb(struct net_device *dev, unsigned int idx, u8return NULL ; } -if (!skb) { -netdev_err (dev,"%s: BUG! Trying to echo non existing skb: can_priv::echo_skb[%u]\n" , - __func__, idx); -return NULL ; - } +if (priv->echo_skb[idx]) { +/* Using "struct canfd_frame::len" for the frame +* length is supported on both CAN and CANFD frames. +*/ +struct sk_buff *skb = priv->echo_skb[idx]; +struct canfd_frame *cf = (struct canfd_frame *)skb->data; +u8 len = cf->len; -/* Using "struct canfd_frame::len" for the frame -* length is supported on both CAN and CANFD frames. -*/ - cf = (struct canfd_frame *)skb->data; - *len_ptr = cf->len; - priv->echo_skb[idx] =NULL ; + *len_ptr = len; + priv->echo_skb[idx] =NULL ; -return skb; +return skb; + } + +return NULL ; }/*
drivers/net/ethernet/amd/xgbe/xgbe-common.h +0 -2
@@ -431,8 +431,6 @@#define MAC_MDIOSCAR_PA_WIDTH 5#define MAC_MDIOSCAR_RA_INDEX 0#define MAC_MDIOSCAR_RA_WIDTH 16 -#define MAC_MDIOSCAR_REG_INDEX 0 -#define MAC_MDIOSCAR_REG_WIDTH 21#define MAC_MDIOSCCDR_BUSY_INDEX 22#define MAC_MDIOSCCDR_BUSY_WIDTH 1#define MAC_MDIOSCCDR_CMD_INDEX 16
drivers/net/ethernet/amd/xgbe/xgbe-dev.c +16 -6
@@ -1284,6 +1284,20 @@ static void xgbe_write_mmd_regs(struct xgbe_prv_data *pdata, int prtad, } } +static unsigned int xgbe_create_mdio_sca (int port,int reg) +{ +unsigned int mdio_sca, da; + + da = (reg &MII_ADDR_C45 ) ? reg >>16 :0 ; + + mdio_sca =0 ; +XGMAC_SET_BITS (mdio_sca,MAC_MDIOSCAR ,RA , reg); +XGMAC_SET_BITS (mdio_sca,MAC_MDIOSCAR ,PA , port); +XGMAC_SET_BITS (mdio_sca,MAC_MDIOSCAR ,DA , da); + +return mdio_sca; +} +static int xgbe_write_ext_mii_regs (struct xgbe_prv_data *pdata,int addr,int reg,u16 val) {
@@ -1291,9 +1305,7 @@ static int xgbe_write_ext_mii_regs(struct xgbe_prv_data *pdata, int addr,reinit_completion (&pdata->mdio_complete); - mdio_sca =0 ; -XGMAC_SET_BITS (mdio_sca,MAC_MDIOSCAR ,REG , reg); -XGMAC_SET_BITS (mdio_sca,MAC_MDIOSCAR ,DA , addr); + mdio_sca =xgbe_create_mdio_sca (addr, reg);XGMAC_IOWRITE (pdata,MAC_MDIOSCAR , mdio_sca); mdio_sccd =0 ;
@@ -1317,9 +1329,7 @@ static int xgbe_read_ext_mii_regs(struct xgbe_prv_data *pdata, int addr,reinit_completion (&pdata->mdio_complete); - mdio_sca =0 ; -XGMAC_SET_BITS (mdio_sca,MAC_MDIOSCAR ,REG , reg); -XGMAC_SET_BITS (mdio_sca,MAC_MDIOSCAR ,DA , addr); + mdio_sca =xgbe_create_mdio_sca (addr, reg);XGMAC_IOWRITE (pdata,MAC_MDIOSCAR , mdio_sca); mdio_sccd =0 ;
drivers/net/ethernet/stmicro/stmmac/common.h +2 -1
@@ -444,7 +444,8 @@ struct stmmac_dma_ops { int rxfifosz);void (*dma_rx_mode)(void __iomem *ioaddr,int mode,u32 channel,int fifosz); -void (*dma_tx_mode)(void __iomem *ioaddr,int mode,u32 channel); +void (*dma_tx_mode)(void __iomem *ioaddr,int mode,u32 channel, +int fifosz);/* To track extra statistic (if supported) */ void (*dma_diagnostic_fr) (void *data,struct stmmac_extra_stats *x,void __iomem *ioaddr);
drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c +9 -6
@@ -271,9 +271,10 @@ static void dwmac4_dma_rx_chan_op_mode(void __iomem *ioaddr, int mode, }static void dwmac4_dma_tx_chan_op_mode (void __iomem *ioaddr,int mode, -u32 channel) +u32 channel,int fifosz) {u32 mtl_tx_op =readl (ioaddr +MTL_CHAN_TX_OP_MODE (channel)); +unsigned int tqs = fifosz /256 -1 ;if (mode ==SF_DMA_MODE ) {pr_debug ("GMAC: enable TX store and forward mode\n" );
@@ -306,12 +307,14 @@ static void dwmac4_dma_tx_chan_op_mode(void __iomem *ioaddr, int mode,* For an IP with DWC_EQOS_NUM_TXQ > 1, the fields TXQEN and TQS are R/W * with reset values: TXQEN off, TQS 256 bytes. * -* Write the bits in both cases, since it will have no effect when RO. -* For DWC_EQOS_NUM_TXQ > 1, the top bits in MTL_OP_MODE_TQS_MASK might -* be RO, however, writing the whole TQS field will result in a value -* equal to DWC_EQOS_TXFIFO_SIZE, just like for DWC_EQOS_NUM_TXQ == 1. +* TXQEN must be written for multi-channel operation and TQS must +* reflect the available fifo size per queue (total fifo size / number +* of enabled queues). */ - mtl_tx_op |=MTL_OP_MODE_TXQEN |MTL_OP_MODE_TQS_MASK ; + mtl_tx_op |=MTL_OP_MODE_TXQEN ; + mtl_tx_op &= ~MTL_OP_MODE_TQS_MASK ; + mtl_tx_op |= tqs <<MTL_OP_MODE_TQS_SHIFT ; +writel (mtl_tx_op, ioaddr +MTL_CHAN_TX_OP_MODE (channel)); }
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +20 -2
@@ -1765,12 +1765,19 @@ static void stmmac_dma_operation_mode(struct stmmac_priv *priv)u32 rx_channels_count = priv->plat->rx_queues_to_use;u32 tx_channels_count = priv->plat->tx_queues_to_use;int rxfifosz = priv->plat->rx_fifo_size; +int txfifosz = priv->plat->tx_fifo_size;u32 txmode =0 ;u32 rxmode =0 ;u32 chan =0 ;if (rxfifosz ==0 ) rxfifosz = priv->dma_cap.rx_fifo_size; +if (txfifosz ==0 ) + txfifosz = priv->dma_cap.tx_fifo_size; + +/* Adjust for real per queue fifo size */ + rxfifosz /= rx_channels_count; + txfifosz /= tx_channels_count;if (priv->plat->force_thresh_dma_mode) { txmode = tc;
@@ -1798,7 +1805,8 @@ static void stmmac_dma_operation_mode(struct stmmac_priv *priv) rxfifosz);for (chan =0 ; chan < tx_channels_count; chan++) - priv->hw->dma->dma_tx_mode (priv->ioaddr, txmode, chan); + priv->hw->dma->dma_tx_mode (priv->ioaddr, txmode, chan, + txfifosz); }else { priv->hw->dma->dma_mode (priv->ioaddr, txmode, rxmode, rxfifosz);
@@ -1967,15 +1975,25 @@ static void stmmac_tx_err(struct stmmac_priv *priv, u32 chan)static void stmmac_set_dma_operation_mode (struct stmmac_priv *priv,u32 txmode,u32 rxmode,u32 chan) { +u32 rx_channels_count = priv->plat->rx_queues_to_use; +u32 tx_channels_count = priv->plat->tx_queues_to_use;int rxfifosz = priv->plat->rx_fifo_size; +int txfifosz = priv->plat->tx_fifo_size;if (rxfifosz ==0 ) rxfifosz = priv->dma_cap.rx_fifo_size; +if (txfifosz ==0 ) + txfifosz = priv->dma_cap.tx_fifo_size; + +/* Adjust for real per queue fifo size */ + rxfifosz /= rx_channels_count; + txfifosz /= tx_channels_count;if (priv->synopsys_id >=DWMAC_CORE_4_00 ) { priv->hw->dma->dma_rx_mode (priv->ioaddr, rxmode, chan, rxfifosz); - priv->hw->dma->dma_tx_mode (priv->ioaddr, txmode, chan); + priv->hw->dma->dma_tx_mode (priv->ioaddr, txmode, chan, + txfifosz); }else { priv->hw->dma->dma_mode (priv->ioaddr, txmode, rxmode, rxfifosz);
drivers/net/phy/mdio_bus.c +1 -0
@@ -358,6 +358,7 @@ int __mdiobus_register(struct mii_bus *bus, struct module *owner)if (IS_ERR (gpiod)) {dev_err (&bus->dev,"mii_bus %s couldn't get reset GPIO\n" , bus->id); +device_del (&bus->dev);return PTR_ERR (gpiod); }else if (gpiod) { bus->reset_gpiod = gpiod;
drivers/net/ppp/pppoe.c +1 -0
@@ -445,6 +445,7 @@ static int pppoe_rcv(struct sk_buff *skb, struct net_device *dev,if (pskb_trim_rcsum (skb, len)) goto drop; + ph =pppoe_hdr (skb); pn =pppoe_pernet (dev_net (dev));/* Note that get_item does a sock_hold(), so sk_pppox(po)
drivers/nvme/target/rdma.c +15 -2
@@ -137,6 +137,10 @@ static void nvmet_rdma_recv_done(struct ib_cq *cq, struct ib_wc *wc);static void nvmet_rdma_read_data_done (struct ib_cq *cq,struct ib_wc *wc);static void nvmet_rdma_qp_event (struct ib_event *event,void *priv);static void nvmet_rdma_queue_disconnect (struct nvmet_rdma_queue *queue); +static void nvmet_rdma_free_rsp (struct nvmet_rdma_device *ndev, +struct nvmet_rdma_rsp *r); +static int nvmet_rdma_alloc_rsp (struct nvmet_rdma_device *ndev, +struct nvmet_rdma_rsp *r);static struct nvmet_fabrics_ops nvmet_rdma_ops;
@@ -175,9 +179,17 @@ nvmet_rdma_get_rsp(struct nvmet_rdma_queue *queue)spin_unlock_irqrestore (&queue->rsps_lock, flags);if (unlikely (!rsp)) { - rsp =kmalloc (sizeof (*rsp),GFP_KERNEL ); +int ret; + + rsp =kzalloc (sizeof (*rsp),GFP_KERNEL );if (unlikely (!rsp))return NULL ; + ret =nvmet_rdma_alloc_rsp (queue->dev, rsp); +if (unlikely (ret)) { +kfree (rsp); +return NULL ; + } + rsp->allocated = true; }
@@ -189,7 +201,8 @@ nvmet_rdma_put_rsp(struct nvmet_rdma_rsp *rsp) {unsigned long flags; -if (rsp->allocated) { +if (unlikely (rsp->allocated)) { +nvmet_rdma_free_rsp (rsp->queue->dev, rsp);kfree (rsp);return ; }
drivers/ptp/ptp_kvm.c +4 -1
@@ -178,8 +178,11 @@ static int __init ptp_kvm_init(void) {long ret; +if (!kvm_para_available ()) +return -ENODEV ; + clock_pair_gpa =slow_virt_to_phys (&clock_pair); - hv_clock =pvclock_pvti_cpu0_va (); + hv_clock =pvclock_get_pvti_cpu0_va ();if (!hv_clock)return -ENODEV ;
drivers/s390/char/sclp_config.c +2 -0
@@ -60,7 +60,9 @@ static void sclp_cpu_capability_notify(struct work_struct *work)static void __ref sclp_cpu_change_notify (struct work_struct *work) { +lock_device_hotplug ();smp_rescan_cpus (); +unlock_device_hotplug (); }static void sclp_conf_receiver_fn (struct evbuf_header *evbuf)
drivers/staging/rtl8188eu/os_dep/usb_intf.c +1 -0
@@ -43,6 +43,7 @@ static const struct usb_device_id rtw_usb_id_tbl[] = { {USB_DEVICE(0x2001, 0x330F)}, /* DLink DWA-125 REV D1 */ {USB_DEVICE(0x2001, 0x3310)}, /* Dlink DWA-123 REV D1 */ {USB_DEVICE(0x2001, 0x3311)}, /* DLink GO-USB-N150 REV B1 */ + {USB_DEVICE(0x2001, 0x331B)}, /* D-Link DWA-121 rev B1 */ {USB_DEVICE(0x2357, 0x010c)}, /* TP-Link TL-WN722N v2 */ {USB_DEVICE(0x0df6, 0x0076)}, /* Sitecom N150 v2 */ {USB_DEVICE(USB_VENDER_ID_REALTEK, 0xffef)}, /* Rosewill RNX-N150NUB */
drivers/tty/n_hdlc.c +1 -0
@@ -598,6 +598,7 @@ static ssize_t n_hdlc_tty_read(struct tty_struct *tty, struct file *file,/* too large for caller's buffer */ ret = -EOVERFLOW ; }else { +__set_current_state (TASK_RUNNING );if (copy_to_user (buf, rbuf->buf, rbuf->count)) ret = -EFAULT ;else
drivers/tty/serial/serial_core.c +8 -4
@@ -563,10 +563,12 @@ static int uart_put_char(struct tty_struct *tty, unsigned char c)int ret =0 ; circ = &state->xmit; -if (!circ->buf) + port =uart_port_lock (state, flags); +if (!circ->buf) { +uart_port_unlock (port, flags);return 0 ; + } - port =uart_port_lock (state, flags);if (port &&uart_circ_chars_free (circ) !=0 ) { circ->buf[circ->head] = c; circ->head = (circ->head +1 ) & (UART_XMIT_SIZE -1 );
@@ -599,11 +601,13 @@ static int uart_write(struct tty_struct *tty,return -EL3HLT ; } + port =uart_port_lock (state, flags); circ = &state->xmit; -if (!circ->buf) +if (!circ->buf) { +uart_port_unlock (port, flags);return 0 ; + } - port =uart_port_lock (state, flags);while (port) { c =CIRC_SPACE_TO_END (circ->head, circ->tail,UART_XMIT_SIZE );if (count < c)
drivers/tty/tty_io.c +2 -1
@@ -2180,7 +2180,8 @@ static int tiocsti(struct tty_struct *tty, char __user *p) ld =tty_ldisc_ref_wait (tty);if (!ld)return -EIO ; - ld->ops->receive_buf (tty, &ch, &mbz,1 ); +if (ld->ops->receive_buf) + ld->ops->receive_buf (tty, &ch, &mbz,1 );tty_ldisc_deref (ld);return 0 ; }
drivers/tty/vt/vt.c +1 -0
@@ -953,6 +953,7 @@ static int vc_do_resize(struct tty_struct *tty, struct vc_data *vc,if (con_is_visible (vc))update_screen (vc);vt_event_post (VT_EVENT_RESIZE , vc->vc_num, vc->vc_num); +notify_update (vc);return err; }
drivers/usb/dwc3/gadget.c +2 -0
@@ -182,6 +182,8 @@ void dwc3_gadget_del_and_unmap_request(struct dwc3_ep *dep, req->started = false;list_del (&req->list); req->remaining =0 ; + req->unaligned = false; + req->zero = false;if (req->request.status == -EINPROGRESS ) req->request.status = status;
drivers/usb/host/xhci-mtk.c +4 -2
@@ -724,14 +724,16 @@ static int xhci_mtk_remove(struct platform_device *dev)struct xhci_hcd_mtk *mtk =platform_get_drvdata (dev);struct usb_hcd *hcd = mtk->hcd;struct xhci_hcd *xhci =hcd_to_xhci (hcd); +struct usb_hcd *shared_hcd = xhci->shared_hcd; -usb_remove_hcd (xhci->shared_hcd); +usb_remove_hcd (shared_hcd); + xhci->shared_hcd =NULL ;xhci_mtk_phy_power_off (mtk);xhci_mtk_phy_exit (mtk);device_init_wakeup (&dev->dev, false);usb_remove_hcd (hcd); -usb_put_hcd (xhci->shared_hcd); +usb_put_hcd (shared_hcd);usb_put_hcd (hcd);xhci_mtk_sch_exit (mtk);xhci_mtk_clks_disable (mtk);
drivers/usb/host/xhci-pci.c +1 -0
@@ -370,6 +370,7 @@ static void xhci_pci_remove(struct pci_dev *dev)if (xhci->shared_hcd) {usb_remove_hcd (xhci->shared_hcd);usb_put_hcd (xhci->shared_hcd); + xhci->shared_hcd =NULL ; }/* Workaround for spurious wakeups at shutdown with HSW */
drivers/usb/host/xhci-plat.c +4 -2
@@ -332,14 +332,16 @@ static int xhci_plat_remove(struct platform_device *dev)struct usb_hcd *hcd =platform_get_drvdata (dev);struct xhci_hcd *xhci =hcd_to_xhci (hcd);struct clk *clk = xhci->clk; +struct usb_hcd *shared_hcd = xhci->shared_hcd; xhci->xhc_state |=XHCI_STATE_REMOVING ; -usb_remove_hcd (xhci->shared_hcd); +usb_remove_hcd (shared_hcd); + xhci->shared_hcd =NULL ;usb_phy_shutdown (hcd->usb_phy);usb_remove_hcd (hcd); -usb_put_hcd (xhci->shared_hcd); +usb_put_hcd (shared_hcd);if (!IS_ERR (clk))clk_disable_unprepare (clk);
drivers/usb/host/xhci-tegra.c +1 -0
@@ -1178,6 +1178,7 @@ static int tegra_xusb_remove(struct platform_device *pdev)usb_remove_hcd (xhci->shared_hcd);usb_put_hcd (xhci->shared_hcd); + xhci->shared_hcd =NULL ;usb_remove_hcd (tegra->hcd);usb_put_hcd (tegra->hcd);
drivers/usb/host/xhci.c +0 -2
@@ -669,8 +669,6 @@ static void xhci_stop(struct usb_hcd *hcd)/* Only halt host and free memory after both hcds are removed */ if (!usb_hcd_is_primary_hcd (hcd)) { -/* usb core will free this hcd shortly, unset pointer */ - xhci->shared_hcd =NULL ;mutex_unlock (&xhci->mutex);return ; }
drivers/usb/serial/pl2303.c +1 -0
@@ -49,6 +49,7 @@ static const struct usb_device_id id_table[] = { { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_HCR331) }, { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_MOTOROLA) }, { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_ZTEK) }, + { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_TB) }, { USB_DEVICE(IODATA_VENDOR_ID, IODATA_PRODUCT_ID) }, { USB_DEVICE(IODATA_VENDOR_ID, IODATA_PRODUCT_ID_RSAQ5) }, { USB_DEVICE(ATEN_VENDOR_ID, ATEN_PRODUCT_ID),
drivers/usb/serial/pl2303.h +2 -0
@@ -13,6 +13,7 @@#define PL2303_VENDOR_ID 0x067b#define PL2303_PRODUCT_ID 0x2303 +#define PL2303_PRODUCT_ID_TB 0x2304#define PL2303_PRODUCT_ID_RSAQ2 0x04bb#define PL2303_PRODUCT_ID_DCU11 0x1234#define PL2303_PRODUCT_ID_PHAROS 0xaaa0
@@ -25,6 +26,7 @@#define PL2303_PRODUCT_ID_MOTOROLA 0x0307#define PL2303_PRODUCT_ID_ZTEK 0xe1f1 +#define ATEN_VENDOR_ID 0x0557#define ATEN_VENDOR_ID2 0x0547#define ATEN_PRODUCT_ID 0x2008
drivers/usb/serial/usb-serial-simple.c +2 -1
@@ -88,7 +88,8 @@ DEVICE(moto_modem, MOTO_IDS);/* Motorola Tetra driver */ #define MOTOROLA_TETRA_IDS () \ { USB_DEVICE(0x0cad, 0x9011) },/* Motorola Solutions TETRA PEI */ \ - { USB_DEVICE(0x0cad, 0x9012) } /* MTP6550 */ + { USB_DEVICE(0x0cad, 0x9012) }, /* MTP6550 */ \ + { USB_DEVICE(0x0cad, 0x9016) } /* TPG2200 */DEVICE (motorola_tetra,MOTOROLA_TETRA_IDS );/* Novatel Wireless GPS driver */
drivers/vhost/net.c +2 -1
@@ -851,7 +851,8 @@ static void handle_rx(struct vhost_net *net)vhost_add_used_and_signal_n (&net->dev, vq, vq->heads, headcount);if (unlikely (vq_log)) -vhost_log_write (vq, vq_log, log, vhost_len); +vhost_log_write (vq, vq_log, log, vhost_len, + vq->iov, in); total_len += vhost_len;if (unlikely (total_len >=VHOST_NET_WEIGHT )) {vhost_poll_queue (&vq->poll);
drivers/vhost/vhost.c +83 -14
133 lines not on this page · raw message
drivers/vhost/vhost.h +2 -1
@@ -208,7 +208,8 @@ bool vhost_vq_avail_empty(struct vhost_dev *, struct vhost_virtqueue *);bool vhost_enable_notify (struct vhost_dev *,struct vhost_virtqueue *);int vhost_log_write (struct vhost_virtqueue *vq,struct vhost_log *log, -unsigned int log_num,u64 len); +unsigned int log_num,u64 len, +struct iovec *iov,int count);int vq_iotlb_prefetch (struct vhost_virtqueue *vq);struct vhost_msg_node *vhost_new_msg (struct vhost_virtqueue *vq,int type);
drivers/xen/events/events_base.c +1 -1
@@ -1650,7 +1650,7 @@ void xen_callback_vector(void) xen_have_vector_callback =0 ;return ; } -pr_info ("Xen HVM callback vector for event delivery is enabled\n" ); +pr_info_once ("Xen HVM callback vector for event delivery is enabled\n" );alloc_intr_gate (HYPERVISOR_CALLBACK_VECTOR , xen_hvm_callback_vector); }
fs/btrfs/dev-replace.c +7 -2
@@ -351,6 +351,7 @@ int btrfs_dev_replace_start(struct btrfs_fs_info *fs_info,break ;case BTRFS_IOCTL_DEV_REPLACE_STATE_STARTED :case BTRFS_IOCTL_DEV_REPLACE_STATE_SUSPENDED : +ASSERT (0 ); ret =BTRFS_IOCTL_DEV_REPLACE_RESULT_ALREADY_STARTED ; goto leave; }
@@ -395,6 +396,10 @@ int btrfs_dev_replace_start(struct btrfs_fs_info *fs_info,if (IS_ERR (trans)) { ret =PTR_ERR (trans);btrfs_dev_replace_lock (dev_replace,1 ); + dev_replace->replace_state = +BTRFS_IOCTL_DEV_REPLACE_STATE_NEVER_STARTED ; + dev_replace->srcdev =NULL ; + dev_replace->tgtdev =NULL ; goto leave; }
@@ -416,8 +421,6 @@ int btrfs_dev_replace_start(struct btrfs_fs_info *fs_info,return ret; leave: - dev_replace->srcdev =NULL ; - dev_replace->tgtdev =NULL ;btrfs_dev_replace_unlock (dev_replace,1 );btrfs_destroy_dev_replace_tgtdev (fs_info, tgt_device);return ret;
@@ -801,6 +804,8 @@ int btrfs_resume_dev_replace_async(struct btrfs_fs_info *fs_info) "cannot continue dev_replace, tgtdev is missing");btrfs_info (fs_info,"you may cancel the operation after 'mount -o degraded'" ); + dev_replace->replace_state = +BTRFS_IOCTL_DEV_REPLACE_STATE_SUSPENDED ;btrfs_dev_replace_unlock (dev_replace,1 );return 0 ; }
fs/cifs/cifssmb.c +23 -12
@@ -1445,18 +1445,26 @@ cifs_discard_remaining_data(struct TCP_Server_Info *server) }static int -cifs_readv_discard (struct TCP_Server_Info *server,struct mid_q_entry *mid) +__cifs_readv_discard (struct TCP_Server_Info *server,struct mid_q_entry *mid, +bool malformed) {int length; -struct cifs_readdata *rdata = mid->callback_data; length =cifs_discard_remaining_data (server); -dequeue_mid (mid, rdata->result); +dequeue_mid (mid, malformed); mid->resp_buf = server->smallbuf; server->smallbuf =NULL ;return length; } +static int +cifs_readv_discard (struct TCP_Server_Info *server,struct mid_q_entry *mid) +{ +struct cifs_readdata *rdata = mid->callback_data; + +return __cifs_readv_discard (server, mid, rdata->result); +} +int cifs_readv_receive (struct TCP_Server_Info *server,struct mid_q_entry *mid) {
@@ -1496,12 +1504,23 @@ cifs_readv_receive(struct TCP_Server_Info *server, struct mid_q_entry *mid)return -1 ; } +/* set up first two iov for signature check and to get credits */ + rdata->iov[0 ].iov_base = buf; + rdata->iov[0 ].iov_len =4 ; + rdata->iov[1 ].iov_base = buf +4 ; + rdata->iov[1 ].iov_len = server->total_read -4 ; +cifs_dbg (FYI ,"0: iov_base=%p iov_len=%zu\n" , + rdata->iov[0 ].iov_base, rdata->iov[0 ].iov_len); +cifs_dbg (FYI ,"1: iov_base=%p iov_len=%zu\n" , + rdata->iov[1 ].iov_base, rdata->iov[1 ].iov_len); +/* Was the SMB read successful? */ rdata->result = server->ops->map_error (buf, false);if (rdata->result !=0 ) {cifs_dbg (FYI ,"%s: server returned error %d\n" , __func__, rdata->result); -return cifs_readv_discard (server, mid); +/* normal error on read response */ +return __cifs_readv_discard (server, mid, false); }/* Is there enough to get to the rest of the READ_RSP header? */
@@ -1544,14 +1563,6 @@ cifs_readv_receive(struct TCP_Server_Info *server, struct mid_q_entry *mid) server->total_read += length; } -/* set up first iov for signature check */ - rdata->iov[0 ].iov_base = buf; - rdata->iov[0 ].iov_len =4 ; - rdata->iov[1 ].iov_base = buf +4 ; - rdata->iov[1 ].iov_len = server->total_read -4 ; -cifs_dbg (FYI ,"0: iov_base=%p iov_len=%u\n" , - rdata->iov[0 ].iov_base, server->total_read); -/* how much data is in the response? */ data_len = server->ops->read_data_length (buf);if (data_offset + data_len > buflen) {
fs/cifs/connect.c +21 -0
@@ -524,6 +524,21 @@ server_unresponsive(struct TCP_Server_Info *server)return false; } +static inline bool +zero_credits (struct TCP_Server_Info *server) +{ +int val; + +spin_lock (&server->req_lock); + val = server->credits + server->echo_credits + server->oplock_credits; +if (server->in_flight ==0 && val ==0 ) { +spin_unlock (&server->req_lock); +return true; + } +spin_unlock (&server->req_lock); +return false; +} +static int cifs_readv_from_socket (struct TCP_Server_Info *server,struct msghdr *smb_msg) {
@@ -536,6 +551,12 @@ cifs_readv_from_socket(struct TCP_Server_Info *server, struct msghdr *smb_msg)for (total_read =0 ;msg_data_left (smb_msg); total_read += length) {try_to_freeze (); +/* reconnect if no credits and no requests in flight */ +if (zero_credits (server)) { +cifs_reconnect (server); +return -ECONNABORTED ; + } +if (server_unresponsive (server))return -ECONNABORTED ;
fs/cifs/smb2ops.c +42 -20
126 lines not on this page · raw message
fs/f2fs/node.c +3 -1
@@ -694,6 +694,7 @@ static void truncate_node(struct dnode_of_data *dn) {struct f2fs_sb_info *sbi =F2FS_I_SB (dn->inode);struct node_info ni; +pgoff_t index;get_node_info (sbi, dn->nid, &ni);f2fs_bug_on (sbi, ni.blk_addr ==NULL_ADDR );
@@ -712,10 +713,11 @@ static void truncate_node(struct dnode_of_data *dn)clear_node_page_dirty (dn->node_page);set_sbi_flag (sbi,SBI_IS_DIRTY ); + index = dn->node_page->index;f2fs_put_page (dn->node_page,1 );invalidate_mapping_pages (NODE_MAPPING (sbi), - dn->node_page->index, dn->node_page->index); + index, index); dn->node_page =NULL ;trace_f2fs_truncate_node (dn->inode, dn->nid, ni.blk_addr);
include/linux/compiler-clang.h +14 -0
@@ -24,3 +24,17 @@#ifdef __noretpoline#undef __noretpoline#endif + +/* +* Not all versions of clang implement the the type-generic versions +* of the builtin overflow checkers. Fortunately, clang implements +* __has_builtin allowing us to avoid awkward version +* checks. Unfortunately, we don't know which version of gcc clang +* pretends to be, so the macro may or may not be defined. +*/ +#undef COMPILER_HAS_GENERIC_BUILTIN_OVERFLOW +#if __has_builtin (__builtin_mul_overflow) && \ +__has_builtin (__builtin_add_overflow) && \ +__has_builtin (__builtin_sub_overflow) +#define COMPILER_HAS_GENERIC_BUILTIN_OVERFLOW 1 +#endif
include/linux/compiler-gcc.h +4 -0
@@ -358,3 +358,7 @@* code */ #define uninitialized_var (x) x = x + +#if GCC_VERSION >=50100 +#define COMPILER_HAS_GENERIC_BUILTIN_OVERFLOW 1 +#endif
include/linux/compiler-intel.h +4 -0
@@ -44,3 +44,7 @@#define __builtin_bswap16 _bswap16#endif +/* +* icc defines __GNUC__, but does not implement the builtin overflow checkers. +*/ +#undef COMPILER_HAS_GENERIC_BUILTIN_OVERFLOW
include/linux/hyperv.h +3 -2
@@ -1130,8 +1130,9 @@ struct hv_ring_buffer_debug_info {u32 bytes_avail_towrite; }; -void hv_ringbuffer_get_debuginfo (const struct hv_ring_buffer_info *ring_info, -struct hv_ring_buffer_debug_info *debug_info); + +int hv_ringbuffer_get_debuginfo (const struct hv_ring_buffer_info *ring_info, +struct hv_ring_buffer_debug_info *debug_info);/* Vmbus interface */ #define vmbus_driver_register (driver) \
include/linux/overflow.h new file +205 -0
205 lines not on this page · raw message
include/linux/skbuff.h +1 -0
@@ -3163,6 +3163,7 @@ int pskb_trim_rcsum_slow(struct sk_buff *skb, unsigned int len);* * This is exactly the same as pskb_trim except that it ensures the * checksum of received packets are still valid after the operation. +* It can change skb pointers. */ static inline int pskb_trim_rcsum (struct sk_buff *skb,unsigned int len)
include/net/ip_fib.h +1 -1
@@ -233,7 +233,7 @@ int fib_table_delete(struct net *, struct fib_table *, struct fib_config *, struct netlink_ext_ack *extack);int fib_table_dump (struct fib_table *table,struct sk_buff *skb,struct netlink_callback *cb); -int fib_table_flush (struct net *net,struct fib_table *table); +int fib_table_flush (struct net *net,struct fib_table *table,bool flush_all);struct fib_table *fib_trie_unmerge (struct fib_table *main_tb);void fib_table_flush_external (struct fib_table *table);void fib_free_table (struct fib_table *tb);
include/xen/interface/vcpu.h +42 -0
46 lines not on this page · raw message
kernel/time/posix-cpu-timers.c +1 -0
@@ -685,6 +685,7 @@ static int posix_cpu_timer_set(struct k_itimer *timer, int timer_flags,* set up the signal and overrun bookkeeping. */ timer->it.cpu.incr =timespec64_to_ns (&new->it_interval); + timer->it_interval =ns_to_ktime (timer->it.cpu.incr);/* * This acts as a modification timestamp for the timer,
net/bridge/br_forward.c +4 -5
@@ -35,10 +35,10 @@ static inline int should_deliver(const struct net_bridge_port *p,int br_dev_queue_push_xmit (struct net *net,struct sock *sk,struct sk_buff *skb) { +skb_push (skb,ETH_HLEN );if (!is_skb_forwardable (skb->dev, skb)) goto drop; -skb_push (skb,ETH_HLEN );br_drop_fake_rtable (skb); if (skb->ip_summed == CHECKSUM_PARTIAL &&
@@ -96,12 +96,11 @@ static void __br_forward(const struct net_bridge_port *to, net =dev_net (indev); }else {if (unlikely (netpoll_tx_running (to->br->dev))) { -if (!is_skb_forwardable (skb->dev, skb)) { +skb_push (skb,ETH_HLEN ); +if (!is_skb_forwardable (skb->dev, skb))kfree_skb (skb); - }else { -skb_push (skb,ETH_HLEN ); +else br_netpoll_send_skb (to, skb); - }return ; } br_hook =NF_BR_LOCAL_OUT ;
net/bridge/br_netfilter_ipv6.c +1 -0
@@ -131,6 +131,7 @@ int br_validate_ipv6(struct net *net, struct sk_buff *skb) IPSTATS_MIB_INDISCARDS); goto drop; } + hdr =ipv6_hdr (skb); }if (hdr->nexthdr ==NEXTHDR_HOP &&br_nf_check_hbh_len (skb)) goto drop;
net/bridge/netfilter/nft_reject_bridge.c +1 -0
@@ -230,6 +230,7 @@ static bool reject6_br_csum_ok(struct sk_buff *skb, int hook) pskb_trim_rcsum(skb, ntohs(ip6h->payload_len) + sizeof(*ip6h)))return false; + ip6h =ipv6_hdr (skb); thoff =ipv6_skip_exthdr (skb, ((u8 *)(ip6h+1 ) - skb->data), &proto, &fo);if (thoff <0 || thoff >= skb->len || (fo &htons (~0x7 )) !=0 )return false;
net/can/bcm.c +27 -0
@@ -67,6 +67,9 @@*/ #define MAX_NFRAMES 256 +/* limit timers to 400 days for sending/timeouts */ +#define BCM_TIMER_SEC_MAX (400 * 24 * 60 * 60) +/* use of last_frames[index].flags */ #define RX_RECV 0x40/* received data for this element */ #define RX_THR 0x80/* element not been sent due to throttle feature */
@@ -140,6 +143,22 @@ static inline ktime_t bcm_timeval_to_ktime(struct bcm_timeval tv)return ktime_set (tv.tv_sec, tv.tv_usec *NSEC_PER_USEC ); } +/* check limitations for timeval provided by user */ +static bool bcm_is_invalid_tv (struct bcm_msg_head *msg_head) +{ +if ((msg_head->ival1.tv_sec <0 ) || + (msg_head->ival1.tv_sec >BCM_TIMER_SEC_MAX ) || + (msg_head->ival1.tv_usec <0 ) || + (msg_head->ival1.tv_usec >=USEC_PER_SEC ) || + (msg_head->ival2.tv_sec <0 ) || + (msg_head->ival2.tv_sec >BCM_TIMER_SEC_MAX ) || + (msg_head->ival2.tv_usec <0 ) || + (msg_head->ival2.tv_usec >=USEC_PER_SEC )) +return true; + +return false; +} +#define CFSIZ (flags) ((flags & CAN_FD_FRAME) ? CANFD_MTU : CAN_MTU)#define OPSIZ sizeof(struct bcm_op)#define MHSIZ sizeof(struct bcm_msg_head)
@@ -886,6 +905,10 @@ static int bcm_tx_setup(struct bcm_msg_head *msg_head, struct msghdr *msg,if (msg_head->nframes <1 || msg_head->nframes >MAX_NFRAMES )return -EINVAL ; +/* check timeval limitations */ +if ((msg_head->flags &SETTIMER ) &&bcm_is_invalid_tv (msg_head)) +return -EINVAL ; +/* check the given can_id */ op =bcm_find_op (&bo->tx_ops, msg_head, ifindex);if (op) {
@@ -1065,6 +1088,10 @@ static int bcm_rx_setup(struct bcm_msg_head *msg_head, struct msghdr *msg, (!(msg_head->can_id & CAN_RTR_FLAG))))return -EINVAL ; +/* check timeval limitations */ +if ((msg_head->flags &SETTIMER ) &&bcm_is_invalid_tv (msg_head)) +return -EINVAL ; +/* check the given can_id */ op =bcm_find_op (&bo->rx_ops, msg_head, ifindex);if (op) {
net/ipv4/fib_frontend.c +2 -2
@@ -193,7 +193,7 @@ static void fib_flush(struct net *net)struct fib_table *tb;hlist_for_each_entry_safe (tb, tmp, head, tb_hlist) - flushed +=fib_table_flush (net, tb); + flushed +=fib_table_flush (net, tb, false); }if (flushed)
@@ -1299,7 +1299,7 @@ static void ip_fib_net_exit(struct net *net)hlist_for_each_entry_safe (tb, tmp, head, tb_hlist) {hlist_del (&tb->tb_hlist); -fib_table_flush (net, tb); +fib_table_flush (net, tb, true);fib_free_table (tb); } }
net/ipv4/fib_trie.c +12 -3
@@ -1836,7 +1836,7 @@ void fib_table_flush_external(struct fib_table *tb) }/* Caller must hold RTNL. */ -int fib_table_flush (struct net *net,struct fib_table *tb) +int fib_table_flush (struct net *net,struct fib_table *tb,bool flush_all) {struct trie *t = (struct trie *)tb->tb_data;struct key_vector *pn = t->kv;
@@ -1884,8 +1884,17 @@ int fib_table_flush(struct net *net, struct fib_table *tb)hlist_for_each_entry_safe (fa, tmp, &n->leaf, fa_list) {struct fib_info *fi = fa->fa_info; -if (!fi || !(fi->fib_flags &RTNH_F_DEAD ) || - tb->tb_id != fa->tb_id) { +if (!fi || tb->tb_id != fa->tb_id || + (!(fi->fib_flags &RTNH_F_DEAD ) && + !fib_props[fa->fa_type].error)) { + slen = fa->fa_slen; +continue ; + } + +/* Do not flush error routes if network namespace is +* not being dismantled +*/ +if (!flush_all && fib_props[fa->fa_type].error) { slen = fa->fa_slen;continue ; }
net/ipv4/inet_fragment.c +1 -1
@@ -90,7 +90,7 @@ static void inet_frags_free_cb(void *ptr, void *arg)void inet_frags_exit_net (struct netns_frags *nf) { - nf->low_thresh =0 ;/* prevent creation of new frags */ + nf->high_thresh =0 ;/* prevent creation of new frags */ rhashtable_free_and_destroy (&nf->rhashtable, inet_frags_free_cb,NULL ); }
net/ipv4/ip_input.c +1 -0
@@ -481,6 +481,7 @@ int ip_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, goto drop; } + iph =ip_hdr (skb); skb->transport_header = skb->network_header + iph->ihl*4 ;/* Remove any debris in the socket control block */
net/ipv4/tcp.c +1 -1
@@ -1178,7 +1178,7 @@ int tcp_sendmsg_locked(struct sock *sk, struct msghdr *msg, size_t size) flags = msg->msg_flags;if (flags &MSG_ZEROCOPY && size &&sock_flag (sk,SOCK_ZEROCOPY )) { -if (sk->sk_state !=TCP_ESTABLISHED ) { +if ((1 << sk->sk_state) & ~(TCPF_ESTABLISHED |TCPF_CLOSE_WAIT )) { err = -EINVAL ; goto out_err; }
net/openvswitch/flow_netlink.c +1 -1
@@ -459,7 +459,7 @@ static int __parse_flow_nlattrs(const struct nlattr *attr,return -EINVAL ; } -if (!nz || !is_all_zero (nla_data (nla), expected_len)) { +if (!nz || !is_all_zero (nla_data (nla),nla_len (nla))) { attrs |=1 << type; a[type] = nla; }
net/sched/cls_api.c +1 -2
@@ -318,7 +318,6 @@ EXPORT_SYMBOL(tcf_block_put);int tcf_classify (struct sk_buff *skb,const struct tcf_proto *tp,struct tcf_result *res,bool compat_mode) { -__be16 protocol =tc_skb_protocol (skb);#ifdef CONFIG_NET_CLS_ACT const int max_reclassify_loop =4 ;const struct tcf_proto *orig_tp = tp;
@@ -328,6 +327,7 @@ int tcf_classify(struct sk_buff *skb, const struct tcf_proto *tp, reclassify: #endiffor (; tp; tp =rcu_dereference_bh (tp->next)) { +__be16 protocol =tc_skb_protocol (skb);int err; if (tp->protocol != protocol &&
@@ -359,7 +359,6 @@ int tcf_classify(struct sk_buff *skb, const struct tcf_proto *tp, } tp = first_tp; - protocol =tc_skb_protocol (skb); goto reclassify;#endif }
sound/pci/hda/patch_conexant.c +1 -0
@@ -969,6 +969,7 @@ static const struct snd_pci_quirk cxt5066_fixups[] = {SND_PCI_QUIRK (0x103c ,0x814f ,"HP ZBook 15u G3" ,CXT_FIXUP_MUTE_LED_GPIO ),SND_PCI_QUIRK (0x103c ,0x822e ,"HP ProBook 440 G4" ,CXT_FIXUP_MUTE_LED_GPIO ),SND_PCI_QUIRK (0x103c ,0x836e ,"HP ProBook 455 G5" ,CXT_FIXUP_MUTE_LED_GPIO ), +SND_PCI_QUIRK (0x103c ,0x837f ,"HP ProBook 470 G5" ,CXT_FIXUP_MUTE_LED_GPIO ),SND_PCI_QUIRK (0x103c ,0x8299 ,"HP 800 G3 SFF" ,CXT_FIXUP_HP_MIC_NO_PRESENCE ),SND_PCI_QUIRK (0x103c ,0x829a ,"HP 800 G3 DM" ,CXT_FIXUP_HP_MIC_NO_PRESENCE ), SND_PCI_QUIRK(0x103c, 0x8455, "HP Z2 G4", CXT_FIXUP_HP_MIC_NO_PRESENCE),
sound/soc/codecs/rt5514-spi.c +2 -0
@@ -265,6 +265,8 @@ static int rt5514_spi_pcm_probe(struct snd_soc_platform *platform) rt5514_dsp =devm_kzalloc (platform->dev,sizeof (*rt5514_dsp),GFP_KERNEL ); +if (!rt5514_dsp) +return -ENOMEM ; rt5514_dsp->dev = &rt5514_spi->dev;mutex_init (&rt5514_dsp->dma_lock);
sound/soc/intel/atom/sst-mfld-platform-pcm.c +7 -1
@@ -399,7 +399,13 @@ static int sst_media_hw_params(struct snd_pcm_substream *substream,struct snd_pcm_hw_params *params, struct snd_soc_dai *dai) { -snd_pcm_lib_malloc_pages (substream ,params_buffer_bytes (params )); + int ret; + + ret = +snd_pcm_lib_malloc_pages (substream, +params_buffer_bytes (params)); +if (ret) +return ret;memset (substream->runtime->dma_area,0 ,params_buffer_bytes (params));return 0 ; }
tools/perf/util/unwind-libdw.c +2 -2
@@ -44,13 +44,13 @@ static int __report_module(struct addr_location *al, u64 ip,Dwarf_Addr s;dwfl_module_info (mod,NULL , &s,NULL ,NULL ,NULL ,NULL ,NULL ); -if (s != al->map->start) +if (s != al->map->start - al->map->pgoff) mod =0 ; }if (!mod) mod =dwfl_report_elf (ui->dwfl, dso->short_name, - dso->long_name,-1 , al->map->start, + (dso->symsrc_filename ? dso->symsrc_filename : dso->long_name),-1 , al->map->start - al->map->pgoff, false);return mod &&dwfl_addrmodule (ui->dwfl, ip) == mod ?0 :-1 ;
tools/testing/selftests/seccomp/seccomp_bpf.c +0 -61
73 lines not on this page · raw message
tools/testing/selftests/x86/protection_keys.c +31 -10
64 lines not on this page · raw message