1. 15 8月, 2020 13 次提交
    • L
      dma-debug: remove debug_dma_assert_idle() function · 5848dc5b
      Linus Torvalds 提交于
      This remoes the code from the COW path to call debug_dma_assert_idle(),
      which was added many years ago.
      
      Google shows that it hasn't caught anything in the 6+ years we've had it
      apart from a false positive, and Hugh just noticed how it had a very
      unfortunate spinlock serialization in the COW path.
      
      He fixed that issue the previous commit (a85ffd59: "dma-debug: fix
      debug_dma_assert_idle(), use rcu_read_lock()"), but let's see if anybody
      even notices when we remove this function entirely.
      
      NOTE! We keep the dma tracking infrastructure that was added by the
      commit that introduced it.  Partly to make it easier to resurrect this
      debug code if we ever deside to, and partly because that tracking by pfn
      and offset looks quite reasonable.
      
      The problem with this debug code was simply that it was expensive and
      didn't seem worth it, not that it was wrong per se.
      Acked-by: NDan Williams <dan.j.williams@intel.com>
      Acked-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      5848dc5b
    • H
      dma-debug: fix debug_dma_assert_idle(), use rcu_read_lock() · a85ffd59
      Hugh Dickins 提交于
      Since commit 2a9127fc ("mm: rewrite wait_on_page_bit_common()
      logic") improved unlock_page(), it has become more noticeable how
      cow_user_page() in a kernel with CONFIG_DMA_API_DEBUG=y can create and
      suffer from heavy contention on DMA debug's radix_lock in
      debug_dma_assert_idle().
      
      It is only doing a lookup: use rcu_read_lock() and rcu_read_unlock()
      instead; though that does require the static ents[] to be moved
      onstack...
      
      ...but, hold on, isn't that radix_tree_gang_lookup() and loop doing
      quite the wrong thing: searching CACHELINES_PER_PAGE entries for an
      exact match with the first cacheline of the page in question?
      radix_tree_gang_lookup() is the right tool for the job, but we need
      nothing more than to check the first entry it can find, reporting if
      that falls anywhere within the page.
      
      (Is RCU safe here? As safe as using the spinlock was. The entries are
      never freed, so don't need to be freed by RCU. They may be reused, and
      there is a faint chance of a race, with an offending entry reused while
      printing its error info; but the spinlock did not prevent that either,
      and I agree that it's not worth worrying about. ]
      
      [ Side noe: this patch is a clear improvement to the status quo, but the
        next patch will be removing this debug function entirely.
      
        But just in case we decide we want to resurrect the debugging code
        some day, I'm first applying this improvement patch so that it doesn't
        get lost    - Linus ]
      
      Fixes: 3b7a6418 ("dma debug: account for cachelines and read-only mappings in overlap tracking")
      Signed-off-by: NHugh Dickins <hughd@google.com>
      Acked-by: NDan Williams <dan.j.williams@intel.com>
      Acked-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a85ffd59
    • L
      Merge tag 'timers-urgent-2020-08-14' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · b923f124
      Linus Torvalds 提交于
      Pull timekeeping updates from Thomas Gleixner:
       "A set of timekeeping/VDSO updates:
      
         - Preparatory work to allow S390 to switch over to the generic VDSO
           implementation.
      
           S390 requires that the VDSO data pointer is handed in to the
           counter read function when time namespace support is enabled.
           Adding the pointer is a NOOP for all other architectures because
           the compiler is supposed to optimize that out when it is unused in
           the architecture specific inline. The change also solved a similar
           problem for MIPS which fortunately has time namespaces not yet
           enabled.
      
           S390 needs to update clock related VDSO data independent of the
           timekeeping updates. This was solved so far with yet another
           sequence counter in the S390 implementation. A better solution is
           to utilize the already existing VDSO sequence count for this. The
           core code now exposes helper functions which allow to serialize
           against the timekeeper code and against concurrent readers.
      
           S390 needs extra data for their clock readout function. The initial
           common VDSO data structure did not provide a way to add that. It
           now has an embedded architecture specific struct embedded which
           defaults to an empty struct.
      
           Doing this now avoids tree dependencies and conflicts post rc1 and
           allows all other architectures which work on generic VDSO support
           to work from a common upstream base.
      
         - A trivial comment fix"
      
      * tag 'timers-urgent-2020-08-14' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        time: Delete repeated words in comments
        lib/vdso: Allow to add architecture-specific vdso data
        timekeeping/vsyscall: Provide vdso_update_begin/end()
        vdso/treewide: Add vdso_data pointer argument to __arch_get_hw_counter()
      b923f124
    • L
      Merge tag 'timers-core-2020-08-14' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · b6b178e3
      Linus Torvalds 提交于
      Pull more timer updates from Thomas Gleixner:
       "A set of posix CPU timer changes which allows to defer the heavy work
        of posix CPU timers into task work context. The tick interrupt is
        reduced to a quick check which queues the work which is doing the
        heavy lifting before returning to user space or going back to guest
        mode. Moving this out is deferring the signal delivery slightly but
        posix CPU timers are inaccurate by nature as they depend on the tick
        so there is no real damage. The relevant test cases all passed.
      
        This lifts the last offender for RT out of the hard interrupt context
        tick handler, but it also has the general benefit that the actual
        heavy work is accounted to the task/process and not to the tick
        interrupt itself.
      
        Further optimizations are possible to break long sighand lock hold and
        interrupt disabled (on !RT kernels) times when a massive amount of
        posix CPU timers (which are unpriviledged) is armed for a
        task/process.
      
        This is currently only enabled for x86 because the architecture has to
        ensure that task work is handled in KVM before entering a guest, which
        was just established for x86 with the new common entry/exit code which
        got merged post 5.8 and is not the case for other KVM architectures"
      
      * tag 'timers-core-2020-08-14' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86: Select POSIX_CPU_TIMERS_TASK_WORK
        posix-cpu-timers: Provide mechanisms to defer timer handling to task_work
        posix-cpu-timers: Split run_posix_cpu_timers()
      b6b178e3
    • L
      Merge tag 'irq-urgent-2020-08-14' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 1d229a65
      Linus Torvalds 提交于
      Pull irq fixes from Thomas Gleixner:
       "Two fixes in the core interrupt code which ensure that all error exits
        unlock the descriptor lock"
      
      * tag 'irq-urgent-2020-08-14' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        genirq: Unlock irq descriptor after errors
        genirq/PM: Always unlock IRQ descriptor in rearm_wake_irq()
      1d229a65
    • L
      Merge tag 'for-linus' of git://github.com/openrisc/linux · e1d74fbe
      Linus Torvalds 提交于
      Pull OpenRISC updates from Stafford Horne:
       "A few patches all over the place during this cycle, mostly bug and
        sparse warning fixes for OpenRISC, but a few enhancements too. Note,
        there are 2 non OpenRISC specific fixups.
      
        Non OpenRISC fixes:
      
         - In init we need to align the init_task correctly to fix an issue
           with MUTEX_FLAGS, reviewed by Peter Z. No one picked this up so I
           kept it on my tree.
      
         - In asm-generic/io.h I fixed up some sparse warnings, OK'd by Arnd.
           Arnd asked to merge it via my tree.
      
        OpenRISC fixes:
      
         - Many fixes for OpenRISC sprase warnings.
      
         - Add support OpenRISC SMP tlb flushing rather than always flushing
           the entire TLB on every CPU.
      
         - Fix bug when dumping stack via /proc/xxx/stack of user threads"
      
      * tag 'for-linus' of git://github.com/openrisc/linux:
        openrisc: uaccess: Add user address space check to access_ok
        openrisc: signal: Fix sparse address space warnings
        openrisc: uaccess: Remove unused macro __addr_ok
        openrisc: uaccess: Use static inline function in access_ok
        openrisc: uaccess: Fix sparse address space warnings
        openrisc: io: Fixup defines and move include to the end
        asm-generic/io.h: Fix sparse warnings on big-endian architectures
        openrisc: Implement proper SMP tlb flushing
        openrisc: Fix oops caused when dumping stack
        openrisc: Add support for external initrd images
        init: Align init_task to avoid conflict with MUTEX_FLAGS
        openrisc: fix __user in raw_copy_to_user()'s prototype
      e1d74fbe
    • L
      Merge tag 'powerpc-5.9-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux · 7fca4dee
      Linus Torvalds 提交于
      Pull powerpc fix from Michael Ellerman:
       "One fix for a boot crash on some platforms introduced by the recent
        pkey refactoring.
      
        Thanks to Christian Zigotzky and Aneesh Kumar K.V"
      
      * tag 'powerpc-5.9-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
        powerpc/pkeys: Fix boot failures with Nemo board (A-EON AmigaOne X1000)
      7fca4dee
    • L
      Merge tag 'for-linus-5.9-rc1b-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip · 0520058d
      Linus Torvalds 提交于
      Pull more xen updates from Juergen Gross:
      
       - Remove support for running as 32-bit Xen PV-guest.
      
         32-bit PV guests are rarely used, are lacking security fixes for
         Meltdown, and can be easily replaced by PVH mode. Another series for
         doing more cleanup will follow soon (removal of 32-bit-only pvops
         functionality).
      
       - Fixes and additional features for the Xen display frontend driver.
      
      * tag 'for-linus-5.9-rc1b-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
        drm/xen-front: Pass dumb buffer data offset to the backend
        xen: Sync up with the canonical protocol definition in Xen
        drm/xen-front: Add YUYV to supported formats
        drm/xen-front: Fix misused IS_ERR_OR_NULL checks
        xen/gntdev: Fix dmabuf import with non-zero sgt offset
        x86/xen: drop tests for highmem in pv code
        x86/xen: eliminate xen-asm_64.S
        x86/xen: remove 32-bit Xen PV guest support
      0520058d
    • L
      Merge tag 'hyperv-fixes-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux · cd94257d
      Linus Torvalds 提交于
      Pull hyper-v fixes from Wei Liu:
      
       - fix oops reporting on Hyper-V
      
       - make objtool happy
      
      * tag 'hyperv-fixes-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux:
        x86/hyperv: Make hv_setup_sched_clock inline
        Drivers: hv: vmbus: Only notify Hyper-V for die events that are oops
      cd94257d
    • E
      x86/fsgsbase/64: Fix NULL deref in 86_fsgsbase_read_task · 8ab49526
      Eric Dumazet 提交于
      syzbot found its way in 86_fsgsbase_read_task() and triggered this oops:
      
         KASAN: null-ptr-deref in range [0x0000000000000008-0x000000000000000f]
         CPU: 0 PID: 6866 Comm: syz-executor262 Not tainted 5.8.0-syzkaller #0
         RIP: 0010:x86_fsgsbase_read_task+0x16d/0x310 arch/x86/kernel/process_64.c:393
         Call Trace:
           putreg32+0x3ab/0x530 arch/x86/kernel/ptrace.c:876
           genregs32_set arch/x86/kernel/ptrace.c:1026 [inline]
           genregs32_set+0xa4/0x100 arch/x86/kernel/ptrace.c:1006
           copy_regset_from_user include/linux/regset.h:326 [inline]
           ia32_arch_ptrace arch/x86/kernel/ptrace.c:1061 [inline]
           compat_arch_ptrace+0x36c/0xd90 arch/x86/kernel/ptrace.c:1198
           __do_compat_sys_ptrace kernel/ptrace.c:1420 [inline]
           __se_compat_sys_ptrace kernel/ptrace.c:1389 [inline]
           __ia32_compat_sys_ptrace+0x220/0x2f0 kernel/ptrace.c:1389
           do_syscall_32_irqs_on arch/x86/entry/common.c:84 [inline]
           __do_fast_syscall_32+0x57/0x80 arch/x86/entry/common.c:126
           do_fast_syscall_32+0x2f/0x70 arch/x86/entry/common.c:149
           entry_SYSENTER_compat_after_hwframe+0x4d/0x5c
      
      This can happen if ptrace() or sigreturn() pokes an LDT selector into FS
      or GS for a task with no LDT and something tries to read the base before
      a return to usermode notices the bad selector and fixes it.
      
      The fix is to make sure ldt pointer is not NULL.
      
      Fixes: 07e1d88a ("x86/fsgsbase/64: Fix ptrace() to read the FS/GS base accurately")
      Co-developed-by: NJann Horn <jannh@google.com>
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Reported-by: Nsyzbot <syzkaller@googlegroups.com>
      Acked-by: NAndy Lutomirski <luto@kernel.org>
      Cc: Chang S. Bae <chang.seok.bae@intel.com>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Brian Gerst <brgerst@gmail.com>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: Denys Vlasenko <dvlasenk@redhat.com>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Markus T Metzger <markus.t.metzger@intel.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ravi Shankar <ravi.v.shankar@intel.com>
      Cc: Rik van Riel <riel@surriel.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Ingo Molnar <mingo@kernel.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      8ab49526
    • L
      Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 · d9361cb2
      Linus Torvalds 提交于
      Pull crypto fix from Herbert Xu:
       "This fixes a regression in af_alg"
      
      * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
        crypto: algif_aead - fix uninitialized ctx->init
      d9361cb2
    • L
      Merge tag 'modules-for-v5.9' of git://git.kernel.org/pub/scm/linux/kernel/git/jeyu/linux · 0fd9cc6b
      Linus Torvalds 提交于
      Pull module updates from Jessica Yu:
       "The most important change would be Christoph Hellwig's patch
        implementing proprietary taint inheritance, in an effort to discourage
        the creation of GPL "shim" modules that interface between GPL symbols
        and proprietary symbols.
      
        Summary:
      
         - Have modules that use symbols from proprietary modules inherit the
           TAINT_PROPRIETARY_MODULE taint, in an effort to prevent GPL shim
           modules that are used to circumvent _GPL exports. These are modules
           that claim to be GPL licensed while also using symbols from
           proprietary modules. Such modules will be rejected while non-GPL
           modules will inherit the proprietary taint.
      
         - Module export space cleanup. Unexport symbols that are unused
           outside of module.c or otherwise used in only built-in code"
      
      * tag 'modules-for-v5.9' of git://git.kernel.org/pub/scm/linux/kernel/git/jeyu/linux:
        modules: inherit TAINT_PROPRIETARY_MODULE
        modules: return licensing information from find_symbol
        modules: rename the licence field in struct symsearch to license
        modules: unexport __module_address
        modules: unexport __module_text_address
        modules: mark each_symbol_section static
        modules: mark find_symbol static
        modules: mark ref_module static
        modules: linux/moduleparam.h: drop duplicated word in a comment
      0fd9cc6b
    • L
      Merge tag 'kconfig-v5.9' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild · 32b2ee5c
      Linus Torvalds 提交于
      Pull Kconfig updates from Masahiro Yamada:
      
       - remove '---help---' keyword support
      
       - fix mouse events for 'menuconfig' symbols in search view of qconf
      
       - code cleanups of qconf
      
      * tag 'kconfig-v5.9' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (24 commits)
        kconfig: qconf: move setOptionMode() to ConfigList from ConfigView
        kconfig: qconf: do not limit the pop-up menu to the first row
        kconfig: qconf: refactor icon setups
        kconfig: qconf: remove unused voidPix, menuInvPix
        kconfig: qconf: remove ConfigItem::text/setText
        kconfig: qconf: remove ConfigList::addColumn/removeColumn
        kconfig: qconf: remove ConfigItem::pixmap/setPixmap
        kconfig: qconf: drop more localization code
        kconfig: qconf: remove 'parent' from ConfigList::updateMenuList()
        kconfig: qconf: remove unused argument from ConfigView::updateList()
        kconfig: qconf: remove unused argument from ConfigList::updateList()
        kconfig: qconf: omit parent to QHBoxLayout()
        kconfig: qconf: remove name from ConfigSearchWindow constructor
        kconfig: qconf: remove unused ConfigList::listView()
        kconfig: qconf: overload addToolBar() to create and insert toolbar
        kconfig: qconf: remove toolBar from ConfigMainWindow members
        kconfig: qconf: use 'menu' variable for (QMenu *)
        kconfig: qconf: do not use 'menu' variable for (QMenuBar *)
        kconfig: qconf: remove ->addSeparator() to menuBar
        kconfig: add 'static' to some file-local data
        ...
      32b2ee5c
  2. 14 8月, 2020 27 次提交