Linux 5.4.41
Greg Kroah-Hartman
maintainerI'm announcing the release of the 5.4.41 kernel.
All users of the 5.4 kernel series must upgrade.
The updated 5.4.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-5.4.y
and can be browsed at the normal kernel.org git web browser:
https://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary
thanks,
greg k-h
------------
Makefile | 2 arch/arm/crypto/nhpoly1305-neon-glue.c | 2 arch/arm64/crypto/nhpoly1305-neon-glue.c | 2 arch/arm64/kvm/guest.c | 7 arch/arm64/mm/hugetlbpage.c | 2 arch/riscv/mm/init.c | 3 arch/s390/kvm/priv.c | 4 arch/x86/crypto/nhpoly1305-avx2-glue.c | 2 arch/x86/crypto/nhpoly1305-sse2-glue.c | 2 arch/x86/entry/calling.h | 40 ++-- arch/x86/entry/entry_64.S | 9 - arch/x86/include/asm/kvm_host.h | 4 arch/x86/include/asm/unwind.h | 2 arch/x86/kernel/unwind_orc.c | 61 +++++- arch/x86/kvm/svm.c | 2 arch/x86/kvm/vmx/vmenter.S | 3 block/blk-iocost.c | 117 +++++++------ drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 7 drivers/gpu/drm/ingenic/ingenic-drm.c | 1 drivers/hid/usbhid/hid-core.c | 37 +++- drivers/hid/usbhid/usbhid.h | 1 drivers/hid/wacom_sys.c | 4 drivers/hid/wacom_wac.c | 88 ++------- drivers/iommu/virtio-iommu.c | 2 drivers/net/ethernet/broadcom/bnxt/bnxt.c | 20 +- drivers/net/ethernet/broadcom/bnxt/bnxt.h | 1 drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.h | 2 drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c | 10 - drivers/net/ethernet/cadence/macb_main.c | 24 +- drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c | 3 drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c | 2 drivers/net/ethernet/mellanox/mlx4/main.c | 4 drivers/net/ethernet/mellanox/mlx5/core/cmd.c | 6 drivers/net/ethernet/mellanox/mlx5/core/steering/dr_send.c | 14 + drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c | 12 + drivers/net/ethernet/netronome/nfp/abm/main.c | 1 drivers/net/ethernet/toshiba/tc35815.c | 2 drivers/net/macsec.c | 3 drivers/net/phy/dp83640.c | 2 drivers/net/usb/qmi_wwan.c | 1 drivers/nvme/host/core.c | 28 +-- drivers/staging/gasket/gasket_core.c | 4 drivers/tty/serial/xilinx_uartps.c | 1 drivers/tty/vt/vt.c | 9 - drivers/usb/chipidea/ci_hdrc_msm.c | 2 drivers/usb/serial/garmin_gps.c | 4 drivers/usb/serial/qcserial.c | 1 drivers/usb/storage/unusual_uas.h | 7 fs/ceph/mds_client.c | 8 fs/ceph/quota.c | 4 fs/coredump.c | 8 fs/eventpoll.c | 61 +++--- fs/notify/fanotify/fanotify.c | 9 - fs/notify/inotify/inotify_fsnotify.c | 4 fs/notify/inotify/inotify_user.c | 2 include/linux/backing-dev-defs.h | 1 include/linux/backing-dev.h | 9 - include/linux/fsnotify_backend.h | 7 include/linux/virtio_net.h | 26 ++ include/net/inet_ecn.h | 57 ++++++ include/net/ip6_fib.h | 4 include/net/net_namespace.h | 7 ipc/mqueue.c | 34 ++- kernel/trace/trace.c | 13 + kernel/trace/trace_kprobe.c | 2 kernel/umh.c | 5 mm/backing-dev.c | 13 + mm/memcontrol.c | 15 + mm/page_alloc.c | 9 + net/batman-adv/bat_v_ogm.c | 2 net/batman-adv/network-coding.c | 9 - net/batman-adv/sysfs.c | 3 net/core/devlink.c | 5 net/core/neighbour.c | 6 net/dsa/master.c | 3 net/ipv6/route.c | 25 ++ net/netfilter/nf_nat_proto.c | 4 net/netfilter/nfnetlink_osf.c | 12 - net/sched/sch_choke.c | 3 net/sched/sch_fq_codel.c | 2 net/sched/sch_sfq.c | 9 + net/sched/sch_skbprio.c | 3 net/sctp/sm_statefuns.c | 6 net/tipc/topsrv.c | 5 net/tls/tls_sw.c | 7 scripts/decodecode | 2 tools/cgroup/iocost_monitor.py | 7 tools/objtool/check.c | 2 virt/kvm/arm/hyp/aarch32.c | 8 virt/kvm/arm/vgic/vgic-mmio.c | 4 90 files changed, 647 insertions(+), 345 deletions(-)
Alan Stern (1):
HID: usbhid: Fix race between usbhid_close() and usbhid_stop()
Amir Goldstein (2):
fsnotify: replace inode pointer with an object id
fanotify: merge duplicate events on parent and child
Andy Shevchenko (1):
net: macb: Fix runtime PM refcounting
Anthony Felice (1):
net: tc35815: Fix phydev supported/advertising mask
Arnd Bergmann (1):
netfilter: nf_osf: avoid passing pointer to local var
Bryan O'Donoghue (1):
usb: chipidea: msm: Ensure proper controller reset using role switch API
Christian Borntraeger (1):
KVM: s390: Remove false WARN_ON_ONCE for the PQAP instruction
Christoph Hellwig (3):
nvme: refactor nvme_identify_ns_descs error handling
bdi: move bdi_dev_name out of line
bdi: add a ->dev_name field to struct backing_dev_info
Dan Carpenter (2):
net: mvpp2: prevent buffer overflow in mvpp22_rss_ctx()
net: mvpp2: cls: Prevent buffer overflow in mvpp2_ethtool_cls_rule_del()
David Ahern (1):
ipv6: Use global sernum for dst validation with nexthop objects
David Hildenbrand (1):
mm/page_alloc: fix watchdog soft lockups during set_zone_contiguous()
Dejin Zheng (1):
net: macb: fix an issue about leak related system resources
Erez Shitrit (1):
net/mlx5: DR, On creation set CQ's arm_db member to right value
Eric Dumazet (4):
fq_codel: fix TCA_FQ_CODEL_DROP_BATCH_SIZE sanity checks
net_sched: sch_skbprio: add message validation to skbprio_change()
sch_choke: avoid potential panic in choke_reset()
sch_sfq: validate silly quantum values
Evan Quan (2):
drm/amdgpu: move kfd suspend after ip_suspend_phase1 drm/amdgpu: drop redundant cg/pg ungate on runpm enter
Florian Fainelli (1):
net: dsa: Do not leave DSA master with NULL netdev_ops
George Spelvin (1):
batman-adv: fix batadv_nc_random_weight_tq
Greg Kroah-Hartman (1):
Linux 5.4.41
Guillaume Nault (1):
netfilter: nat: never update the UDP checksum when it's 0
H. Nikolaus Schaller (1):
drm: ingenic-drm: add MODULE_DEVICE_TABLE
Henry Willard (1):
mm: limit boost_watermark on small zones
Ivan Delalande (1):
scripts/decodecode: fix trapping instruction formatting
Jakub Kicinski (1):
devlink: fix return value after hitting end in region read
Janakarajan Natarajan (1):
arch/x86/kvm/svm/sev.c: change flag passed to GUP fast in sev_pin_memory()
Jann Horn (1):
x86/entry/64: Fix unwind hints in rewind_stack_do_exit()
Jason A. Donenfeld (1):
crypto: arch/nhpoly1305 - process in explicit 4k chunks
Jason Gerecke (3):
HID: wacom: Read HID_DG_CONTACTMAX directly for non-generic devices
Revert "HID: wacom: generic: read the number of expected touches on a per collection basis"
HID: wacom: Report 2nd-gen Intuos Pro S center button status over BT
Jeff Layton (1):
ceph: fix endianness bug when handling MDS session feature bits
Jere Leppänen (1):
sctp: Fix bundling of SHUTDOWN with COOKIE-ACK
Jiri Pirko (1):
mlxsw: spectrum_acl_tcam: Position vchunk in a vregion list properly
Josh Poimboeuf (6):
x86/entry/64: Fix unwind hints in register clearing code x86/entry/64: Fix unwind hints in kernel exit path x86/unwind/orc: Prevent unwinding before ORC initialization x86/unwind/orc: Fix error path for bad ORC entry type x86/unwind/orc: Fix premature unwind stoppage due to IRET frames
objtool: Fix stack offset tracking for indirect CFAs
Julia Lawall (2):
dp83640: reverse arguments to list_add_tail
iommu/virtio: Reverse arguments to list_add
Khazhismel Kumykov (1):
eventpoll: fix missing wakeup for ovflist in ep_poll_callback
Luis Chamberlain (1):
coredump: fix crash when umh is disabled
Luis Henriques (1):
ceph: demote quotarealm lookup warning to a debug message
Marc Zyngier (2):
KVM: arm: vgic: Fix limit condition when writing to GICD_I[CS]ACTIVER
KVM: arm64: Fix 32bit PC wrap-around
Mark Rutland (1):
arm64: hugetlb: avoid potential NULL dereference
Masami Hiramatsu (1):
tracing/kprobes: Fix a double initialization typo
Matt Jolly (2):
USB: serial: qcserial: Add DW5816e support
net: usb: qmi_wwan: add support for DW5816e
Michael Chan (4):
bnxt_en: Fix VF anti-spoof filter setup.
bnxt_en: Improve AER slot reset.
bnxt_en: Return error when allocating zero size context memory.
bnxt_en: Fix VLAN acceleration handling in bnxt_fix_features().
Miroslav Benes (1):
x86/unwind/orc: Don't skip the first frame for inactive tasks
Moshe Shemesh (2):
net/mlx5: Fix forced completion access non initialized command entry net/mlx5: Fix command entry leak in Internal Error State
Nicolas Pitre (1):
vt: fix unicode console freeing with a common interface
Oleg Nesterov (1):
ipc/mqueue.c: change __do_notify() to bypass check_kill_permission()
Oliver Neukum (2):
USB: uas: add quirk for LaCie 2Big Quadra
USB: serial: garmin_gps: add sanity checking for data length
Oscar Carter (1):
staging: gasket: Check the return value of gasket_get_bar_index()
Qiushi Wu (1):
nfp: abm: fix a memory leak bug
Roman Mashak (1):
neigh: send protocol value in neighbor create notification
Roman Penyaev (1):
epoll: atomically remove wait entry on wake up
Sagi Grimberg (1):
nvme: fix possible hang when ns scanning fails during error recovery
Scott Dial (1):
net: macsec: preserve ingress frame ordering
Sean Christopherson (1):
KVM: VMX: Explicitly clear RFLAGS.CF and RFLAGS.ZF in VM-Exit RSB path
Shubhrajyoti Datta (1):
tty: xilinx_uartps: Fix missing id assignment to the console
Steven Rostedt (VMware) (1):
tracing: Add a vmalloc_sync_mappings() for safe measure
Suravee Suthikulpanit (1):
KVM: x86: Fixes posted interrupt check for IRQs delivery modes
Tariq Toukan (1):
net/mlx4_core: Fix use of ENOSPC around mlx4_counter_alloc()
Tejun Heo (1):
iocost: protect iocg->abs_vdebt with iocg->waitq.lock
Toke Høiland-Jørgensen (1):
tunnel: Propagate ECT(1) when decapsulating as recommended by RFC6040
Tuong Lien (1):
tipc: fix partial topology connection closure
Vasundhara Volam (1):
bnxt_en: Reduce BNXT_MSIX_VEC_MAX value to supported CQs per PF.
Vincent Chen (1):
riscv: set max_pfn to the PFN of the last page
Willem de Bruijn (1):
net: stricter validation of untrusted gso packets
Xiyu Yang (5):
net/tls: Fix sk_psock refcnt leak in bpf_exec_tx_verdict() net/tls: Fix sk_psock refcnt leak when in tls_data_ready()
batman-adv: Fix refcnt leak in batadv_show_throughput_override
batman-adv: Fix refcnt leak in batadv_store_throughput_override
batman-adv: Fix refcnt leak in batadv_v_ogm_process
Yafang Shao (1):
mm, memcg: fix error return value of mem_cgroup_css_alloc()
Greg Kroah-Hartman
maintainerMakefile +1 -1
@@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 VERSION = 5 PATCHLEVEL = 4 -SUBLEVEL = 40 +SUBLEVEL = 41 EXTRAVERSION = NAME = Kleptomaniac Octopus
arch/arm/crypto/nhpoly1305-neon-glue.c +1 -1
@@ -30,7 +30,7 @@ static int nhpoly1305_neon_update(struct shash_desc *desc,return crypto_nhpoly1305_update (desc, src, srclen); do { - unsigned int n = min_t(unsigned int, srclen, PAGE_SIZE); + unsigned int n = min_t(unsigned int, srclen, SZ_4K); kernel_neon_begin(); crypto_nhpoly1305_update_helper(desc, src, n, _nh_neon);
arch/arm64/crypto/nhpoly1305-neon-glue.c +1 -1
@@ -30,7 +30,7 @@ static int nhpoly1305_neon_update(struct shash_desc *desc,return crypto_nhpoly1305_update (desc, src, srclen); do { - unsigned int n = min_t(unsigned int, srclen, PAGE_SIZE); + unsigned int n = min_t(unsigned int, srclen, SZ_4K); kernel_neon_begin(); crypto_nhpoly1305_update_helper(desc, src, n, _nh_neon);
arch/arm64/kvm/guest.c +7 -0
@@ -202,6 +202,13 @@ static int set_core_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *reg) }memcpy ((u32 *)regs + off, valp,KVM_REG_SIZE (reg->id)); + +if (*vcpu_cpsr (vcpu) &PSR_MODE32_BIT ) { +int i; + +for (i =0 ; i <16 ; i++) + *vcpu_reg32 (vcpu, i) = (u32)*vcpu_reg32 (vcpu, i); + } out:return err; }
arch/arm64/mm/hugetlbpage.c +2 -0
@@ -230,6 +230,8 @@ pte_t *huge_pte_alloc(struct mm_struct *mm, ptep = (pte_t *)pudp; }else if (sz == (CONT_PTE_SIZE )) { pmdp =pmd_alloc (mm, pudp, addr); +if (!pmdp) +return NULL ;WARN_ON (addr & (sz -1 ));/*
arch/riscv/mm/init.c +2 -1
@@ -116,7 +116,8 @@ void __init setup_bootmem(void)memblock_reserve (vmlinux_start, vmlinux_end - vmlinux_start);set_max_mapnr (PFN_DOWN (mem_size)); - max_low_pfn =PFN_DOWN (memblock_end_of_DRAM ()); + max_pfn =PFN_DOWN (memblock_end_of_DRAM ()); + max_low_pfn = max_pfn;#ifdef CONFIG_BLK_DEV_INITRD setup_initrd ();
arch/s390/kvm/priv.c +3 -1
@@ -626,10 +626,12 @@ static int handle_pqap(struct kvm_vcpu *vcpu)* available for the guest are AQIC and TAPQ with the t bit set * since we do not set IC.3 (FIII) we currently will only intercept * the AQIC function code. +* Note: running nested under z/VM can result in intercepts for other +* function codes, e.g. PQAP(QCI). We do not support this and bail out. */ reg0 = vcpu->run->s.regs.gprs[0 ]; fc = (reg0 >>24 ) &0xff ; -if (WARN_ON_ONCE (fc !=0x03 )) +if (fc !=0x03 )return -EOPNOTSUPP ;/* PQAP instruction is allowed for guest kernel only */
arch/x86/crypto/nhpoly1305-avx2-glue.c +1 -1
@@ -29,7 +29,7 @@ static int nhpoly1305_avx2_update(struct shash_desc *desc,return crypto_nhpoly1305_update (desc, src, srclen); do { - unsigned int n = min_t(unsigned int, srclen, PAGE_SIZE); + unsigned int n = min_t(unsigned int, srclen, SZ_4K); kernel_fpu_begin(); crypto_nhpoly1305_update_helper(desc, src, n, _nh_avx2);
arch/x86/crypto/nhpoly1305-sse2-glue.c +1 -1
@@ -29,7 +29,7 @@ static int nhpoly1305_sse2_update(struct shash_desc *desc,return crypto_nhpoly1305_update (desc, src, srclen); do { - unsigned int n = min_t(unsigned int, srclen, PAGE_SIZE); + unsigned int n = min_t(unsigned int, srclen, SZ_4K); kernel_fpu_begin(); crypto_nhpoly1305_update_helper(desc, src, n, _nh_sse2);
arch/x86/entry/calling.h +21 -19
@@ -98,13 +98,6 @@ For 32-bit we have the following conventions - kernel is built with#define SIZEOF_PTREGS 21*8 .macro PUSH_AND_CLEAR_REGS rdx=%rdx rax=%rax save_ret=0 -/* -* Push registers and sanitize registers of values that a -* speculation attack might otherwise want to exploit. The -* lower registers are likely clobbered well before they -* could be put to use in a speculative execution gadget. -* Interleave XOR with PUSH for better uop scheduling: -*/ .if \save_ret pushq %rsi /* pt_regs->si */ movq 8(%rsp), %rsi /* temporarily store the return address in %rsi */
@@ -114,34 +107,43 @@ For 32-bit we have the following conventions - kernel is built with pushq %rsi/* pt_regs->si */ .endif pushq \rdx /* pt_regs->dx */ - xorl %edx, %edx /* nospec dx */ pushq %rcx /* pt_regs->cx */ - xorl %ecx, %ecx /* nospec cx */ pushq \rax /* pt_regs->ax */ pushq %r8 /* pt_regs->r8 */ - xorl %r8d, %r8d /* nospec r8 */ pushq %r9 /* pt_regs->r9 */ - xorl %r9d, %r9d /* nospec r9 */ pushq %r10 /* pt_regs->r10 */ - xorl %r10d, %r10d /* nospec r10 */ pushq %r11 /* pt_regs->r11 */ - xorl %r11d, %r11d /* nospec r11*/ pushq %rbx /* pt_regs->rbx */ - xorl %ebx, %ebx /* nospec rbx*/ pushq %rbp /* pt_regs->rbp */ - xorl %ebp, %ebp /* nospec rbp*/ pushq %r12 /* pt_regs->r12 */ - xorl %r12d, %r12d /* nospec r12*/ pushq %r13 /* pt_regs->r13 */ - xorl %r13d, %r13d /* nospec r13*/ pushq %r14 /* pt_regs->r14 */ - xorl %r14d, %r14d /* nospec r14*/ pushq %r15 /* pt_regs->r15 */ - xorl %r15d, %r15d /* nospec r15*/UNWIND_HINT_REGS + .if \save_ret pushq %rsi /* return address on top of stack */ .endif + +/* +* Sanitize registers of values that a speculation attack might +* otherwise want to exploit. The lower registers are likely clobbered +* well before they could be put to use in a speculative execution +* gadget. +*/ + xorl %edx, %edx /* nospec dx */ + xorl %ecx, %ecx /* nospec cx */ + xorl %r8d, %r8d /* nospec r8 */ + xorl %r9d, %r9d /* nospec r9 */ + xorl %r10d, %r10d /* nospec r10 */ + xorl %r11d, %r11d /* nospec r11 */ + xorl %ebx, %ebx /* nospec rbx */ + xorl %ebp, %ebp /* nospec rbp */ + xorl %r12d, %r12d /* nospec r12 */ + xorl %r13d, %r13d /* nospec r13 */ + xorl %r14d, %r14d /* nospec r14 */ + xorl %r15d, %r15d /* nospec r15 */ + .endm .macro POP_REGS pop_rdi=1 skip_r11rcx=0
arch/x86/entry/entry_64.S +5 -4
@@ -249,7 +249,6 @@ GLOBAL(entry_SYSCALL_64_after_hwframe) */ syscall_return_via_sysret: /* rcx and r11 are already restored (see code above) */ - UNWIND_HINT_EMPTY POP_REGS pop_rdi=0 skip_r11rcx=1 /*
@@ -258,6 +257,7 @@ syscall_return_via_sysret: */ movq %rsp, %rdi movq PER_CPU_VAR(cpu_tss_rw + TSS_sp0), %rsp + UNWIND_HINT_EMPTY pushq RSP-RDI(%rdi) /* RSP */ pushq (%rdi) /* RDI */
@@ -512,7 +512,7 @@ END(spurious_entries_start) * +----------------------------------------------------+ */ ENTRY(interrupt_entry) - UNWIND_HINT_FUNC + UNWIND_HINT_IRET_REGS offset=16 ASM_CLAC cld
@@ -544,9 +544,9 @@ ENTRY(interrupt_entry) pushq 5*8(%rdi) /* regs->eflags */ pushq 4*8(%rdi) /* regs->cs */ pushq 3*8(%rdi) /* regs->ip */ + UNWIND_HINT_IRET_REGS pushq 2*8(%rdi) /* regs->orig_ax */ pushq 8(%rdi) /* return address */ - UNWIND_HINT_FUNC movq (%rdi), %rdi jmp 2f
@@ -637,6 +637,7 @@ GLOBAL(swapgs_restore_regs_and_return_to_usermode) */ movq %rsp, %rdi movq PER_CPU_VAR(cpu_tss_rw + TSS_sp0), %rsp + UNWIND_HINT_EMPTY /* Copy the IRET frame to the trampoline stack. */ pushq 6*8(%rdi) /* SS */
@@ -1739,7 +1740,7 @@ ENTRY(rewind_stack_do_exit) movq PER_CPU_VAR(cpu_current_top_of_stack), %rax leaq -PTREGS_SIZE(%rax), %rsp - UNWIND_HINT_FUNC sp_offset=PTREGS_SIZE + UNWIND_HINT_REGS call do_exit END(rewind_stack_do_exit)
arch/x86/include/asm/kvm_host.h +2 -2
@@ -1608,8 +1608,8 @@ void kvm_set_msi_irq(struct kvm *kvm, struct kvm_kernel_irq_routing_entry *e,static inline bool kvm_irq_is_postable (struct kvm_lapic_irq *irq) {/* We can only post Fixed and LowPrio IRQs */ -return (irq->delivery_mode == dest_Fixed || - irq->delivery_mode == dest_LowestPrio); +return (irq->delivery_mode ==APIC_DM_FIXED || + irq->delivery_mode ==APIC_DM_LOWEST ); }static inline void kvm_arch_vcpu_blocking (struct kvm_vcpu *vcpu)
arch/x86/include/asm/unwind.h +1 -1
@@ -19,7 +19,7 @@ struct unwind_state {#if defined(CONFIG_UNWINDER_ORC )bool signal, full_regs;unsigned long sp, bp, ip; -struct pt_regs *regs; +struct pt_regs *regs, *prev_regs;#elif defined(CONFIG_UNWINDER_FRAME_POINTER )bool got_irq;unsigned long *bp, *orig_sp, ip;
arch/x86/kernel/unwind_orc.c +45 -16
147 lines not on this page · raw message
arch/x86/kvm/svm.c +1 -1
@@ -1861,7 +1861,7 @@ static struct page **sev_pin_memory(struct kvm *kvm, unsigned long uaddr,return NULL ;/* Pin the user virtual address. */ - npinned =get_user_pages_fast (uaddr, npages,FOLL_WRITE , pages); + npinned =get_user_pages_fast (uaddr, npages, write ?FOLL_WRITE :0 , pages);if (npinned != npages) {pr_err ("SEV: Failure locking %lu pages.\n" , npages); goto err;
arch/x86/kvm/vmx/vmenter.S +3 -0
@@ -86,6 +86,9 @@ ENTRY(vmx_vmexit) /* IMPORTANT: Stuff the RSB immediately after VM-Exit, before RET! */ FILL_RETURN_BUFFER %_ASM_AX, RSB_CLEAR_LOOPS, X86_FEATURE_RETPOLINE + /* Clear RFLAGS.CF and RFLAGS.ZF to preserve VM-Exit, i.e. !VM-Fail. */ + or $1, %_ASM_AX + pop %_ASM_AX .Lvmexit_skip_rsb: #endif
block/blk-iocost.c +71 -46
214 lines not on this page · raw message
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +2 -5
@@ -3070,15 +3070,12 @@ int amdgpu_device_suspend(struct drm_device *dev, bool suspend, bool fbcon) } } -amdgpu_device_set_pg_state (adev,AMD_PG_STATE_UNGATE ); -amdgpu_device_set_cg_state (adev,AMD_CG_STATE_UNGATE ); - -amdgpu_amdkfd_suspend (adev); -amdgpu_ras_suspend (adev); r =amdgpu_device_ip_suspend_phase1 (adev); +amdgpu_amdkfd_suspend (adev); +/* evict vram memory */ amdgpu_bo_evict_vram (adev);
drivers/gpu/drm/ingenic/ingenic-drm.c +1 -0
@@ -824,6 +824,7 @@ static const struct of_device_id ingenic_drm_of_match[] = { { .compatible = "ingenic,jz4725b-lcd", .data = &jz4725b_soc_info }, { /* sentinel */ }, }; +MODULE_DEVICE_TABLE (of, ingenic_drm_of_match);static struct platform_driver ingenic_drm_driver = { .driver = {
drivers/hid/usbhid/hid-core.c +29 -8
@@ -682,16 +682,21 @@ static int usbhid_open(struct hid_device *hid)struct usbhid_device *usbhid = hid->driver_data;int res; +mutex_lock (&usbhid->mutex); +set_bit (HID_OPENED , &usbhid->iofl); -if (hid->quirks &HID_QUIRK_ALWAYS_POLL ) -return 0 ; +if (hid->quirks &HID_QUIRK_ALWAYS_POLL ) { + res =0 ; + goto Done; + } res =usb_autopm_get_interface (usbhid->intf);/* the device must be awake to reliably request remote wakeup */ if (res <0 ) {clear_bit (HID_OPENED , &usbhid->iofl); -return -EIO ; + res = -EIO ; + goto Done; } usbhid->intf->needs_remote_wakeup =1 ;
@@ -725,6 +730,9 @@ static int usbhid_open(struct hid_device *hid)msleep (50 );clear_bit (HID_RESUME_RUNNING , &usbhid->iofl); + + Done: +mutex_unlock (&usbhid->mutex);return res; }
@@ -732,6 +740,8 @@ static void usbhid_close(struct hid_device *hid) {struct usbhid_device *usbhid = hid->driver_data; +mutex_lock (&usbhid->mutex); +/* * Make sure we don't restart data acquisition due to * a resumption we no longer care about by avoiding racing
@@ -743,12 +753,13 @@ static void usbhid_close(struct hid_device *hid)clear_bit (HID_IN_POLLING , &usbhid->iofl);spin_unlock_irq (&usbhid->lock); -if (hid->quirks &HID_QUIRK_ALWAYS_POLL ) -return ; +if (!(hid->quirks &HID_QUIRK_ALWAYS_POLL )) { +hid_cancel_delayed_stuff (usbhid); +usb_kill_urb (usbhid->urbin); + usbhid->intf->needs_remote_wakeup =0 ; + } -hid_cancel_delayed_stuff (usbhid); -usb_kill_urb (usbhid->urbin); - usbhid->intf->needs_remote_wakeup =0 ; +mutex_unlock (&usbhid->mutex); }/*
@@ -1057,6 +1068,8 @@ static int usbhid_start(struct hid_device *hid)unsigned int n, insize =0 ;int ret; +mutex_lock (&usbhid->mutex); +clear_bit (HID_DISCONNECTED , &usbhid->iofl); usbhid->bufsize =HID_MIN_BUFFER_SIZE ;
@@ -1177,6 +1190,8 @@ static int usbhid_start(struct hid_device *hid)usbhid_set_leds (hid);device_set_wakeup_enable (&dev->dev,1 ); } + +mutex_unlock (&usbhid->mutex);return 0 ; fail:
@@ -1187,6 +1202,7 @@ static int usbhid_start(struct hid_device *hid) usbhid->urbout =NULL ; usbhid->urbctrl =NULL ;hid_free_buffers (dev, hid); +mutex_unlock (&usbhid->mutex);return ret; }
@@ -1202,6 +1218,8 @@ static void usbhid_stop(struct hid_device *hid) usbhid->intf->needs_remote_wakeup =0 ; } +mutex_lock (&usbhid->mutex); +clear_bit (HID_STARTED , &usbhid->iofl);spin_lock_irq (&usbhid->lock);/* Sync with error and led handlers */ set_bit (HID_DISCONNECTED , &usbhid->iofl);
@@ -1222,6 +1240,8 @@ static void usbhid_stop(struct hid_device *hid) usbhid->urbout =NULL ;hid_free_buffers (hid_to_usb_dev (hid), hid); + +mutex_unlock (&usbhid->mutex); }static int usbhid_power (struct hid_device *hid,int lvl)
@@ -1382,6 +1402,7 @@ static int usbhid_probe(struct usb_interface *intf, const struct usb_device_id *INIT_WORK (&usbhid->reset_work, hid_reset);timer_setup (&usbhid->io_retry, hid_retry_timeout,0 );spin_lock_init (&usbhid->lock); +mutex_init (&usbhid->mutex); ret =hid_add_device (hid);if (ret) {
drivers/hid/usbhid/usbhid.h +1 -0
@@ -80,6 +80,7 @@ struct usbhid_device {dma_addr_t outbuf_dma;/* Output buffer dma */ unsigned long last_out;/* record of last output for timeouts */ +struct mutex mutex;/* start/stop/open/close */ spinlock_t lock;/* fifo spinlock */ unsigned long iofl;/* I/O flags (CTRL_RUNNING, OUT_RUNNING) */ struct timer_list io_retry;/* Retry timer */
drivers/hid/wacom_sys.c +3 -1
@@ -319,9 +319,11 @@ static void wacom_feature_mapping(struct hid_device *hdev, data[0 ] = field->report->id; ret =wacom_get_report (hdev,HID_FEATURE_REPORT , data, n,WAC_CMD_RETRIES ); -if (ret == n) { +if (ret == n && features->type ==HID_GENERIC ) { ret =hid_report_raw_event (hdev,HID_FEATURE_REPORT , data, n,0 ); + }else if (ret ==2 && features->type !=HID_GENERIC ) { + features->touch_max = data[1 ]; }else { features->touch_max =16 ; hid_warn(hdev, "wacom_feature_mapping: "
drivers/hid/wacom_wac.c +22 -66
136 lines not on this page · raw message
drivers/iommu/virtio-iommu.c +1 -1
@@ -454,7 +454,7 @@ static int viommu_add_resv_mem(struct viommu_endpoint *vdev,if (!region)return -ENOMEM ; -list_add (&vdev->resv_regions, ®ion->list); +list_add (®ion->list, &vdev->resv_regions);return 0 ; }
drivers/net/ethernet/broadcom/bnxt/bnxt.c +13 -7
@@ -6649,7 +6649,7 @@ static int bnxt_alloc_ctx_pg_tbls(struct bnxt *bp,int rc;if (!mem_size) -return 0 ; +return -EINVAL ; ctx_pg->nr_pages =DIV_ROUND_UP (mem_size,BNXT_PAGE_SIZE );if (ctx_pg->nr_pages >MAX_CTX_TOTAL_PAGES ) {
@@ -9755,6 +9755,7 @@ static netdev_features_t bnxt_fix_features(struct net_device *dev, netdev_features_t features) {struct bnxt *bp =netdev_priv (dev); +netdev_features_t vlan_features;if ((features &NETIF_F_NTUPLE ) && !bnxt_rfs_capable (bp)) features &= ~NETIF_F_NTUPLE ;
@@ -9771,12 +9772,14 @@ static netdev_features_t bnxt_fix_features(struct net_device *dev,/* Both CTAG and STAG VLAN accelaration on the RX side have to be * turned on or off together. */ -if ((features & (NETIF_F_HW_VLAN_CTAG_RX |NETIF_F_HW_VLAN_STAG_RX )) != - (NETIF_F_HW_VLAN_CTAG_RX |NETIF_F_HW_VLAN_STAG_RX )) { + vlan_features = features & (NETIF_F_HW_VLAN_CTAG_RX | +NETIF_F_HW_VLAN_STAG_RX ); +if (vlan_features != (NETIF_F_HW_VLAN_CTAG_RX | +NETIF_F_HW_VLAN_STAG_RX )) {if (dev->features &NETIF_F_HW_VLAN_CTAG_RX ) features &= ~(NETIF_F_HW_VLAN_CTAG_RX |NETIF_F_HW_VLAN_STAG_RX ); -else +else if (vlan_features) features |=NETIF_F_HW_VLAN_CTAG_RX |NETIF_F_HW_VLAN_STAG_RX ; }
@@ -12066,12 +12069,15 @@ static pci_ers_result_t bnxt_io_slot_reset(struct pci_dev *pdev) } } -if (result !=PCI_ERS_RESULT_RECOVERED &&netif_running (netdev)) -dev_close (netdev); +if (result !=PCI_ERS_RESULT_RECOVERED ) { +if (netif_running (netdev)) +dev_close (netdev); +pci_disable_device (pdev); + }rtnl_unlock (); -return PCI_ERS_RESULT_RECOVERED ; +return result; }/**
drivers/net/ethernet/broadcom/bnxt/bnxt.h +0 -1
@@ -1058,7 +1058,6 @@ struct bnxt_vf_info {#define BNXT_VF_LINK_FORCED 0x4#define BNXT_VF_LINK_UP 0x8#define BNXT_VF_TRUST 0x10 -u32 func_flags;/* func cfg flags */ u32 min_tx_rate;u32 max_tx_rate;void *hwrm_cmd_req_addr;
drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.h +1 -1
@@ -39,7 +39,7 @@ static inline void bnxt_link_bp_to_dl(struct bnxt *bp, struct devlink *dl)#define NVM_OFF_DIS_GRE_VER_CHECK 171#define NVM_OFF_ENABLE_SRIOV 401 -#define BNXT_MSIX_VEC_MAX 1280 +#define BNXT_MSIX_VEC_MAX 512#define BNXT_MSIX_VEC_MIN_MAX 128enum bnxt_nvm_dir_type {
drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c +2 -8
@@ -85,11 +85,10 @@ int bnxt_set_vf_spoofchk(struct net_device *dev, int vf_id, bool setting)if (old_setting == setting)return 0 ; - func_flags = vf->func_flags;if (setting) - func_flags |=FUNC_CFG_REQ_FLAGS_SRC_MAC_ADDR_CHECK_ENABLE ; + func_flags =FUNC_CFG_REQ_FLAGS_SRC_MAC_ADDR_CHECK_ENABLE ;else - func_flags |=FUNC_CFG_REQ_FLAGS_SRC_MAC_ADDR_CHECK_DISABLE ; + func_flags =FUNC_CFG_REQ_FLAGS_SRC_MAC_ADDR_CHECK_DISABLE ;/*TODO: if the driver supports VLAN filter on guest VLAN, * the spoof check should also include vlan anti-spoofing */
@@ -98,7 +97,6 @@ int bnxt_set_vf_spoofchk(struct net_device *dev, int vf_id, bool setting) req.flags =cpu_to_le32 (func_flags); rc =hwrm_send_message (bp, &req,sizeof (req),HWRM_CMD_TIMEOUT );if (!rc) { - vf->func_flags = func_flags;if (setting) vf->flags |=BNXT_VF_SPOOFCHK ;else
@@ -230,7 +228,6 @@ int bnxt_set_vf_mac(struct net_device *dev, int vf_id, u8 *mac)memcpy (vf->mac_addr, mac,ETH_ALEN );bnxt_hwrm_cmd_hdr_init (bp, &req,HWRM_FUNC_CFG ,-1 ,-1 ); req.fid =cpu_to_le16 (vf->fw_fid); - req.flags =cpu_to_le32 (vf->func_flags); req.enables =cpu_to_le32 (FUNC_CFG_REQ_ENABLES_DFLT_MAC_ADDR );memcpy (req.dflt_mac_addr, mac,ETH_ALEN );return hwrm_send_message (bp, &req,sizeof (req),HWRM_CMD_TIMEOUT );
@@ -268,7 +265,6 @@ int bnxt_set_vf_vlan(struct net_device *dev, int vf_id, u16 vlan_id, u8 qos,bnxt_hwrm_cmd_hdr_init (bp, &req,HWRM_FUNC_CFG ,-1 ,-1 ); req.fid =cpu_to_le16 (vf->fw_fid); - req.flags =cpu_to_le32 (vf->func_flags); req.dflt_vlan =cpu_to_le16 (vlan_tag); req.enables =cpu_to_le32 (FUNC_CFG_REQ_ENABLES_DFLT_VLAN ); rc =hwrm_send_message (bp, &req,sizeof (req),HWRM_CMD_TIMEOUT );
@@ -307,7 +303,6 @@ int bnxt_set_vf_bw(struct net_device *dev, int vf_id, int min_tx_rate,return 0 ;bnxt_hwrm_cmd_hdr_init (bp, &req,HWRM_FUNC_CFG ,-1 ,-1 ); req.fid =cpu_to_le16 (vf->fw_fid); - req.flags =cpu_to_le32 (vf->func_flags); req.enables =cpu_to_le32 (FUNC_CFG_REQ_ENABLES_MAX_BW ); req.max_bw =cpu_to_le32 (max_tx_rate); req.enables |=cpu_to_le32 (FUNC_CFG_REQ_ENABLES_MIN_BW );
@@ -479,7 +474,6 @@ static void __bnxt_set_vf_params(struct bnxt *bp, int vf_id) vf = &bp->pf.vf[vf_id];bnxt_hwrm_cmd_hdr_init (bp, &req,HWRM_FUNC_CFG ,-1 ,-1 ); req.fid =cpu_to_le16 (vf->fw_fid); - req.flags =cpu_to_le32 (vf->func_flags);if (is_valid_ether_addr (vf->mac_addr)) { req.enables |=cpu_to_le32 (FUNC_CFG_REQ_ENABLES_DFLT_MAC_ADDR );
drivers/net/ethernet/cadence/macb_main.c +12 -12
@@ -334,8 +334,10 @@ static int macb_mdio_read(struct mii_bus *bus, int mii_id, int regnum)int status; status =pm_runtime_get_sync (&bp->pdev->dev); -if (status <0 ) +if (status <0 ) { +pm_runtime_put_noidle (&bp->pdev->dev); goto mdio_pm_exit; + } status =macb_mdio_wait_for_idle (bp);if (status <0 )
@@ -367,8 +369,10 @@ static int macb_mdio_write(struct mii_bus *bus, int mii_id, int regnum,int status; status =pm_runtime_get_sync (&bp->pdev->dev); -if (status <0 ) +if (status <0 ) { +pm_runtime_put_noidle (&bp->pdev->dev); goto mdio_pm_exit; + } status =macb_mdio_wait_for_idle (bp);if (status <0 )
@@ -3691,8 +3695,10 @@ static int at91ether_open(struct net_device *dev)int ret; ret =pm_runtime_get_sync (&lp->pdev->dev); -if (ret <0 ) +if (ret <0 ) { +pm_runtime_put_noidle (&lp->pdev->dev);return ret; + }/* Clear internal statistics */ ctl =macb_readl (lp,NCR );
@@ -4048,15 +4054,9 @@ static int fu540_c000_clk_init(struct platform_device *pdev, struct clk **pclk,static int fu540_c000_init (struct platform_device *pdev) { -struct resource *res; - - res =platform_get_resource (pdev,IORESOURCE_MEM ,1 ); -if (!res) -return -ENODEV ; - - mgmt->reg =ioremap (res->start,resource_size (res)); -if (!mgmt->reg) -return -ENOMEM ; + mgmt->reg =devm_platform_ioremap_resource (pdev,1 ); +if (IS_ERR (mgmt->reg)) +return PTR_ERR (mgmt->reg);return macb_init (pdev); }
drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c +3 -0
@@ -1422,6 +1422,9 @@ int mvpp2_ethtool_cls_rule_del(struct mvpp2_port *port,struct mvpp2_ethtool_fs *efs;int ret; +if (info->fs.location >=MVPP2_N_RFS_ENTRIES_PER_FLOW ) +return -EINVAL ; + efs = port->rfs_rules[info->fs.location];if (!efs)return -EINVAL ;
drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c +2 -0
@@ -4319,6 +4319,8 @@ static int mvpp2_ethtool_get_rxfh_context(struct net_device *dev, u32 *indir,if (!mvpp22_rss_is_supported ())return -EOPNOTSUPP ; +if (rss_context >=MVPP22_N_RSS_TABLES ) +return -EINVAL ;if (hfunc) *hfunc =ETH_RSS_HASH_CRC32 ;
drivers/net/ethernet/mellanox/mlx4/main.c +3 -1
@@ -2550,6 +2550,7 @@ static int mlx4_allocate_default_counters(struct mlx4_dev *dev)if (!err || err == -ENOSPC ) { priv->def_counter[port] = idx; + err =0 ; }else if (err == -ENOENT ) { err =0 ;continue ;
@@ -2600,7 +2601,8 @@ int mlx4_counter_alloc(struct mlx4_dev *dev, u32 *idx, u8 usage) MLX4_CMD_TIME_CLASS_A, MLX4_CMD_WRAPPED);if (!err) *idx =get_param_l (&out_param); - +if (WARN_ON (err == -ENOSPC )) + err = -EINVAL ;return err; }return __mlx4_counter_alloc (dev, idx);
drivers/net/ethernet/mellanox/mlx5/core/cmd.c +5 -1
@@ -888,7 +888,6 @@ static void cmd_work_handler(struct work_struct *work) } cmd->ent_arr[ent->idx] = ent; -set_bit (MLX5_CMD_ENT_STATE_PENDING_COMP , &ent->state); lay =get_inst (cmd, ent->idx); ent->lay = lay;memset (lay,0 ,sizeof (*lay));
@@ -910,6 +909,7 @@ static void cmd_work_handler(struct work_struct *work)if (ent->callback)schedule_delayed_work (&ent->cb_timeout_work, cb_timeout); +set_bit (MLX5_CMD_ENT_STATE_PENDING_COMP , &ent->state);/* Skip sending command to fw if internal error */ if (pci_channel_offline(dev->pdev) ||
@@ -922,6 +922,10 @@ static void cmd_work_handler(struct work_struct *work)MLX5_SET (mbox_out, ent->out, syndrome, drv_synd);mlx5_cmd_comp_handler (dev,1UL << ent->idx, true); +/* no doorbell, no need to keep the entry */ +free_ent (cmd, ent->idx); +if (ent->callback) +free_cmd (ent);return ; }
drivers/net/ethernet/mellanox/mlx5/core/steering/dr_send.c +13 -1
@@ -689,6 +689,12 @@ static void dr_cq_event(struct mlx5_core_cq *mcq,pr_info ("CQ event %u on CQ #%u\n" , event, mcq->cqn); } +static void dr_cq_complete (struct mlx5_core_cq *mcq, +struct mlx5_eqe *eqe) +{ +pr_err ("CQ completion CQ: #%u\n" , mcq->cqn); +} +static struct mlx5dr_cq *dr_create_cq (struct mlx5_core_dev *mdev,struct mlx5_uars_page *uar,size_t ncqe)
@@ -750,6 +756,7 @@ static struct mlx5dr_cq *dr_create_cq(struct mlx5_core_dev *mdev,mlx5_fill_page_frag_array (&cq->wq_ctrl.buf, pas); cq->mcq.event = dr_cq_event; + cq->mcq.comp = dr_cq_complete; err =mlx5_core_create_cq (mdev, &cq->mcq, in, inlen, out,sizeof (out));kvfree (in);
@@ -761,7 +768,12 @@ static struct mlx5dr_cq *dr_create_cq(struct mlx5_core_dev *mdev, cq->mcq.set_ci_db = cq->wq_ctrl.db.db; cq->mcq.arm_db = cq->wq_ctrl.db.db +1 ; *cq->mcq.set_ci_db =0 ; - *cq->mcq.arm_db =0 ; + +/* set no-zero value, in order to avoid the HW to run db-recovery on +* CQ that used in polling mode. +*/ + *cq->mcq.arm_db =cpu_to_be32 (2 <<28 ); + cq->mcq.vector =0 ; cq->mcq.irqn = irqn; cq->mcq.uar = uar;
drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c +10 -2
@@ -986,8 +986,9 @@ mlxsw_sp_acl_tcam_vchunk_create(struct mlxsw_sp *mlxsw_sp,unsigned int priority, struct mlxsw_afk_element_usage *elusage) { + struct mlxsw_sp_acl_tcam_vchunk *vchunk, *vchunk2;struct mlxsw_sp_acl_tcam_vregion *vregion; -struct mlxsw_sp_acl_tcam_vchunk *vchunk; +struct list_head *pos;int err;if (priority ==MLXSW_SP_ACL_TCAM_CATCHALL_PRIO )
@@ -1025,7 +1026,14 @@ mlxsw_sp_acl_tcam_vchunk_create(struct mlxsw_sp *mlxsw_sp, }mlxsw_sp_acl_tcam_rehash_ctx_vregion_changed (vregion); -list_add_tail (&vchunk->list, &vregion->vchunk_list); + +/* Position the vchunk inside the list according to priority */ +list_for_each (pos, &vregion->vchunk_list) { + vchunk2 =list_entry (pos,typeof (*vchunk2), list); +if (vchunk2->priority > priority) +break ; + } +list_add_tail (&vchunk->list, pos);mutex_unlock (&vregion->lock);return vchunk;
drivers/net/ethernet/netronome/nfp/abm/main.c +1 -0
@@ -283,6 +283,7 @@ nfp_abm_vnic_set_mac(struct nfp_pf *pf, struct nfp_abm *abm, struct nfp_net *nn,if (!nfp_nsp_has_hwinfo_lookup (nsp)) {nfp_warn (pf->cpp,"NSP doesn't support PF MAC generation\n" );eth_hw_addr_random (nn->dp.netdev); +nfp_nsp_close (nsp);return ; }
drivers/net/ethernet/toshiba/tc35815.c +1 -1
@@ -644,7 +644,7 @@ static int tc_mii_probe(struct net_device *dev)linkmode_set_bit (ETHTOOL_LINK_MODE_10baseT_Half_BIT, mask);linkmode_set_bit (ETHTOOL_LINK_MODE_100baseT_Half_BIT, mask); } -linkmode_and (phydev->supported, phydev->supported, mask); +linkmode_andnot (phydev->supported, phydev->supported, mask);linkmode_copy (phydev->advertising, phydev->supported); lp->link =0 ;
drivers/net/macsec.c +2 -1
@@ -1309,7 +1309,8 @@ static struct crypto_aead *macsec_alloc_tfm(char *key, int key_len, int icv_len)struct crypto_aead *tfm;int ret; - tfm =crypto_alloc_aead ("gcm(aes)" ,0 ,0 ); +/* Pick a sync gcm(aes) cipher to ensure order is preserved. */ + tfm =crypto_alloc_aead ("gcm(aes)" ,0 ,CRYPTO_ALG_ASYNC );if (IS_ERR (tfm))return tfm;
drivers/net/phy/dp83640.c +1 -1
@@ -1119,7 +1119,7 @@ static struct dp83640_clock *dp83640_clock_get_bus(struct mii_bus *bus) goto out; }dp83640_clock_init (clock, bus); -list_add_tail (&phyter_clocks, &clock->list); +list_add_tail (&clock->list, &phyter_clocks); out:mutex_unlock (&phyter_clocks_lock);
drivers/net/usb/qmi_wwan.c +1 -0
@@ -1359,6 +1359,7 @@ static const struct usb_device_id products[] = { {QMI_FIXED_INTF(0x413c, 0x81b3, 8)}, /* Dell Wireless 5809e Gobi(TM) 4G LTE Mobile Broadband Card (rev3) */ {QMI_FIXED_INTF(0x413c, 0x81b6, 8)}, /* Dell Wireless 5811e */ {QMI_FIXED_INTF(0x413c, 0x81b6, 10)}, /* Dell Wireless 5811e */ + {QMI_FIXED_INTF(0x413c, 0x81cc, 8)}, /* Dell Wireless 5816e */ {QMI_FIXED_INTF(0x413c, 0x81d7, 0)}, /* Dell Wireless 5821e */ {QMI_FIXED_INTF(0x413c, 0x81d7, 1)}, /* Dell Wireless 5821e preproduction config */ {QMI_FIXED_INTF(0x413c, 0x81e0, 0)}, /* Dell Wireless 5821e with eSIM support*/
drivers/nvme/host/core.c +13 -15
@@ -1071,8 +1071,17 @@ static int nvme_identify_ns_descs(struct nvme_ctrl *ctrl, unsigned nsid, status =nvme_submit_sync_cmd (ctrl->admin_q, &c, data,NVME_IDENTIFY_DATA_SIZE ); -if (status) +if (status) { +dev_warn (ctrl->device, +"Identify Descriptors failed (%d)\n" , status); +/* +* Don't treat an error as fatal, as we potentially already +* have a NGUID or EUI-64. +*/ +if (status >0 && !(status &NVME_SC_DNR )) + status =0 ; goto free_data; + }for (pos =0 ; pos <NVME_IDENTIFY_DATA_SIZE ; pos += len) {struct nvme_ns_id_desc *cur = data + pos;
@@ -1730,26 +1739,15 @@ static void nvme_config_write_zeroes(struct gendisk *disk, struct nvme_ns *ns)static int nvme_report_ns_ids (struct nvme_ctrl *ctrl,unsigned int nsid,struct nvme_id_ns *id,struct nvme_ns_ids *ids) { -int ret =0 ; -memset (ids,0 ,sizeof (*ids));if (ctrl->vs >=NVME_VS (1 ,1 ,0 ))memcpy (ids->eui64, id->eui64,sizeof (id->eui64));if (ctrl->vs >=NVME_VS (1 ,2 ,0 ))memcpy (ids->nguid, id->nguid,sizeof (id->nguid)); -if (ctrl->vs >=NVME_VS (1 ,3 ,0 )) { -/* Don't treat error as fatal we potentially -* already have a NGUID or EUI-64 -*/ - ret =nvme_identify_ns_descs (ctrl, nsid, ids); -if (ret) -dev_warn (ctrl->device, -"Identify Descriptors failed (%d)\n" , ret); -if (ret >0 ) - ret =0 ; - } -return ret; +if (ctrl->vs >=NVME_VS (1 ,3 ,0 )) +return nvme_identify_ns_descs (ctrl, nsid, ids); +return 0 ; }static bool nvme_ns_ids_valid (struct nvme_ns_ids *ids)
drivers/staging/gasket/gasket_core.c +4 -0
@@ -926,6 +926,10 @@ do_map_region(const struct gasket_dev *gasket_dev, struct vm_area_struct *vma,gasket_get_bar_index (gasket_dev, (vma->vm_pgoff <<PAGE_SHIFT ) + driver_desc->legacy_mmap_address_offset); + +if (bar_index <0 ) +return DO_MAP_REGION_INVALID ; + phys_base = gasket_dev->bar_data[bar_index].phys_base + phys_offset;while (mapped_bytes < map_length) {/*
drivers/tty/serial/xilinx_uartps.c +1 -0
@@ -1445,6 +1445,7 @@ static int cdns_uart_probe(struct platform_device *pdev) cdns_uart_uart_driver.nr =CDNS_UART_NR_PORTS ;#ifdef CONFIG_SERIAL_XILINX_PS_UART_CONSOLE cdns_uart_uart_driver.cons = &cdns_uart_console; + cdns_uart_console.index = id;#endif rc =uart_register_driver (&cdns_uart_uart_driver);
drivers/tty/vt/vt.c +7 -2
@@ -365,9 +365,14 @@ static struct uni_screen *vc_uniscr_alloc(unsigned int cols, unsigned int rows)return uniscr; } +static void vc_uniscr_free (struct uni_screen *uniscr) +{ +vfree (uniscr); +} +static void vc_uniscr_set (struct vc_data *vc,struct uni_screen *new_uniscr) { -vfree (vc->vc_uni_screen); +vc_uniscr_free (vc->vc_uni_screen); vc->vc_uni_screen = new_uniscr; }
@@ -1230,7 +1235,7 @@ static int vc_do_resize(struct tty_struct *tty, struct vc_data *vc, err =resize_screen (vc, new_cols, new_rows, user);if (err) {kfree (newscreen); -kfree (new_uniscr); +vc_uniscr_free (new_uniscr);return err; }
drivers/usb/chipidea/ci_hdrc_msm.c +1 -1
@@ -114,7 +114,7 @@ static int ci_hdrc_msm_notify_event(struct ci_hdrc *ci, unsigned event)hw_write_id_reg (ci,HS_PHY_GENCONFIG_2 ,HS_PHY_ULPI_TX_PKT_EN_CLR_FIX ,0 ); -if (!IS_ERR (ci->platdata->vbus_extcon.edev)) { +if (!IS_ERR (ci->platdata->vbus_extcon.edev) || ci->role_switch) {hw_write_id_reg (ci,HS_PHY_GENCONFIG_2 ,HS_PHY_SESS_VLD_CTRL_EN ,HS_PHY_SESS_VLD_CTRL_EN );
drivers/usb/serial/garmin_gps.c +2 -2
@@ -1138,8 +1138,8 @@ static void garmin_read_process(struct garmin_data *garmin_data_p,send it directly to the tty port */ if (garmin_data_p->flags &FLAGS_QUEUING ) {pkt_add (garmin_data_p, data, data_length); - }else if (bulk_data || -getLayerId (data) ==GARMIN_LAYERID_APPL ) { + }else if (bulk_data || (data_length >=sizeof (u32) && +getLayerId (data) ==GARMIN_LAYERID_APPL )) {spin_lock_irqsave (&garmin_data_p->lock, flags); garmin_data_p->flags |=APP_RESP_SEEN ;
drivers/usb/serial/qcserial.c +1 -0
@@ -173,6 +173,7 @@ static const struct usb_device_id id_table[] = { {DEVICE_SWI(0x413c, 0x81b3)}, /* Dell Wireless 5809e Gobi(TM) 4G LTE Mobile Broadband Card (rev3) */ {DEVICE_SWI(0x413c, 0x81b5)}, /* Dell Wireless 5811e QDL */ {DEVICE_SWI(0x413c, 0x81b6)}, /* Dell Wireless 5811e QDL */ + {DEVICE_SWI(0x413c, 0x81cc)}, /* Dell Wireless 5816e */ {DEVICE_SWI(0x413c, 0x81cf)}, /* Dell Wireless 5819 */ {DEVICE_SWI(0x413c, 0x81d0)}, /* Dell Wireless 5819 */ {DEVICE_SWI(0x413c, 0x81d1)}, /* Dell Wireless 5818 */
drivers/usb/storage/unusual_uas.h +7 -0
@@ -28,6 +28,13 @@* and don't forget to CC: the USB development list <[email protected]> */ +/* Reported-by: Julian Groß <[email protected]> */ +UNUSUAL_DEV (0x059f ,0x105f ,0x0000 ,0x9999 , +"LaCie" , +"2Big Quadra USB3" , +USB_SC_DEVICE ,USB_PR_DEVICE ,NULL , + US_FL_NO_REPORT_OPCODES), +/* * Apricorn USB3 dongle sometimes returns "USBSUSBSUSBS" in response to SCSI * commands in UAS mode. Observed with the 1.28 firmware; are there others?
fs/ceph/mds_client.c +3 -5
@@ -3072,8 +3072,7 @@ static void handle_session(struct ceph_mds_session *session,void *end = p + msg->front.iov_len;struct ceph_mds_session_head *h;u32 op; -u64 seq; -unsigned long features =0 ; +u64 seq, features =0 ;int wake =0 ;bool blacklisted = false;
@@ -3092,9 +3091,8 @@ static void handle_session(struct ceph_mds_session *session, goto bad;/* version >= 3, feature bits */ ceph_decode_32_safe (&p, end, len, bad); -ceph_decode_need (&p, end, len, bad); -memcpy (&features, p,min_t (size_t, len,sizeof (features))); - p += len; +ceph_decode_64_safe (&p, end, features, bad); + p += len -sizeof (features); }mutex_lock (&mdsc->mutex);
fs/ceph/quota.c +2 -2
@@ -159,8 +159,8 @@ static struct inode *lookup_quotarealm_inode(struct ceph_mds_client *mdsc, }if (IS_ERR (in)) { -pr_warn ("Can't lookup inode %llx (err: %ld)\n" , - realm->ino,PTR_ERR (in)); +dout ("Can't lookup inode %llx (err: %ld)\n" , + realm->ino,PTR_ERR (in)); qri->timeout = jiffies +msecs_to_jiffies (60 *1000 );/* XXX */ }else { qri->timeout =0 ;
fs/coredump.c +8 -0
@@ -788,6 +788,14 @@ void do_coredump(const kernel_siginfo_t *siginfo)if (displaced)put_files_struct (displaced);if (!dump_interrupted ()) { +/* +* umh disabled with CONFIG_STATIC_USERMODEHELPER_PATH="" would +* have this set to NULL. +*/ +if (!cprm.file) { +pr_info ("Core dump to |%s disabled\n" , cn.corename); + goto close_fail; + }file_start_write (cprm.file); core_dumped = binfmt->core_dump (&cprm);file_end_write (cprm.file);
fs/eventpoll.c +33 -28
105 lines not on this page · raw message
fs/notify/fanotify/fanotify.c +7 -2
@@ -26,7 +26,7 @@ static bool should_merge(struct fsnotify_event *old_fsn, old =FANOTIFY_E (old_fsn); new =FANOTIFY_E (new_fsn); -if (old_fsn->inode != new_fsn->inode || old->pid != new->pid || +if (old_fsn->objectid != new_fsn->objectid || old->pid != new->pid || old->fh_type != new->fh_type || old->fh_len != new->fh_len)return false;
@@ -314,7 +314,12 @@ struct fanotify_event *fanotify_alloc_event(struct fsnotify_group *group,if (!event) goto out; init:__maybe_unused -fsnotify_init_event (&event->fse, inode); +/* +* Use the victim inode instead of the watching inode as the id for +* event queue, so event reported on parent is merged with event +* reported on child when both directory and child watches exist. +*/ +fsnotify_init_event (&event->fse, (unsigned long )id); event->mask = mask;if (FAN_GROUP_FLAG (group,FAN_REPORT_TID )) event->pid =get_pid (task_pid (current));
fs/notify/inotify/inotify_fsnotify.c +2 -2
@@ -39,7 +39,7 @@ static bool event_compare(struct fsnotify_event *old_fsn,if (old->mask &FS_IN_IGNORED )return false;if ((old->mask == new->mask) && - (old_fsn->inode == new_fsn->inode) && + (old_fsn->objectid == new_fsn->objectid) && (old->name_len == new->name_len) && (!old->name_len || !strcmp (old->name, new->name)))return true;
@@ -118,7 +118,7 @@ int inotify_handle_event(struct fsnotify_group *group, mask &= ~IN_ISDIR ; fsn_event = &event->fse; -fsnotify_init_event (fsn_event, inode); +fsnotify_init_event (fsn_event, (unsigned long )inode); event->mask = mask; event->wd = i_mark->wd; event->sync_cookie = cookie;
fs/notify/inotify/inotify_user.c +1 -1
@@ -635,7 +635,7 @@ static struct fsnotify_group *inotify_new_group(unsigned int max_events)return ERR_PTR (-ENOMEM ); } group->overflow_event = &oevent->fse; -fsnotify_init_event (group->overflow_event,NULL ); +fsnotify_init_event (group->overflow_event,0 ); oevent->mask =FS_Q_OVERFLOW ; oevent->wd =-1 ; oevent->sync_cookie =0 ;
include/linux/backing-dev-defs.h +1 -0
@@ -220,6 +220,7 @@ struct backing_dev_info {wait_queue_head_t wb_waitq;struct device *dev; +char dev_name[64 ];struct device *owner;struct timer_list laptop_mode_wb_timer;
include/linux/backing-dev.h +1 -8
@@ -505,13 +505,6 @@ static inline int bdi_rw_congested(struct backing_dev_info *bdi) (1 << WB_async_congested)); } -extern const char *bdi_unknown_name; - -static inline const char *bdi_dev_name (struct backing_dev_info *bdi) -{ -if (!bdi || !bdi->dev) -return bdi_unknown_name; -return dev_name (bdi->dev); -} +const char *bdi_dev_name (struct backing_dev_info *bdi);#endif /* _LINUX_BACKING_DEV_H */
include/linux/fsnotify_backend.h +3 -4
@@ -133,8 +133,7 @@ struct fsnotify_ops {*/ struct fsnotify_event {struct list_head list; -/* inode may ONLY be dereferenced during handle_event(). */ -struct inode *inode;/* either the inode the event happened to or its parent */ +unsigned long objectid;/* identifier for queue merges */ };/*
@@ -500,10 +499,10 @@ extern void fsnotify_finish_user_wait(struct fsnotify_iter_info *iter_info);extern bool fsnotify_prepare_user_wait (struct fsnotify_iter_info *iter_info);static inline void fsnotify_init_event (struct fsnotify_event *event, -struct inode *inode) +unsigned long objectid) {INIT_LIST_HEAD (&event->list); - event->inode = inode; + event->objectid = objectid; }#else
include/linux/virtio_net.h +24 -2
@@ -3,6 +3,8 @@#define _LINUX_VIRTIO_NET_H#include <linux/if_vlan.h> +#include <uapi/linux/tcp.h> +#include <uapi/linux/udp.h> #include <uapi/linux/virtio_net.h> static inline int virtio_net_hdr_set_proto(struct sk_buff *skb,
@@ -28,17 +30,25 @@ static inline int virtio_net_hdr_to_skb(struct sk_buff *skb, bool little_endian) {unsigned int gso_type =0 ; +unsigned int thlen =0 ; +unsigned int ip_proto;if (hdr->gso_type !=VIRTIO_NET_HDR_GSO_NONE ) {switch (hdr->gso_type & ~VIRTIO_NET_HDR_GSO_ECN ) {case VIRTIO_NET_HDR_GSO_TCPV4 : gso_type =SKB_GSO_TCPV4 ; + ip_proto =IPPROTO_TCP ; + thlen =sizeof (struct tcphdr );break ;case VIRTIO_NET_HDR_GSO_TCPV6 : gso_type =SKB_GSO_TCPV6 ; + ip_proto =IPPROTO_TCP ; + thlen =sizeof (struct tcphdr );break ;case VIRTIO_NET_HDR_GSO_UDP : gso_type =SKB_GSO_UDP ; + ip_proto =IPPROTO_UDP ; + thlen =sizeof (struct udphdr );break ;default :return -EINVAL ;
@@ -57,16 +67,22 @@ static inline int virtio_net_hdr_to_skb(struct sk_buff *skb,if (!skb_partial_csum_set (skb, start, off))return -EINVAL ; + +if (skb_transport_offset (skb) + thlen >skb_headlen (skb)) +return -EINVAL ; }else {/* gso packets without NEEDS_CSUM do not set transport_offset. * probe and drop if does not match one of the above types. */ if (gso_type && skb->network_header) { +struct flow_keys_basic keys; +if (!skb->protocol)virtio_net_hdr_set_proto (skb, hdr); retry: -skb_probe_transport_header (skb); -if (!skb_transport_header_was_set (skb)) { +if (!skb_flow_dissect_flow_keys_basic (NULL , skb, &keys, +NULL ,0 ,0 ,0 , +0 )) {/* UFO does not specify ipv4 or 6: try both */ if (gso_type &SKB_GSO_UDP && skb->protocol ==htons (ETH_P_IP )) {
@@ -75,6 +91,12 @@ static inline int virtio_net_hdr_to_skb(struct sk_buff *skb, }return -EINVAL ; } + +if (keys.control.thoff + thlen >skb_headlen (skb) || + keys.basic.ip_proto != ip_proto) +return -EINVAL ; + +skb_set_transport_header (skb, keys.control.thoff); } }
include/net/inet_ecn.h +55 -2
81 lines not on this page · raw message
include/net/ip6_fib.h +4 -0
@@ -177,6 +177,7 @@ struct fib6_info {struct rt6_info {struct dst_entry dst;struct fib6_info __rcu *from; +int sernum;struct rt6key rt6i_dst;struct rt6key rt6i_src;
@@ -260,6 +261,9 @@ static inline u32 rt6_get_cookie(const struct rt6_info *rt)struct fib6_info *from;u32 cookie =0 ; +if (rt->sernum) +return rt->sernum; +rcu_read_lock (); from =rcu_dereference (rt->from);
include/net/net_namespace.h +7 -0
@@ -428,6 +428,13 @@ static inline int rt_genid_ipv4(struct net *net)return atomic_read (&net->ipv4.rt_genid); } +#if IS_ENABLED (CONFIG_IPV6 ) +static inline int rt_genid_ipv6 (const struct net *net) +{ +return atomic_read (&net->ipv6.fib6_sernum); +} +#endif +static inline void rt_genid_bump_ipv4 (struct net *net) {atomic_inc (&net->ipv4.rt_genid);
ipc/mqueue.c +26 -8
@@ -82,6 +82,7 @@ struct mqueue_inode_info {struct sigevent notify;struct pid *notify_owner; +u32 notify_self_exec_id;struct user_namespace *notify_user_ns;struct user_struct *user;/* user who created, for accounting */ struct sock *notify_sock;
@@ -709,28 +710,44 @@ static void __do_notify(struct mqueue_inode_info *info)* synchronously. */ if (info->notify_owner && info->attr.mq_curmsgs ==1 ) { -struct kernel_siginfo sig_i;switch (info->notify.sigev_notify) {case SIGEV_NONE :break ; -case SIGEV_SIGNAL : -/* sends signal */ +case SIGEV_SIGNAL : { +struct kernel_siginfo sig_i; +struct task_struct *task; + +/* do_mq_notify() accepts sigev_signo == 0, why?? */ +if (!info->notify.sigev_signo) +break ;clear_siginfo (&sig_i); sig_i.si_signo = info->notify.sigev_signo; sig_i.si_errno =0 ; sig_i.si_code =SI_MESGQ ; sig_i.si_value = info->notify.sigev_value; -/* map current pid/uid into info->owner's namespaces */ rcu_read_lock (); +/* map current pid/uid into info->owner's namespaces */ sig_i.si_pid =task_tgid_nr_ns (current,ns_of_pid (info->notify_owner)); - sig_i.si_uid =from_kuid_munged (info->notify_user_ns,current_uid ()); + sig_i.si_uid =from_kuid_munged (info->notify_user_ns, +current_uid ()); +/* +* We can't use kill_pid_info(), this signal should +* bypass check_kill_permission(). It is from kernel +* but si_fromuser() can't know this. +* We do check the self_exec_id, to avoid sending +* signals to programs that don't expect them. +*/ + task =pid_task (info->notify_owner,PIDTYPE_TGID ); +if (task && task->self_exec_id == + info->notify_self_exec_id) { +do_send_sig_info (info->notify.sigev_signo, + &sig_i, task,PIDTYPE_TGID ); + }rcu_read_unlock (); - -kill_pid_info (info->notify.sigev_signo, - &sig_i, info->notify_owner);break ; + }case SIGEV_THREAD :set_cookie (info->notify_cookie,NOTIFY_WOKENUP );netlink_sendskb (info->notify_sock, info->notify_cookie);
@@ -1315,6 +1332,7 @@ static int do_mq_notify(mqd_t mqdes, const struct sigevent *notification) info->notify.sigev_signo = notification->sigev_signo; info->notify.sigev_value = notification->sigev_value; info->notify.sigev_notify =SIGEV_SIGNAL ; + info->notify_self_exec_id = current->self_exec_id;break ; }
kernel/trace/trace.c +13 -0
@@ -8318,6 +8318,19 @@ static int allocate_trace_buffers(struct trace_array *tr, int size)*/ allocate_snapshot = false;#endif + +/* +* Because of some magic with the way alloc_percpu() works on +* x86_64, we need to synchronize the pgd of all the tables, +* otherwise the trace events that happen in x86_64 page fault +* handlers can't cope with accessing the chance that a +* alloc_percpu()'d memory might be touched in the page fault trace +* event. Oh, and we need to audit all other alloc_percpu() and vmalloc() +* calls in tracing, because something might get triggered within a +* page fault trace event! +*/ +vmalloc_sync_mappings (); +return 0 ; }
kernel/trace/trace_kprobe.c +1 -1
@@ -454,7 +454,7 @@ static bool __within_notrace_func(unsigned long addr)static bool within_notrace_func (struct trace_kprobe *tk) { -unsigned long addr = addr =trace_kprobe_address (tk); +unsigned long addr =trace_kprobe_address (tk);char symname[KSYM_NAME_LEN ], *p;if (!__within_notrace_func (addr))
kernel/umh.c +5 -0
@@ -544,6 +544,11 @@ EXPORT_SYMBOL_GPL(fork_usermode_blob);* Runs a user-space application. The application is started * asynchronously if wait is not set, and runs as a child of system workqueues. * (ie. it runs with full root capabilities and optimized affinity). +* +* Note: successful return value does not guarantee the helper was called at +* all. You can't rely on sub_info->{init,cleanup} being called even for +* UMH_WAIT_* wait modes as STATIC_USERMODEHELPER_PATH="" turns all helpers +* into a successful no-op. */ int call_usermodehelper_exec (struct subprocess_info *sub_info,int wait) {
mm/backing-dev.c +11 -2
@@ -21,7 +21,7 @@ struct backing_dev_info noop_backing_dev_info = {EXPORT_SYMBOL_GPL (noop_backing_dev_info);static struct class *bdi_class; -const char *bdi_unknown_name ="(unknown)" ; +static const char *bdi_unknown_name ="(unknown)" ;/* * bdi_lock protects bdi_tree and updates to bdi_list. bdi_list has RCU
@@ -938,7 +938,8 @@ int bdi_register_va(struct backing_dev_info *bdi, const char *fmt, va_list args)if (bdi->dev)/* The driver needs to use separate queues per device */ return 0 ; - dev =device_create_vargs (bdi_class,NULL ,MKDEV (0 ,0 ), bdi, fmt, args); +vsnprintf (bdi->dev_name,sizeof (bdi->dev_name), fmt, args); + dev =device_create (bdi_class,NULL ,MKDEV (0 ,0 ), bdi, bdi->dev_name);if (IS_ERR (dev))return PTR_ERR (dev);
@@ -1043,6 +1044,14 @@ void bdi_put(struct backing_dev_info *bdi) }EXPORT_SYMBOL (bdi_put); +const char *bdi_dev_name (struct backing_dev_info *bdi) +{ +if (!bdi || !bdi->dev) +return bdi_unknown_name; +return bdi->dev_name; +} +EXPORT_SYMBOL_GPL (bdi_dev_name); +static wait_queue_head_t congestion_wqh[2 ] = {__WAIT_QUEUE_HEAD_INITIALIZER (congestion_wqh[0 ]),__WAIT_QUEUE_HEAD_INITIALIZER (congestion_wqh[1 ])
mm/memcontrol.c +9 -6
@@ -5101,19 +5101,22 @@ static struct mem_cgroup *mem_cgroup_alloc(void)unsigned int size;int node;int __maybe_unused i; +long error = -ENOMEM ; size =sizeof (struct mem_cgroup ); size += nr_node_ids *sizeof (struct mem_cgroup_per_node *); memcg =kzalloc (size,GFP_KERNEL );if (!memcg) -return NULL ; +return ERR_PTR (error); memcg->id.id =idr_alloc (&mem_cgroup_idr,NULL ,1 ,MEM_CGROUP_ID_MAX ,GFP_KERNEL ); -if (memcg->id.id <0 ) +if (memcg->id.id <0 ) { + error = memcg->id.id; goto fail; + } memcg->vmstats_local = alloc_percpu(struct memcg_vmstats_percpu);if (!memcg->vmstats_local)
@@ -5158,7 +5161,7 @@ static struct mem_cgroup *mem_cgroup_alloc(void) fail:mem_cgroup_id_remove (memcg);__mem_cgroup_free (memcg); -return NULL ; +return ERR_PTR (error); } static struct cgroup_subsys_state * __ref
@@ -5169,8 +5172,8 @@ mem_cgroup_css_alloc(struct cgroup_subsys_state *parent_css)long error = -ENOMEM ; memcg =mem_cgroup_alloc (); -if (!memcg) -return ERR_PTR (error); +if (IS_ERR (memcg)) +return ERR_CAST (memcg); memcg->high =PAGE_COUNTER_MAX ; memcg->soft_limit =PAGE_COUNTER_MAX ;
@@ -5220,7 +5223,7 @@ mem_cgroup_css_alloc(struct cgroup_subsys_state *parent_css) fail:mem_cgroup_id_remove (memcg);mem_cgroup_free (memcg); -return ERR_PTR (-ENOMEM ); +return ERR_PTR (error); }static int mem_cgroup_css_online (struct cgroup_subsys_state *css)
mm/page_alloc.c +9 -0
@@ -1555,6 +1555,7 @@ void set_zone_contiguous(struct zone *zone)if (!__pageblock_pfn_to_page (block_start_pfn, block_end_pfn, zone))return ; +cond_resched (); }/* We confirm that there is no hole */
@@ -2350,6 +2351,14 @@ static inline void boost_watermark(struct zone *zone)if (!watermark_boost_factor)return ; +/* +* Don't bother in zones that are unlikely to produce results. +* On small machines, including kdump capture kernels running +* in a small area, boosting the watermark can cause an out of +* memory situation immediately. +*/ +if ((pageblock_nr_pages *4 ) >zone_managed_pages (zone)) +return ; max_boost =mult_frac (zone->_watermark[WMARK_HIGH ], watermark_boost_factor,10000 );
net/batman-adv/bat_v_ogm.c +1 -1
@@ -897,7 +897,7 @@ static void batadv_v_ogm_process(const struct sk_buff *skb, int ogm_offset, orig_node =batadv_v_ogm_orig_get (bat_priv, ogm_packet->orig);if (!orig_node) -return ; + goto out; neigh_node =batadv_neigh_node_get_or_create (orig_node, if_incoming, ethhdr->h_source);
net/batman-adv/network-coding.c +1 -8
@@ -1009,15 +1009,8 @@ static struct batadv_nc_path *batadv_nc_get_path(struct batadv_priv *bat_priv,*/ static u8 batadv_nc_random_weight_tq (u8 tq) { -u8 rand_val, rand_tq; - -get_random_bytes (&rand_val,sizeof (rand_val)); -/* randomize the estimated packet loss (max TQ - estimated TQ) */ - rand_tq = rand_val * (BATADV_TQ_MAX_VALUE - tq); - -/* normalize the randomized packet loss */ - rand_tq /=BATADV_TQ_MAX_VALUE ; +u8 rand_tq =prandom_u32_max (BATADV_TQ_MAX_VALUE +1 - tq);/* convert to (randomized) estimated tq again */ return BATADV_TQ_MAX_VALUE - rand_tq;
net/batman-adv/sysfs.c +2 -1
@@ -1150,7 +1150,7 @@ static ssize_t batadv_store_throughput_override(struct kobject *kobj, ret =batadv_parse_throughput (net_dev, buff,"throughput_override" , &tp_override);if (!ret) -return count; + goto out; old_tp_override =atomic_read (&hard_iface->bat_v.throughput_override);if (old_tp_override == tp_override)
@@ -1190,6 +1190,7 @@ static ssize_t batadv_show_throughput_override(struct kobject *kobj, tp_override =atomic_read (&hard_iface->bat_v.throughput_override); +batadv_hardif_put (hard_iface);return sprintf (buff,"%u.%u MBit\n" , tp_override /10 , tp_override %10 ); }
net/core/devlink.c +5 -0
@@ -3907,6 +3907,11 @@ static int devlink_nl_cmd_region_read_dumpit(struct sk_buff *skb, end_offset =nla_get_u64 (attrs[DEVLINK_ATTR_REGION_CHUNK_ADDR ]); end_offset +=nla_get_u64 (attrs[DEVLINK_ATTR_REGION_CHUNK_LEN ]); dump = false; + +if (start_offset == end_offset) { + err =0 ; + goto nla_put_failure; + } } err = devlink_nl_region_read_snapshot_fill(skb, devlink,
net/core/neighbour.c +3 -3
@@ -1954,6 +1954,9 @@ static int neigh_add(struct sk_buff *skb, struct nlmsghdr *nlh, NEIGH_UPDATE_F_OVERRIDE_ISROUTER); } +if (protocol) + neigh->protocol = protocol; +if (ndm->ndm_flags &NTF_EXT_LEARNED ) flags |=NEIGH_UPDATE_F_EXT_LEARNED ;
@@ -1967,9 +1970,6 @@ static int neigh_add(struct sk_buff *skb, struct nlmsghdr *nlh, err =__neigh_update (neigh, lladdr, ndm->ndm_state, flags,NETLINK_CB (skb).portid, extack); -if (protocol) - neigh->protocol = protocol; -neigh_release (neigh); out:
net/dsa/master.c +2 -1
@@ -259,7 +259,8 @@ static void dsa_master_ndo_teardown(struct net_device *dev) {struct dsa_port *cpu_dp = dev->dsa_ptr; - dev->netdev_ops = cpu_dp->orig_ndo_ops; +if (cpu_dp->orig_ndo_ops) + dev->netdev_ops = cpu_dp->orig_ndo_ops; cpu_dp->orig_ndo_ops =NULL ; }
net/ipv6/route.c +25 -0
@@ -1388,9 +1388,18 @@ static struct rt6_info *ip6_rt_pcpu_alloc(const struct fib6_result *res) }ip6_rt_copy_init (pcpu_rt, res); pcpu_rt->rt6i_flags |=RTF_PCPU ; + +if (f6i->nh) + pcpu_rt->sernum =rt_genid_ipv6 (dev_net (dev)); +return pcpu_rt; } +static bool rt6_is_valid (const struct rt6_info *rt6) +{ +return rt6->sernum ==rt_genid_ipv6 (dev_net (rt6->dst.dev)); +} +/* It should be called with rcu_read_lock() acquired */ static struct rt6_info *rt6_get_pcpu_route (const struct fib6_result *res) {
@@ -1398,6 +1407,19 @@ static struct rt6_info *rt6_get_pcpu_route(const struct fib6_result *res) pcpu_rt =this_cpu_read (*res->nh->rt6i_pcpu); +if (pcpu_rt && pcpu_rt->sernum && !rt6_is_valid (pcpu_rt)) { +struct rt6_info *prev, **p; + + p =this_cpu_ptr (res->nh->rt6i_pcpu); + prev =xchg (p,NULL ); +if (prev) { +dst_dev_put (&prev->dst); +dst_release (&prev->dst); + } + + pcpu_rt =NULL ; + } +return pcpu_rt; }
@@ -2599,6 +2621,9 @@ static struct dst_entry *ip6_dst_check(struct dst_entry *dst, u32 cookie) rt = container_of(dst, struct rt6_info, dst); +if (rt->sernum) +return rt6_is_valid (rt) ? dst :NULL ; +rcu_read_lock ();/* All IPV6 dsts are created with ->obsolete set to the value
net/netfilter/nf_nat_proto.c +1 -3
@@ -68,15 +68,13 @@ static bool udp_manip_pkt(struct sk_buff *skb, enum nf_nat_manip_type maniptype) {struct udphdr *hdr; -bool do_csum;if (skb_ensure_writable (skb, hdroff +sizeof (*hdr)))return false; hdr = (struct udphdr *)(skb->data + hdroff); - do_csum = hdr->check || skb->ip_summed ==CHECKSUM_PARTIAL ; +__udp_manip_pkt (skb, iphdroff, hdr, tuple, maniptype, !!hdr->check); -__udp_manip_pkt (skb, iphdroff, hdr, tuple, maniptype, do_csum);return true; }
net/netfilter/nfnetlink_osf.c +7 -5
@@ -165,12 +165,12 @@ static bool nf_osf_match_one(const struct sk_buff *skb,static const struct tcphdr *nf_osf_hdr_ctx_init (struct nf_osf_hdr_ctx *ctx,const struct sk_buff *skb,const struct iphdr *ip, -unsigned char *opts) +unsigned char *opts, +struct tcphdr *_tcph) {const struct tcphdr *tcp; -struct tcphdr _tcph; - tcp =skb_header_pointer (skb,ip_hdrlen (skb),sizeof (struct tcphdr ), &_tcph); + tcp =skb_header_pointer (skb,ip_hdrlen (skb),sizeof (struct tcphdr ), _tcph);if (!tcp)return NULL ;
@@ -205,10 +205,11 @@ nf_osf_match(const struct sk_buff *skb, u_int8_t family,int fmatch =FMATCH_WRONG ;struct nf_osf_hdr_ctx ctx;const struct tcphdr *tcp; +struct tcphdr _tcph;memset (&ctx,0 ,sizeof (ctx)); - tcp =nf_osf_hdr_ctx_init (&ctx, skb, ip, opts); + tcp =nf_osf_hdr_ctx_init (&ctx, skb, ip, opts, &_tcph);if (!tcp)return false;
@@ -265,10 +266,11 @@ bool nf_osf_find(const struct sk_buff *skb,const struct nf_osf_finger *kf;struct nf_osf_hdr_ctx ctx;const struct tcphdr *tcp; +struct tcphdr _tcph;memset (&ctx,0 ,sizeof (ctx)); - tcp =nf_osf_hdr_ctx_init (&ctx, skb, ip, opts); + tcp =nf_osf_hdr_ctx_init (&ctx, skb, ip, opts, &_tcph);if (!tcp)return false;
net/sched/sch_choke.c +2 -1
@@ -323,7 +323,8 @@ static void choke_reset(struct Qdisc *sch) sch->q.qlen =0 ; sch->qstats.backlog =0 ; -memset (q->tab,0 , (q->tab_mask +1 ) *sizeof (struct sk_buff *)); +if (q->tab) +memset (q->tab,0 , (q->tab_mask +1 ) *sizeof (struct sk_buff *)); q->head = q->tail =0 ;red_restart (&q->vars); }
net/sched/sch_fq_codel.c +1 -1
@@ -417,7 +417,7 @@ static int fq_codel_change(struct Qdisc *sch, struct nlattr *opt, q->quantum =max (256U ,nla_get_u32 (tb[TCA_FQ_CODEL_QUANTUM ]));if (tb[TCA_FQ_CODEL_DROP_BATCH_SIZE ]) - q->drop_batch_size =min (1U ,nla_get_u32 (tb[TCA_FQ_CODEL_DROP_BATCH_SIZE ])); + q->drop_batch_size =max (1U ,nla_get_u32 (tb[TCA_FQ_CODEL_DROP_BATCH_SIZE ]));if (tb[TCA_FQ_CODEL_MEMORY_LIMIT ]) q->memory_limit =min (1U <<31 ,nla_get_u32 (tb[TCA_FQ_CODEL_MEMORY_LIMIT ]));
net/sched/sch_sfq.c +9 -0
@@ -637,6 +637,15 @@ static int sfq_change(struct Qdisc *sch, struct nlattr *opt)if (ctl->divisor && (!is_power_of_2 (ctl->divisor) || ctl->divisor >65536 ))return -EINVAL ; + +/* slot->allot is a short, make sure quantum is not too big. */ +if (ctl->quantum) { +unsigned int scaled =SFQ_ALLOT_SIZE (ctl->quantum); + +if (scaled <=0 || scaled >SHRT_MAX ) +return -EINVAL ; + } +if (ctl_v1 && !red_check_params (ctl_v1->qth_min, ctl_v1->qth_max, ctl_v1->Wlog))return -EINVAL ;
net/sched/sch_skbprio.c +3 -0
@@ -169,6 +169,9 @@ static int skbprio_change(struct Qdisc *sch, struct nlattr *opt, {struct tc_skbprio_qopt *ctl =nla_data (opt); +if (opt->nla_len !=nla_attr_size (sizeof (*ctl))) +return -EINVAL ; + sch->limit = ctl->limit;return 0 ; }
net/sctp/sm_statefuns.c +3 -3
@@ -1865,7 +1865,7 @@ static enum sctp_disposition sctp_sf_do_dupcook_a(*/ sctp_add_cmd_sf (commands,SCTP_CMD_REPLY ,SCTP_CHUNK (repl));return sctp_sf_do_9_2_start_shutdown (net, ep, asoc, -SCTP_ST_CHUNK (0 ),NULL , +SCTP_ST_CHUNK (0 ), repl, commands); }else { sctp_add_cmd_sf(commands, SCTP_CMD_NEW_STATE,
@@ -5470,7 +5470,7 @@ enum sctp_disposition sctp_sf_do_9_2_start_shutdown(* in the Cumulative TSN Ack field the last sequential TSN it * has received from the peer. */ - reply =sctp_make_shutdown (asoc,NULL ); + reply =sctp_make_shutdown (asoc, arg);if (!reply) goto nomem;
@@ -6068,7 +6068,7 @@ enum sctp_disposition sctp_sf_autoclose_timer_expire( disposition =SCTP_DISPOSITION_CONSUME ;if (sctp_outq_is_empty (&asoc->outqueue)) { disposition =sctp_sf_do_9_2_start_shutdown (net, ep, asoc, type, - arg, commands); +NULL , commands); }return disposition;
net/tipc/topsrv.c +3 -2
@@ -402,10 +402,11 @@ static int tipc_conn_rcv_from_sock(struct tipc_conn *con)read_lock_bh (&sk->sk_callback_lock); ret =tipc_conn_rcv_sub (srv, con, &s);read_unlock_bh (&sk->sk_callback_lock); +if (!ret) +return 0 ; } -if (ret <0 ) -tipc_conn_close (con); +tipc_conn_close (con);return ret; }
net/tls/tls_sw.c +5 -2
@@ -797,6 +797,8 @@ static int bpf_exec_tx_verdict(struct sk_msg *msg, struct sock *sk, *copied -=sk_msg_free (sk, msg);tls_free_open_rec (sk); } +if (psock) +sk_psock_put (sk, psock);return err; } more_data:
@@ -2076,8 +2078,9 @@ static void tls_data_ready(struct sock *sk)strp_data_ready (&ctx->strp); psock =sk_psock_get (sk); -if (psock && !list_empty (&psock->ingress_msg)) { - ctx->saved_data_ready (sk); +if (psock) { +if (!list_empty (&psock->ingress_msg)) + ctx->saved_data_ready (sk);sk_psock_put (sk, psock); } }
scripts/decodecode +1 -1
@@ -126,7 +126,7 @@ faultlinenum=$(( $(wc -l $T.oo | cut -d" " -f1) - \ faultline=`cat $T.dis | head -1 | cut -d":" -f2-` faultline=`echo "$faultline" | sed -e 's/\[/\\\[/g; s/\]/\\\]/g'` -cat $T.oo | sed -e "${faultlinenum}s/^\(.*:\)\(.*\)/\1\*\2\t\t<-- trapping instruction/" +cat $T.oo | sed -e "${faultlinenum}s/^\([^:]*:\)\(.*\)/\1\*\2\t\t<-- trapping instruction/" echo cat $T.aa cleanup
tools/cgroup/iocost_monitor.py +6 -1
@@ -159,7 +159,12 @@ class IocgStat: else: self.inflight_pct = 0 - self.debt_ms = iocg.abs_vdebt.counter.value_() / VTIME_PER_USEC / 1000 + # vdebt used to be an atomic64_t and is now u64, support both + try: + self.debt_ms = iocg.abs_vdebt.counter.value_() / VTIME_PER_USEC / 1000 + except: + self.debt_ms = iocg.abs_vdebt.value_() / VTIME_PER_USEC / 1000 + self.use_delay = blkg.use_delay.counter.value_() self.delay_ms = blkg.delay_nsec.counter.value_() / 1_000_000
tools/objtool/check.c +1 -1
@@ -1402,7 +1402,7 @@ static int update_insn_state_regs(struct instruction *insn, struct insn_state *sstruct cfi_reg *cfa = &state->cfa;struct stack_op *op = &insn->stack_op; -if (cfa->base !=CFI_SP ) +if (cfa->base !=CFI_SP && cfa->base !=CFI_SP_INDIRECT )return 0 ;/* push */
virt/kvm/arm/hyp/aarch32.c +6 -2
@@ -125,12 +125,16 @@ static void __hyp_text kvm_adjust_itstate(struct kvm_vcpu *vcpu)*/ void __hyp_text kvm_skip_instr32(struct kvm_vcpu *vcpu, bool is_wide_instr) { +u32 pc = *vcpu_pc (vcpu);bool is_thumb; is_thumb = !!(*vcpu_cpsr (vcpu) &PSR_AA32_T_BIT );if (is_thumb && !is_wide_instr) - *vcpu_pc (vcpu) +=2 ; + pc +=2 ;else - *vcpu_pc (vcpu) +=4 ; + pc +=4 ; + + *vcpu_pc (vcpu) = pc; +kvm_adjust_itstate (vcpu); }
virt/kvm/arm/vgic/vgic-mmio.c +2 -2
@@ -389,7 +389,7 @@ static void vgic_mmio_change_active(struct kvm_vcpu *vcpu, struct vgic_irq *irq,static void vgic_change_active_prepare (struct kvm_vcpu *vcpu,u32 intid) {if (vcpu->kvm->arch.vgic.vgic_model ==KVM_DEV_TYPE_ARM_VGIC_V3 || - intid >VGIC_NR_PRIVATE_IRQS ) + intid >=VGIC_NR_PRIVATE_IRQS )kvm_arm_halt_guest (vcpu->kvm); }
@@ -397,7 +397,7 @@ static void vgic_change_active_prepare(struct kvm_vcpu *vcpu, u32 intid)static void vgic_change_active_finish (struct kvm_vcpu *vcpu,u32 intid) {if (vcpu->kvm->arch.vgic.vgic_model ==KVM_DEV_TYPE_ARM_VGIC_V3 || - intid >VGIC_NR_PRIVATE_IRQS ) + intid >=VGIC_NR_PRIVATE_IRQS )kvm_arm_resume_guest (vcpu->kvm); }