Skip to content
  1. Jun 12, 2019
    • Prarit Bhargava's avatar
      x86/resctrl: Prevent NULL pointer dereference when local MBM is disabled · c7563e62
      Prarit Bhargava authored
      Booting with kernel parameter "rdt=cmt,mbmtotal,memlocal,l3cat,mba" and
      executing "mount -t resctrl resctrl -o mba_MBps /sys/fs/resctrl" results in
      a NULL pointer dereference on systems which do not have local MBM support
      enabled..
      
      BUG: kernel NULL pointer dereference, address: 0000000000000020
      PGD 0 P4D 0
      Oops: 0000 [#1] SMP PTI
      CPU: 0 PID: 722 Comm: kworker/0:3 Not tainted 5.2.0-0.rc3.git0.1.el7_UNSUPPORTED.x86_64 #2
      Workqueue: events mbm_handle_overflow
      RIP: 0010:mbm_handle_overflow+0x150/0x2b0
      
      Only enter the bandwith update loop if the system has local MBM enabled.
      
      Fixes: de73f38f
      
       ("x86/intel_rdt/mba_sc: Feedback loop to dynamically update mem bandwidth")
      Signed-off-by: default avatarPrarit Bhargava <prarit@redhat.com>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: Fenghua Yu <fenghua.yu@intel.com>
      Cc: Reinette Chatre <reinette.chatre@intel.com>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: stable@vger.kernel.org
      Link: https://lkml.kernel.org/r/20190610171544.13474-1-prarit@redhat.com
      c7563e62
    • James Morse's avatar
      x86/resctrl: Don't stop walking closids when a locksetup group is found · 87d3aa28
      James Morse authored
      When a new control group is created __init_one_rdt_domain() walks all
      the other closids to calculate the sets of used and unused bits.
      
      If it discovers a pseudo_locksetup group, it breaks out of the loop.  This
      means any later closid doesn't get its used bits added to used_b.  These
      bits will then get set in unused_b, and added to the new control group's
      configuration, even if they were marked as exclusive for a later closid.
      
      When encountering a pseudo_locksetup group, we should continue. This is
      because "a resource group enters 'pseudo-locked' mode after the schemata is
      written while the resource group is in 'pseudo-locksetup' mode." When we
      find a pseudo_locksetup group, its configuration is expected to be
      overwritten, we can skip it.
      
      Fixes: dfe9674b
      
       ("x86/intel_rdt: Enable entering of pseudo-locksetup mode")
      Signed-off-by: default avatarJames Morse <james.morse@arm.com>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Acked-by: default avatarReinette Chatre <reinette.chatre@intel.com>
      Cc: Fenghua Yu <fenghua.yu@intel.com>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: H Peter Avin <hpa@zytor.com>
      Cc: <stable@vger.kernel.org>
      Link: https://lkml.kernel.org/r/20190603172531.178830-1-james.morse@arm.com
      87d3aa28
  2. Jun 08, 2019
    • Sebastian Andrzej Siewior's avatar
      x86/fpu: Update kernel's FPU state before using for the fsave header · aab8445c
      Sebastian Andrzej Siewior authored
      In commit
      
        39388e80 ("x86/fpu: Don't save fxregs for ia32 frames in copy_fpstate_to_sigframe()")
      
      I removed the statement
      
      |       if (ia32_fxstate)
      |               copy_fxregs_to_kernel(fpu);
      
      and argued that it was wrongly merged because the content was already
      saved in kernel's state.
      
      This was wrong: It is required to write it back because it is only
      saved on the user-stack and save_fsave_header() reads it from task's
      FPU-state. I missed that part…
      
      Save x87 FPU state unless thread's FPU registers are already up to date.
      
      Fixes: 39388e80
      
       ("x86/fpu: Don't save fxregs for ia32 frames in copy_fpstate_to_sigframe()")
      Reported-by: default avatarEric Biggers <ebiggers@kernel.org>
      Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
      Tested-by: default avatarEric Biggers <ebiggers@kernel.org>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Dave Hansen <dave.hansen@intel.com>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Hugh Dickins <hughd@google.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jann Horn <jannh@google.com>
      Cc: "Jason A. Donenfeld" <Jason@zx2c4.com>
      Cc: kvm ML <kvm@vger.kernel.org>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Radim Krčmář <rkrcmar@redhat.com>
      Cc: Rik van Riel <riel@surriel.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: x86-ml <x86@kernel.org>
      Link: https://lkml.kernel.org/r/20190607142915.y52mfmgk5lvhll7n@linutronix.de
      aab8445c
    • Baoquan He's avatar
      x86/mm/KASLR: Compute the size of the vmemmap section properly · 00e5a2bb
      Baoquan He authored
      The size of the vmemmap section is hardcoded to 1 TB to support the
      maximum amount of system RAM in 4-level paging mode - 64 TB.
      
      However, 1 TB is not enough for vmemmap in 5-level paging mode. Assuming
      the size of struct page is 64 Bytes, to support 4 PB system RAM in 5-level,
      64 TB of vmemmap area is needed:
      
        4 * 1000^5 PB / 4096 bytes page size * 64 bytes per page struct / 1000^4 TB = 62.5 TB.
      
      This hardcoding may cause vmemmap to corrupt the following
      cpu_entry_area section, if KASLR puts vmemmap very close to it and the
      actual vmemmap size is bigger than 1 TB.
      
      So calculate the actual size of the vmemmap region needed and then align
      it up to 1 TB boundary.
      
      In 4-level paging mode it is always 1 TB. In 5-level it's adjusted on
      demand. The current code reserves 0.5 PB for vmemmap on 5-level. With
      this change, the space can be saved and thus used to increase entropy
      for the randomization.
      
       [ bp: Spell out how the 64 TB needed for vmemmap is computed and massage commit
         message. ]
      
      Fixes: eedb92ab
      
       ("x86/mm: Make virtual memory layout dynamic for CONFIG_X86_5LEVEL=y")
      Signed-off-by: default avatarBaoquan He <bhe@redhat.com>
      Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
      Reviewed-by: default avatarKees Cook <keescook@chromium.org>
      Acked-by: default avatarKirill A. Shutemov <kirill@linux.intel.com>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: kirill.shutemov@linux.intel.com
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: stable <stable@vger.kernel.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: x86-ml <x86@kernel.org>
      Link: https://lkml.kernel.org/r/20190523025744.3756-1-bhe@redhat.com
      00e5a2bb
  3. Jun 07, 2019
    • Hugh Dickins's avatar
      x86/fpu: Use fault_in_pages_writeable() for pre-faulting · b81ff101
      Hugh Dickins authored
      Since commit
      
         d9c9ce34 ("x86/fpu: Fault-in user stack if copy_fpstate_to_sigframe() fails")
      
      get_user_pages_unlocked() pre-faults user's memory if a write generates
      a page fault while the handler is disabled.
      
      This works in general and uncovered a bug as reported by Mike
      Rapoport¹. It has been pointed out that this function may be fragile
      and a simple pre-fault as in fault_in_pages_writeable() would be a
      better solution. Better as in taste and simplicity: that write (as
      performed by the alternative function) performs exactly the same
      faulting of memory as before. This was suggested by Hugh Dickins and
      Andrew Morton.
      
      Use fault_in_pages_writeable() for pre-faulting user's stack.
      
        [ bigeasy: Write commit message. ]
        [ bp: Massage some. ]
      
      ¹ https://lkml.kernel.org/r/1557844195-18882-1-git-send-email-rppt@linux.ibm.com
      
      Fixes: d9c9ce34
      
       ("x86/fpu: Fault-in user stack if copy_fpstate_to_sigframe() fails")
      Suggested-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarHugh Dickins <hughd@google.com>
      Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
      Tested-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Cc: Andrea Arcangeli <aarcange@redhat.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jann Horn <jannh@google.com>
      Cc: linux-mm <linux-mm@kvack.org>
      Cc: Mike Rapoport <rppt@linux.ibm.com>
      Cc: Pavel Machek <pavel@ucw.cz>
      Cc: Rik van Riel <riel@surriel.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: x86-ml <x86@kernel.org>
      Link: https://lkml.kernel.org/r/20190529072540.g46j4kfeae37a3iu@linutronix.de
      Link: https://lkml.kernel.org/r/1557844195-18882-1-git-send-email-rppt@linux.ibm.com
      b81ff101
  4. Jun 06, 2019
    • Kan Liang's avatar
      x86/CPU: Add more Icelake model numbers · e35faeb6
      Kan Liang authored
      
      
      Add the CPUID model numbers of Icelake (ICL) desktop and server
      processors to the Intel family list.
      
       [ Qiuxu: Sort the macros by model number. ]
      
      Signed-off-by: default avatarKan Liang <kan.liang@linux.intel.com>
      Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Qiuxu Zhuo <qiuxu.zhuo@intel.com>
      Cc: Rajneesh Bhardwaj <rajneesh.bhardwaj@linux.intel.com>
      Cc: rui.zhang@intel.com
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: x86-ml <x86@kernel.org>
      Link: https://lkml.kernel.org/r/20190603134122.13853-1-kan.liang@linux.intel.com
      e35faeb6
  5. Jun 03, 2019
    • Rick Edgecombe's avatar
      mm/vmalloc: Avoid rare case of flushing TLB with weird arguments · 31e67340
      Rick Edgecombe authored
      
      
      In a rare case, flush_tlb_kernel_range() could be called with a start
      higher than the end.
      
      In vm_remove_mappings(), in case page_address() returns 0 for all pages
      (for example they were all in highmem), _vm_unmap_aliases() will be
      called with start = ULONG_MAX, end = 0 and flush = 1.
      
      If at the same time, the vmalloc purge operation is triggered by something
      else while the current operation is between remove_vm_area() and
      _vm_unmap_aliases(), then the vm mapping just removed will be already
      purged. In this case the call of vm_unmap_aliases() may not find any other
      mappings to flush and so end up flushing start = ULONG_MAX, end = 0. So
      only set flush = true if we find something in the direct mapping that we
      need to flush, and this way this can't happen.
      
      Signed-off-by: default avatarRick Edgecombe <rick.p.edgecombe@intel.com>
      Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Dave Hansen <dave.hansen@intel.com>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Meelis Roos <mroos@linux.ee>
      Cc: Nadav Amit <namit@vmware.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Fixes: 868b104d
      
       ("mm/vmalloc: Add flag for freeing of special permsissions")
      Link: https://lkml.kernel.org/r/20190527211058.2729-3-rick.p.edgecombe@intel.com
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      31e67340
    • Rick Edgecombe's avatar
      mm/vmalloc: Fix calculation of direct map addr range · 8e41f872
      Rick Edgecombe authored
      
      
      The calculation of the direct map address range to flush was wrong.
      This could cause the RO direct map alias to not get flushed. Today
      this shouldn't be a problem because this flush is only needed on x86
      right now and the spurious fault handler will fix cached RO->RW
      translations. In the future though, it could cause the permissions
      to remain RO in the TLB for the direct map alias, and then the page
      would return from the page allocator to some other component as RO
      and cause a crash.
      
      So fix fix the address range calculation so the flush will include the
      direct map range.
      
      Signed-off-by: default avatarRick Edgecombe <rick.p.edgecombe@intel.com>
      Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Dave Hansen <dave.hansen@intel.com>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Meelis Roos <mroos@linux.ee>
      Cc: Nadav Amit <namit@vmware.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Fixes: 868b104d
      
       ("mm/vmalloc: Add flag for freeing of special permsissions")
      Link: https://lkml.kernel.org/r/20190527211058.2729-2-rick.p.edgecombe@intel.com
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      8e41f872
    • Linus Torvalds's avatar
      Linux 5.2-rc3 · f2c7c76c
      Linus Torvalds authored
      f2c7c76c
    • Linus Torvalds's avatar
      Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 7bd1d5ed
      Linus Torvalds authored
      Pull x86 fixes from Ingo Molnar:
       "Two fixes: a quirk for KVM guests running on certain AMD CPUs, and a
        KASAN related build fix"
      
      * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/CPU/AMD: Don't force the CPB cap when running under a hypervisor
        x86/boot: Provide KASAN compatible aliases for string routines
      7bd1d5ed
    • Linus Torvalds's avatar
      Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 6751b8d9
      Linus Torvalds authored
      Pull perf fixes from Ingo Molnar:
       "On the kernel side there's a bunch of ring-buffer ordering fixes for a
        reproducible bug, plus a PEBS constraints regression fix.
      
        Plus tooling fixes"
      
      * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        tools headers UAPI: Sync kvm.h headers with the kernel sources
        perf record: Fix s390 missing module symbol and warning for non-root users
        perf machine: Read also the end of the kernel
        perf test vmlinux-kallsyms: Ignore aliases to _etext when searching on kallsyms
        perf session: Add missing swap ops for namespace events
        perf namespace: Protect reading thread's namespace
        tools headers UAPI: Sync drm/drm.h with the kernel
        tools headers UAPI: Sync drm/i915_drm.h with the kernel
        tools headers UAPI: Sync linux/fs.h with the kernel
        tools headers UAPI: Sync linux/sched.h with the kernel
        tools arch x86: Sync asm/cpufeatures.h with the with the kernel
        tools include UAPI: Update copy of files related to new fspick, fsmount, fsconfig, fsopen, move_mount and open_tree syscalls
        perf arm64: Fix mksyscalltbl when system kernel headers are ahead of the kernel
        perf data: Fix 'strncat may truncate' build failure with recent gcc
        perf/ring-buffer: Use regular variables for nesting
        perf/ring-buffer: Always use {READ,WRITE}_ONCE() for rb->user_page data
        perf/ring_buffer: Add ordering to rb->nest increment
        perf/ring_buffer: Fix exposing a temporarily decreased data_head
        perf/x86/intel/ds: Fix EVENT vs. UEVENT PEBS constraints
      6751b8d9
    • Linus Torvalds's avatar
      Merge branch 'efi-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · af042452
      Linus Torvalds authored
      Pull EFI fixes from Ingo Molnar:
       "Two EFI fixes: a quirk for weird systabs, plus add more robust error
        handling in the old 1:1 mapping code"
      
      * 'efi-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        efi: Allow the number of EFI configuration tables entries to be zero
        efi/x86/Add missing error handling to old_memmap 1:1 mapping code
      af042452
    • Linus Torvalds's avatar
      Merge branch 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 4fb5741c
      Linus Torvalds authored
      Pull stacktrace fix from Ingo Molnar:
       "Fix a stack_trace_save_tsk_reliable() regression"
      
      * 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        stacktrace: Unbreak stack_trace_save_tsk_reliable()
      4fb5741c
    • Linus Torvalds's avatar
      Merge tag 'spdx-5.2-rc3-2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core · a68dc618
      Linus Torvalds authored
      Pull SPDX fixes from Greg KH:
       "Here are just two small patches, that fix up some found SPDX
        identifier issues.
      
        The first patch fixes an error in a previous SPDX fixup patch, that
        causes build errors when doing 'make clean' on the tree (the fact that
        almost no one noticed it reflects the fact that kernel developers
        don't like doing that option very often...)
      
        The second patch fixes up a number of places in the tree where people
        mistyped the string "SPDX-License-Identifier". Given that people can
        not even type their own name all the time without mistakes, this was
        bound to happen, and odds are, we will have to add some type of check
        for this to checkpatch.pl to catch this happening in the future.
      
        Both of these have passed testing by 0-day"
      
      * tag 'spdx-5.2-rc3-2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core:
        treewide: fix typos of SPDX-License-Identifier
        crypto: ux500 - fix license comment syntax error
      a68dc618
    • Linus Torvalds's avatar
      Merge tag 'powerpc-5.2-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux · 460b48a0
      Linus Torvalds authored
      Pull powerpc fixes from Michael Ellerman:
       "A minor fix to our IMC PMU code to print a less confusing error
        message when the driver can't initialise properly.
      
        A fix for a bug where a user requesting an unsupported branch sampling
        filter can corrupt PMU state, preventing the PMU from counting
        properly.
      
        And finally a fix for a bug in our support for kexec_file_load(),
        which prevented loading a kernel and initramfs. Most versions of kexec
        don't yet use kexec_file_load().
      
        Thanks to: Anju T Sudhakar, Dave Young, Madhavan Srinivasan, Ravi
        Bangoria, Thiago Jung Bauermann"
      
      * tag 'powerpc-5.2-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
        powerpc/kexec: Fix loading of kernel + initramfs with kexec_file_load()
        powerpc/perf: Fix MMCRA corruption by bhrb_filter
        powerpc/powernv: Return for invalid IMC domain
      460b48a0
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm · b44a1dd3
      Linus Torvalds authored
      Pull KVM fixes from Paolo Bonzini:
       "Fixes for PPC and s390"
      
      * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
        KVM: PPC: Book3S HV: Restore SPRG3 in kvmhv_p9_guest_entry()
        KVM: PPC: Book3S HV: Fix lockdep warning when entering guest on POWER9
        KVM: PPC: Book3S HV: XIVE: Fix page offset when clearing ESB pages
        KVM: PPC: Book3S HV: XIVE: Take the srcu read lock when accessing memslots
        KVM: PPC: Book3S HV: XIVE: Do not clear IRQ data of passthrough interrupts
        KVM: PPC: Book3S HV: XIVE: Introduce a new mutex for the XIVE device
        KVM: PPC: Book3S HV: XIVE: Fix the enforced limit on the vCPU identifier
        KVM: PPC: Book3S HV: XIVE: Do not test the EQ flag validity when resetting
        KVM: PPC: Book3S HV: XIVE: Clear file mapping when device is released
        KVM: PPC: Book3S HV: Don't take kvm->lock around kvm_for_each_vcpu
        KVM: PPC: Book3S: Use new mutex to synchronize access to rtas token list
        KVM: PPC: Book3S HV: Use new mutex to synchronize MMU setup
        KVM: PPC: Book3S HV: Avoid touching arch.mmu_ready in XIVE release functions
        KVM: s390: Do not report unusabled IDs via KVM_CAP_MAX_VCPU_ID
        kvm: fix compile on s390 part 2
      b44a1dd3
    • Linus Torvalds's avatar
      Merge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux · 38baf0bb
      Linus Torvalds authored
      Pull i2c fixes from Wolfram Sang:
       "A memleak fix for the core, two driver bugfixes, as well as fixing
        missing file patterns to MAINTAINERS"
      
      * 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
        MAINTAINERS: add I2C DT bindings to ARM platforms
        MAINTAINERS: add DT bindings to i2c drivers
        i2c: synquacer: fix synquacer_i2c_doxfer() return value
        i2c: mlxcpld: Fix wrong initialization order in probe
        i2c: dev: fix potential memory leak in i2cdev_ioctl_rdwr
      38baf0bb
    • Linus Torvalds's avatar
      Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/evalenti/linux-soc-thermal · 378e853f
      Linus Torvalds authored
      Pull thermal SoC fix from Eduardo Valentin:
       "A single revert, detected to cause issues on the tsens driver"
      
      * 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/evalenti/linux-soc-thermal:
        Revert "drivers: thermal: tsens: Add new operation to check if a sensor is enabled"
      378e853f
    • Linus Torvalds's avatar
      Merge tag 'led-fixes-for-5.2-rc3' of... · f58c356e
      Linus Torvalds authored
      Merge tag 'led-fixes-for-5.2-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/j.anaszewski/linux-leds
      
      Pull LED fix from Jacek Anaszewski:
       "Fix for a recent change in LED core, that didn't take into account the
        possibility of calling led_blink_setup() from atomic context"
      
      * tag 'led-fixes-for-5.2-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/j.anaszewski/linux-leds:
        leds: avoid flush_work in atomic context
      f58c356e
    • Linus Torvalds's avatar
      Merge tag 'for-linus-20190601' of git://git.kernel.dk/linux-block · 9221dced
      Linus Torvalds authored
      Pull block fixes from Jens Axboe:
      
       - A set of patches fixing code comments / kerneldoc (Bart)
      
       - Don't allow loop file change for exclusive open (Jan)
      
       - Fix revalidate of hidden genhd (Jan)
      
       - Init queue failure memory free fix (Jes)
      
       - Improve rq limits failure print (John)
      
       - Fixup for queue removal/addition (Ming)
      
       - Missed error progagation for io_uring buffer registration (Pavel)
      
      * tag 'for-linus-20190601' of git://git.kernel.dk/linux-block:
        block: print offending values when cloned rq limits are exceeded
        blk-mq: Document the blk_mq_hw_queue_to_node() arguments
        blk-mq: Fix spelling in a source code comment
        block: Fix bsg_setup_queue() kernel-doc header
        block: Fix rq_qos_wait() kernel-doc header
        block: Fix blk_mq_*_map_queues() kernel-doc headers
        block: Fix throtl_pending_timer_fn() kernel-doc header
        block: Convert blk_invalidate_devt() header into a non-kernel-doc header
        block/partitions/ldm: Convert a kernel-doc header into a non-kernel-doc header
        blk-mq: Fix memory leak in error handling
        block: don't protect generic_make_request_checks with blk_queue_enter
        block: move blk_exit_queue into __blk_release_queue
        block: Don't revalidate bdev of hidden gendisk
        loop: Don't change loop device under exclusive opener
        io_uring: Fix __io_uring_register() false success
      9221dced
    • Linus Torvalds's avatar
      Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi · 1975b337
      Linus Torvalds authored
      Pull SCSI fixes from James Bottomley:
       "Six minor fixes to device drivers and one to the multipath alua
        handler.
      
        The most extensive fix is the zfcp port remove prevention one, but
        it's impact is only s390"
      
      * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
        scsi: libsas: delete sas port if expander discover failed
        scsi: libsas: only clear phy->in_shutdown after shutdown event done
        scsi: scsi_dh_alua: Fix possible null-ptr-deref
        scsi: smartpqi: properly set both the DMA mask and the coherent DMA mask
        scsi: zfcp: fix to prevent port_remove with pure auto scan LUNs (only sdevs)
        scsi: zfcp: fix missing zfcp_port reference put on -EBUSY from port_remove
        scsi: libcxgbi: add a check for NULL pointer in cxgbi_check_route()
      1975b337
  6. Jun 02, 2019
    • Linus Torvalds's avatar
      Merge branch 'akpm' (patches from Andrew) · 7b3064f0
      Linus Torvalds authored
      Merge misc fixes from Andrew Morton:
       "Various fixes and followups"
      
      * emailed patches from Andrew Morton <akpm@linux-foundation.org>:
        mm, compaction: make sure we isolate a valid PFN
        include/linux/generic-radix-tree.h: fix kerneldoc comment
        kernel/signal.c: trace_signal_deliver when signal_group_exit
        drivers/iommu/intel-iommu.c: fix variable 'iommu' set but not used
        spdxcheck.py: fix directory structures
        kasan: initialize tag to 0xff in __kasan_kmalloc
        z3fold: fix sheduling while atomic
        scripts/gdb: fix invocation when CONFIG_COMMON_CLK is not set
        mm/gup: continue VM_FAULT_RETRY processing even for pre-faults
        ocfs2: fix error path kobject memory leak
        memcg: make it work on sparse non-0-node systems
        mm, memcg: consider subtrees in memory.events
        prctl_set_mm: downgrade mmap_sem to read lock
        prctl_set_mm: refactor checks from validate_prctl_map
        kernel/fork.c: make max_threads symbol static
        arch/arm/boot/compressed/decompress.c: fix build error due to lz4 changes
        arch/parisc/configs/c8000_defconfig: remove obsoleted CONFIG_DEBUG_SLAB_LEAK
        mm/vmalloc.c: fix typo in comment
        lib/sort.c: fix kernel-doc notation warnings
        mm: fix Documentation/vm/hmm.rst Sphinx warnings
      7b3064f0
    • Suzuki K Poulose's avatar
      mm, compaction: make sure we isolate a valid PFN · e577c8b6
      Suzuki K Poulose authored
      When we have holes in a normal memory zone, we could endup having
      cached_migrate_pfns which may not necessarily be valid, under heavy memory
      pressure with swapping enabled ( via __reset_isolation_suitable(),
      triggered by kswapd).
      
      Later if we fail to find a page via fast_isolate_freepages(), we may end
      up using the migrate_pfn we started the search with, as valid page.  This
      could lead to accessing NULL pointer derefernces like below, due to an
      invalid mem_section pointer.
      
      Unable to handle kernel NULL pointer dereference at virtual address 0000000000000008 [47/1825]
       Mem abort info:
         ESR = 0x96000004
         Exception class = DABT (current EL), IL = 32 bits
         SET = 0, FnV = 0
         EA = 0, S1PTW = 0
       Data abort info:
         ISV = 0, ISS = 0x00000004
         CM = 0, WnR = 0
       user pgtable: 4k pages, 48-bit VAs, pgdp = 0000000082f94ae9
       [0000000000000008] pgd=0000000000000000
       Internal error: Oops: 96000004 [#1] SMP
       ...
       CPU: 10 PID: 6080 Comm: qemu-system-aar Not tainted...
      e577c8b6
    • Jonathan Corbet's avatar
      include/linux/generic-radix-tree.h: fix kerneldoc comment · 590ba22b
      Jonathan Corbet authored
      
      
      The DOC comment block section in include/linux/generic-radix-tree.h
      contained a spurious colon, causing this warning in the documentation
      build:
      
        include/linux/generic-radix-tree.h:1: warning: no structured comments found
      
      Remove the colon and make the docs build happy.
      
      Link: http://lkml.kernel.org/r/20190524141933.74ae9050@lwn.net
      Signed-off-by: default avatarJonathan Corbet <corbet@lwn.net>
      Reviewed-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Cc: Kent Overstreet <kent.overstreet@gmail.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      590ba22b
    • Zhenliang Wei's avatar
      kernel/signal.c: trace_signal_deliver when signal_group_exit · 98af37d6
      Zhenliang Wei authored
      In the fixes commit, removing SIGKILL from each thread signal mask and
      executing "goto fatal" directly will skip the call to
      "trace_signal_deliver".  At this point, the delivery tracking of the
      SIGKILL signal will be inaccurate.
      
      Therefore, we need to add trace_signal_deliver before "goto fatal" after
      executing sigdelset.
      
      Note: SEND_SIG_NOINFO matches the fact that SIGKILL doesn't have any info.
      
      Link: http://lkml.kernel.org/r/20190425025812.91424-1-weizhenliang@huawei.com
      Fixes: cf43a757
      
       ("signal: Restore the stop PTRACE_EVENT_EXIT")
      Signed-off-by: default avatarZhenliang Wei <weizhenliang@huawei.com>
      Reviewed-by: default avatarChristian Brauner <christian@brauner.io>
      Reviewed-by: default avatarOleg Nesterov <oleg@redhat.com>
      Cc: Eric W. Biederman <ebiederm@xmission.com>
      Cc: Ivan Delalande <colona@arista.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Deepa Dinamani <deepa.kernel@gmail.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      98af37d6
    • Qian Cai's avatar
      drivers/iommu/intel-iommu.c: fix variable 'iommu' set but not used · d3ed71e5
      Qian Cai authored
      Commit cf04eee8
      
       ("iommu/vt-d: Include ACPI devices in iommu=pt")
      added for_each_active_iommu() in iommu_prepare_static_identity_mapping()
      but never used the each element, i.e, "drhd->iommu".
      
      drivers/iommu/intel-iommu.c: In function
      'iommu_prepare_static_identity_mapping':
      drivers/iommu/intel-iommu.c:3037:22: warning: variable 'iommu' set but
      not used [-Wunused-but-set-variable]
       struct intel_iommu *iommu;
      
      Fixed the warning by appending a compiler attribute __maybe_unused for it.
      
      Link: http://lkml.kernel.org/r/20190523013314.2732-1-cai@lca.pw
      Signed-off-by: default avatarQian Cai <cai@lca.pw>
      Suggested-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Cc: Joerg Roedel <jroedel@suse.de>
      Cc: David Woodhouse <dwmw2@infradead.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      d3ed71e5
    • Vincenzo Frascino's avatar
      spdxcheck.py: fix directory structures · 8d7a7abf
      Vincenzo Frascino authored
      The LICENSE directory has recently changed structure and this makes
      spdxcheck fails as per below:
      
      FAIL: "Blob or Tree named 'other' not found"
      Traceback (most recent call last):
        File "scripts/spdxcheck.py", line 240, in <module>
      spdx = read_spdxdata(repo)
        File "scripts/spdxcheck.py", line 41, in read_spdxdata
      for el in lictree[d].traverse():
      [...]
      KeyError: "Blob or Tree named 'other' not found"
      
      Fix the script to restore the correctness on checkpatch License checking.
      
      References: 62be257e ("LICENSES: Rename other to deprecated")
      References: 8ea8814f
      
       ("LICENSES: Clearly mark dual license only licenses")
      Link: http://lkml.kernel.org/r/20190523084755.56739-1-vincenzo.frascino@arm.com
      Signed-off-by: default avatarVincenzo Frascino <vincenzo.frascino@arm.com>
      Cc: Joe Perches <joe@perches.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Jeremy Cline <jcline@redhat.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-...
      8d7a7abf
    • Nathan Chancellor's avatar
      kasan: initialize tag to 0xff in __kasan_kmalloc · 0600597c
      Nathan Chancellor authored
      When building with -Wuninitialized and CONFIG_KASAN_SW_TAGS unset, Clang
      warns:
      
      mm/kasan/common.c:484:40: warning: variable 'tag' is uninitialized when
      used here [-Wuninitialized]
              kasan_unpoison_shadow(set_tag(object, tag), size);
                                                    ^~~
      
      set_tag ignores tag in this configuration but clang doesn't realize it at
      this point in its pipeline, as it points to arch_kasan_set_tag as being
      the point where it is used, which will later be expanded to (void
      *)(object) without a use of tag.  Initialize tag to 0xff, as it removes
      this warning and doesn't change the meaning of the code.
      
      Link: https://github.com/ClangBuiltLinux/linux/issues/465
      Link: http://lkml.kernel.org/r/20190502163057.6603-1-natechancellor@gmail.com
      Fixes: 7f94ffbc
      
       ("kasan: add hooks implementation for tag-based mode")
      Signed-off-by: default avatarNathan Chancellor <natechancellor@gmail.com>
      Reviewed-by: default avatarAndrey Konovalov <andreyknvl@google.com>
      Reviewed-by: default avatarAndrey Ryabinin <aryabinin@virtuozzo.com>
      Cc: Alexander Potapenko <glider@google.com>
      Cc: Dmitry Vyukov <dvyukov@google.com>
      Cc: Nick Desaulniers <ndesaulniers@google.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      0600597c
    • Vitaly Wool's avatar
      z3fold: fix sheduling while atomic · bb9f6f63
      Vitaly Wool authored
      kmem_cache_alloc() may be called from z3fold_alloc() in atomic context, so
      we need to pass correct gfp flags to avoid "scheduling while atomic" bug.
      
      Link: http://lkml.kernel.org/r/20190523153245.119dfeed55927e8755250ddd@gmail.com
      Fixes: 7c2b8baa
      
       ("mm/z3fold.c: add structure for buddy handles")
      Signed-off-by: default avatarVitaly Wool <vitaly.vul@sony.com>
      Reviewed-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      bb9f6f63
    • Fabiano Rosas's avatar
      scripts/gdb: fix invocation when CONFIG_COMMON_CLK is not set · ef7a77c6
      Fabiano Rosas authored
      CLK_GET_RATE_NOCACHE depends on CONFIG_COMMON_CLK.  Importing constants.py
      when CONFIG_COMMON_CLK is not defined causes:
      
        (gdb) lx-symbols
        (...)
          File "scripts/gdb/linux/proc.py", line 15, in <module>
            from linux import constants
          File "scripts/gdb/linux/constants.py", line 2, in <module>
            LX_CLK_GET_RATE_NOCACHE = gdb.parse_and_eval("CLK_GET_RATE_NOCACHE")
        gdb.error: No symbol "CLK_GET_RATE_NOCACHE" in current context.
      
      Link: http://lkml.kernel.org/r/20190523195313.24701-1-farosas@linux.ibm.com
      Fixes: e7e6f462
      
       ("scripts/gdb: print cached rate in lx-clk-summary")
      Signed-off-by: default avatarFabiano Rosas <farosas@linux.ibm.com>
      Reviewed-by: default avatarStephen Boyd <swboyd@chromium.org>
      Cc: Jan Kiszka <jan.kiszka@siemens.com>
      Cc: Kieran Bingham <kbingham@kernel.org>
      Cc: Leonard Crestez <leonard.crestez@nxp.com>
      Cc: Jackie Liu <liuyun01@kylinos.cn>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      ef7a77c6
    • Mike Rapoport's avatar
      mm/gup: continue VM_FAULT_RETRY processing even for pre-faults · df17277b
      Mike Rapoport authored
      When get_user_pages*() is called with pages = NULL, the processing of
      VM_FAULT_RETRY terminates early without actually retrying to fault-in all
      the pages.
      
      If the pages in the requested range belong to a VMA that has userfaultfd
      registered, handle_userfault() returns VM_FAULT_RETRY *after* user space
      has populated the page, but for the gup pre-fault case there's no actual
      retry and the caller will get no pages although they are present.
      
      This issue was uncovered when running post-copy memory restore in CRIU
      after d9c9ce34 ("x86/fpu: Fault-in user stack if
      copy_fpstate_to_sigframe() fails").
      
      After this change, the copying of FPU state to the sigframe switched from
      copy_to_user() variants which caused a real page fault to get_user_pages()
      with pages parameter set to NULL.
      
      In post-copy mode of CRIU, the destination memory is managed with
      userfaultfd and lack of the retry for pre-fault case in get_user_pages()
      causes a crash of the restored process.
      
      Making the pre-fault behavior of get_user_pages() the same as the "normal"
      one fixes the issue.
      
      Link: http://lkml.kernel.org/r/1557844195-18882-1-git-send-email-rppt@linux.ibm.com
      Fixes: d9c9ce34
      
       ("x86/fpu: Fault-in user stack if copy_fpstate_to_sigframe() fails")
      Signed-off-by: default avatarMike Rapoport <rppt@linux.ibm.com>
      Tested-by: Andrei Vagin <avagin@gmail.com> [https://travis-ci.org/avagin/linux/builds/533184940]
      Tested-by: default avatarHugh Dickins <hughd@google.com>
      Cc: Andrea Arcangeli <aarcange@redhat.com>
      Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: Pavel Machek <pavel@ucw.cz>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      df17277b
    • Tobin C. Harding's avatar
      ocfs2: fix error path kobject memory leak · b9fba67b
      Tobin C. Harding authored
      
      
      If a call to kobject_init_and_add() fails we should call kobject_put()
      otherwise we leak memory.
      
      Add call to kobject_put() in the error path of call to
      kobject_init_and_add().  Please note, this has the side effect that the
      release method is called if kobject_init_and_add() fails.
      
      Link: http://lkml.kernel.org/r/20190513033458.2824-1-tobin@kernel.org
      Signed-off-by: default avatarTobin C. Harding <tobin@kernel.org>
      Reviewed-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Reviewed-by: default avatarJoseph Qi <joseph.qi@linux.alibaba.com>
      Cc: Mark Fasheh <mark@fasheh.com>
      Cc: Joel Becker <jlbec@evilplan.org>
      Cc: Junxiao Bi <junxiao.bi@oracle.com>
      Cc: Changwei Ge <gechangwei@live.cn>
      Cc: Gang He <ghe@suse.com>
      Cc: Jun Piao <piaojun@huawei.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      b9fba67b
    • Jiri Slaby's avatar
      memcg: make it work on sparse non-0-node systems · 3e858996
      Jiri Slaby authored
      We have a single node system with node 0 disabled:
        Scanning NUMA topology in Northbridge 24
        Number of physical nodes 2
        Skipping disabled node 0
        Node 1 MemBase 0000000000000000 Limit 00000000fbff0000
        NODE_DATA(1) allocated [mem 0xfbfda000-0xfbfeffff]
      
      This causes crashes in memcg when system boots:
        BUG: unable to handle kernel NULL pointer dereference at 0000000000000008
        #PF error: [normal kernel read fault]
      ...
        RIP: 0010:list_lru_add+0x94/0x170
      ...
        Call Trace:
         d_lru_add+0x44/0x50
         dput.part.34+0xfc/0x110
         __fput+0x108/0x230
         task_work_run+0x9f/0xc0
         exit_to_usermode_loop+0xf5/0x100
      
      It is reproducible as far as 4.12.  I did not try older kernels.  You have
      to have a new enough systemd, e.g.  241 (the reason is unknown -- was not
      investigated).  Cannot be reproduced with systemd 234.
      
      The system crashes because the size of lru array is never updated in
      memcg_update_all_list_lrus and the reads are past the zero-sized array,
      causing dereferences of random memory.
      
      The root cause are list_lru_memcg_aware checks in the list_lru code.  The
      test in list_lru_memcg_aware is broken: it assumes node 0 is always
      present, but it is not true on some systems as can be seen above.
      
      So fix this by avoiding checks on node 0.  Remember the memcg-awareness by
      a bool flag in struct list_lru.
      
      Link: http://lkml.kernel.org/r/20190522091940.3615-1-jslaby@suse.cz
      Fixes: 60d3fd32
      
       ("list_lru: introduce per-memcg lists")
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      Acked-by: default avatarMichal Hocko <mhocko@suse.com>
      Suggested-by: default avatarVladimir Davydov <vdavydov.dev@gmail.com>
      Acked-by: default avatarVladimir Davydov <vdavydov.dev@gmail.com>
      Reviewed-by: default avatarShakeel Butt <shakeelb@google.com>
      Cc: Johannes Weiner <hannes@cmpxchg.org>
      Cc: Raghavendra K T <raghavendra.kt@linux.vnet.ibm.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      3e858996
    • Chris Down's avatar
      mm, memcg: consider subtrees in memory.events · 9852ae3f
      Chris Down authored
      
      
      memory.stat and other files already consider subtrees in their output, and
      we should too in order to not present an inconsistent interface.
      
      The current situation is fairly confusing, because people interacting with
      cgroups expect hierarchical behaviour in the vein of memory.stat,
      cgroup.events, and other files.  For example, this causes confusion when
      debugging reclaim events under low, as currently these always read "0" at
      non-leaf memcg nodes, which frequently causes people to misdiagnose breach
      behaviour.  The same confusion applies to other counters in this file when
      debugging issues.
      
      Aggregation is done at write time instead of at read-time since these
      counters aren't hot (unlike memory.stat which is per-page, so it does it
      at read time), and it makes sense to bundle this with the file
      notifications.
      
      After this patch, events are propagated up the hierarchy:
      
          [root@ktst ~]# cat /sys/fs/cgroup/system.slice/memory.events
          low 0
          high 0
          max 0
          oom 0
          oom_kill 0
          [root@ktst ~]# systemd-run -p MemoryMax=1 true
          Running as unit: run-r251162a189fb4562b9dabfdc9b0422f5.service
          [root@ktst ~]# cat /sys/fs/cgroup/system.slice/memory.events
          low 0
          high 0
          max 7
          oom 1
          oom_kill 1
      
      As this is a change in behaviour, this can be reverted to the old
      behaviour by mounting with the `memory_localevents' flag set.  However, we
      use the new behaviour by default as there's a lack of evidence that there
      are any current users of memory.events that would find this change
      undesirable.
      
      akpm: this is a behaviour change, so Cc:stable.  THis is so that
      forthcoming distros which use cgroup v2 are more likely to pick up the
      revised behaviour.
      
      Link: http://lkml.kernel.org/r/20190208224419.GA24772@chrisdown.name
      Signed-off-by: default avatarChris Down <chris@chrisdown.name>
      Acked-by: default avatarJohannes Weiner <hannes@cmpxchg.org>
      Reviewed-by: default avatarShakeel Butt <shakeelb@google.com>
      Cc: Michal Hocko <mhocko@kernel.org>
      Cc: Tejun Heo <tj@kernel.org>
      Cc: Roman Gushchin <guro@fb.com>
      Cc: Dennis Zhou <dennis@kernel.org>
      Cc: Suren Baghdasaryan <surenb@google.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      9852ae3f
    • Michal Koutný's avatar
      prctl_set_mm: downgrade mmap_sem to read lock · bc81426f
      Michal Koutný authored
      The commit a3b609ef ("proc read mm's {arg,env}_{start,end} with mmap
      semaphore taken.") added synchronization of reading argument/environment
      boundaries under mmap_sem.  Later commit 88aa7cc6 ("mm: introduce
      arg_lock to protect arg_start|end and env_start|end in mm_struct") avoided
      the coarse use of mmap_sem in similar situations.  But there still
      remained two places that (mis)use mmap_sem.
      
      get_cmdline should also use arg_lock instead of mmap_sem when it reads the
      boundaries.
      
      The second place that should use arg_lock is in prctl_set_mm.  By
      protecting the boundaries fields with the arg_lock, we can downgrade
      mmap_sem to reader lock (analogous to what we already do in
      prctl_set_mm_map).
      
      [akpm@linux-foundation.org: coding style fixes]
      Link: http://lkml.kernel.org/r/20190502125203.24014-3-mkoutny@suse.com
      Fixes: 88aa7cc6
      
       ("mm: introduce arg_lock to protect arg_start|end and env_start|end in mm_struct")
      Signed-off-by: default avatarMichal Koutný <mkoutny@suse.com>
      Signed-off-by: default avatarLaurent Dufour <ldufour@linux.ibm.com>
      Co-developed-by: default avatarLaurent Dufour <ldufour@linux.ibm.com>
      Reviewed-by: default avatarCyrill Gorcunov <gorcunov@gmail.com>
      Acked-by: default avatarMichal Hocko <mhocko@suse.com>
      Cc: Yang Shi <yang.shi@linux.alibaba.com>
      Cc: Mateusz Guzik <mguzik@redhat.com>
      Cc: Kirill Tkhai <ktkhai@virtuozzo.com>
      Cc: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      bc81426f
    • Michal Koutný's avatar
      prctl_set_mm: refactor checks from validate_prctl_map · 11bbd8b4
      Michal Koutný authored
      Despite comment of validate_prctl_map claims there are no capability
      checks, it is not completely true since commit 4d28df61
      
       ("prctl: Allow
      local CAP_SYS_ADMIN changing exe_file").  Extract the check out of the
      function and make the function perform purely arithmetic checks.
      
      This patch should not change any behavior, it is mere refactoring for
      following patch.
      
      [akpm@linux-foundation.org: coding style fixes]
      Link: http://lkml.kernel.org/r/20190502125203.24014-2-mkoutny@suse.com
      Signed-off-by: default avatarMichal Koutný <mkoutny@suse.com>
      Reviewed-by: default avatarKirill Tkhai <ktkhai@virtuozzo.com>
      Reviewed-by: default avatarCyrill Gorcunov <gorcunov@gmail.com>
      Cc: Kirill Tkhai <ktkhai@virtuozzo.com>
      Cc: Laurent Dufour <ldufour@linux.ibm.com>
      Cc: Mateusz Guzik <mguzik@redhat.com>
      Cc: Michal Hocko <mhocko@suse.com>
      Cc: Yang Shi <yang.shi@linux.alibaba.com>
      Cc: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      11bbd8b4
    • Kefeng Wang's avatar
      kernel/fork.c: make max_threads symbol static · 8856ae4d
      Kefeng Wang authored
      
      
      Fix build warning,
      kernel/fork.c:125:5: warning: symbol 'max_threads' was not declared. Should it be static?
      
      Link: http://lkml.kernel.org/r/20190516015118.140561-1-wangkefeng.wang@huawei.com
      Signed-off-by: default avatarKefeng Wang <wangkefeng.wang@huawei.com>
      Reported-by: default avatarHulk Robot <hulkci@huawei.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      8856ae4d
    • Sebastian Andrzej Siewior's avatar
      arch/arm/boot/compressed/decompress.c: fix build error due to lz4 changes · fb092eb6
      Sebastian Andrzej Siewior authored
        include/linux/cpumask.h: In function 'cpumask_parse':
        include/linux/cpumask.h:636:21: error: implicit declaration of function 'strchrnul'; did you mean 'strchr'? [-Werror=implicit-function-declaration]
      
      Because arch/arm/boot/compressed/decompress.c does
      
      #define _LINUX_STRING_H_
      
      preventing linux/string.h from providing strchrnul.  It also #includes
      asm/string.h, which for arm has a declaration of strchr(), explaining why
      this didn't use to fail.
      
      Link: http://lkml.kernel.org/r/20190528115346.f5a7kn3hdnuf5rts@linutronix.de
      Fixes: 3713a4e1
      
       ("include/linux/cpumask.h: fix double string traverse in cpumask_parse")
      Suggested-by: default avatarRasmus Villemoes <linux@rasmusvillemoes.dk>
      Cc: Yury Norov <ynorov@marvell.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Russell King <rmk+kernel@arm.linux.org.uk>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      fb092eb6
    • David Rientjes's avatar
      arch/parisc/configs/c8000_defconfig: remove obsoleted CONFIG_DEBUG_SLAB_LEAK · 461071b0
      David Rientjes authored
      CONFIG_DEBUG_SLAB_LEAK has been removed, so remove it from defconfig.
      
      Link: http://lkml.kernel.org/r/alpine.DEB.2.21.1905201015460.96074@chino.kir.corp.google.com
      Fixes: 7878c231
      
       ("slab: remove /proc/slab_allocators")
      Signed-off-by: default avatarDavid Rientjes <rientjes@google.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      461071b0
    • Andrew Morton's avatar