Skip to content
  1. Aug 15, 2020
    • Kees Cook's avatar
      selftests/exec: add file type errno tests · 0f71241a
      Kees Cook authored
      
      
      Make sure execve() returns the expected errno values for non-regular
      files.
      
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Cc: Marc Zyngier <maz@kernel.org>
      Link: http://lkml.kernel.org/r/20200813231723.2725102-3-keescook@chromium.org
      
      
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      0f71241a
    • Kees Cook's avatar
      exec: restore EACCES of S_ISDIR execve() · fc4177be
      Kees Cook authored
      
      
      Patch series "Fix S_ISDIR execve() errno".
      
      Fix an errno change for execve() of directories, noticed by Marc Zyngier.
      Along with the fix, include a regression test to avoid seeing this return
      in the future.
      
      This patch (of 2):
      
      The return code for attempting to execute a directory has always been
      EACCES.  Adjust the S_ISDIR exec test to reflect the old errno instead of
      the general EISDIR for other kinds of "open" attempts on directories.
      
      Fixes: 633fb6ac ("exec: move S_ISREG() check earlier")
      Reported-by: default avatarMarc Zyngier <maz@kernel.org>
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Tested-by: default avatarGreg Kroah-Hartman <gregkh@android.com>
      Reviewed-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
      Link: http://lkml.kernel.org/r/20200813231723.2725102-2-keescook@chromium.org
      Link: https://lore.kernel.org/lkml/20200813151305.6191993b@why
      
      
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      fc4177be
    • Nick Terrell's avatar
      lz4: fix kernel decompression speed · b1a3e75e
      Nick Terrell authored
      This patch replaces all memcpy() calls with LZ4_memcpy() which calls
      __builtin_memcpy() so the compiler can inline it.
      
      LZ4 relies heavily on memcpy() with a constant size being inlined.  In x86
      and i386 pre-boot environments memcpy() cannot be inlined because memcpy()
      doesn't get defined as __builtin_memcpy().
      
      An equivalent patch has been applied upstream so that the next import
      won't lose this change [1].
      
      I've measured the kernel decompression speed using QEMU before and after
      this patch for the x86_64 and i386 architectures.  The speed-up is about
      10x as shown below.
      
      Code	Arch	Kernel Size	Time	Speed
      v5.8	x86_64	11504832 B	148 ms	 79 MB/s
      patch	x86_64	11503872 B	 13 ms	885 MB/s
      v5.8	i386	 9621216 B	 91 ms	106 MB/s
      patch	i386	 9620224 B	 10 ms	962 MB/s
      
      I also measured the time to decompress the initramfs on x86_64, i386, and
      arm.  All three show the same decompression speed before and after, as
      expected.
      
      [1] https://github.com/lz4/lz4/pull/890
      
      
      
      Signed-off-by: default avatarNick Terrell <terrelln@fb.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Cc: Yann Collet <yann.collet.73@gmail.com>
      Cc: Gao Xiang <gaoxiang25@huawei.com>
      Cc: Sven Schmidt <4sschmid@informatik.uni-hamburg.de>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Arvind Sankar <nivedita@alum.mit.edu>
      Link: http://lkml.kernel.org/r/20200803194022.2966806-1-nickrterrell@gmail.com
      
      
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      b1a3e75e
    • Baoquan He's avatar
      Revert "mm/vmstat.c: do not show lowmem reserve protection information of empty zone" · a8a4b7ae
      Baoquan He authored
      
      
      This reverts commit 26e7dead.
      
      Sonny reported that one of their tests started failing on the latest
      kernel on their Chrome OS platform.  The root cause is that the above
      commit removed the protection line of empty zone, while the parser used in
      the test relies on the protection line to mark the end of each zone.
      
      Let's revert it to avoid breaking userspace testing or applications.
      
      Fixes: 26e7dead ("mm/vmstat.c: do not show lowmem reserve protection information of empty zone)"
      Reported-by: default avatarSonny Rao <sonnyrao@chromium.org>
      Signed-off-by: default avatarBaoquan He <bhe@redhat.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Reviewed-by: default avatarDavid Hildenbrand <david@redhat.com>
      Acked-by: default avatarDavid Rientjes <rientjes@google.com>
      Cc: <stable@vger.kernel.org>	[5.8.x]
      Link: http://lkml.kernel.org/r/20200811075412.12872-1-bhe@redhat.com
      
      
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      a8a4b7ae
    • Mike Rapoport's avatar
      asm-generic: pgalloc.h: use correct #ifdef to enable pud_alloc_one() · 9922c1de
      Mike Rapoport authored
      
      
      The #ifdef statement that guards the generic version of pud_alloc_one() by
      mistake used __HAVE_ARCH_PUD_FREE instead of __HAVE_ARCH_PUD_ALLOC_ONE.
      
      Fix it.
      
      Fixes: d9e8b929 ("asm-generic: pgalloc: provide generic pud_alloc_one() and pud_free_one()")
      Reported-by: default avatarkernel test robot <lkp@intel.com>
      Signed-off-by: default avatarMike Rapoport <rppt@linux.ibm.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Link: http://lkml.kernel.org/r/20200812191415.GE163101@linux.ibm.com
      
      
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      9922c1de
    • Linus Torvalds's avatar
      Merge tag 'timers-urgent-2020-08-14' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · b923f124
      Linus Torvalds authored
      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
    • Linus Torvalds's avatar
      Merge tag 'timers-core-2020-08-14' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · b6b178e3
      Linus Torvalds authored
      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
    • Linus Torvalds's avatar
      Merge tag 'irq-urgent-2020-08-14' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 1d229a65
      Linus Torvalds authored
      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
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://github.com/openrisc/linux · e1d74fbe
      Linus Torvalds authored
      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
    • Linus Torvalds's avatar
      Merge tag 'powerpc-5.9-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux · 7fca4dee
      Linus Torvalds authored
      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
    • Linus Torvalds's avatar
      Merge tag 'for-linus-5.9-rc1b-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip · 0520058d
      Linus Torvalds authored
      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
    • Linus Torvalds's avatar
      Merge tag 'hyperv-fixes-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux · cd94257d
      Linus Torvalds authored
      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
    • Eric Dumazet's avatar
      x86/fsgsbase/64: Fix NULL deref in 86_fsgsbase_read_task · 8ab49526
      Eric Dumazet authored
      
      
      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: default avatarJann Horn <jannh@google.com>
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Reported-by: default avatarsyzbot <syzkaller@googlegroups.com>
      Acked-by: default avatarAndy 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: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      8ab49526
    • Linus Torvalds's avatar
      Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 · d9361cb2
      Linus Torvalds authored
      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
    • Linus Torvalds's avatar
      Merge tag 'modules-for-v5.9' of git://git.kernel.org/pub/scm/linux/kernel/git/jeyu/linux · 0fd9cc6b
      Linus Torvalds authored
      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
    • Linus Torvalds's avatar
      Merge tag 'kconfig-v5.9' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild · 32b2ee5c
      Linus Torvalds authored
      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. Aug 14, 2020