Skip to content
  1. Jun 03, 2019
    • 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
  2. 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
    • Randy Dunlap's avatar
      lib/sort.c: fix kernel-doc notation warnings · aa52619c
      Randy Dunlap authored
      Fix kernel-doc notation in lib/sort.c by using correct function parameter
      names.
      
        lib/sort.c:59: warning: Excess function parameter 'size' description in 'swap_words_32'
        lib/sort.c:83: warning: Excess function parameter 'size' description in 'swap_words_64'
        lib/sort.c:110: warning: Excess function parameter 'size' description in 'swap_bytes'
      
      Link: http://lkml.kernel.org/r/60e25d3d-68d1-bde2-3b39-e4baa0b14907@infradead.org
      Fixes: 37d0ec34
      
       ("lib/sort: make swap functions more generic")
      Signed-off-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Cc: George Spelvin <lkml@sdf.org>
      Cc: Andrew 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>
      aa52619c
    • Randy Dunlap's avatar
      mm: fix Documentation/vm/hmm.rst Sphinx warnings · 91173c6e
      Randy Dunlap authored
      Fix Sphinx warnings in Documentation/vm/hmm.rst by using "::" notation and
      inserting a blank line.  Also add a missing ';'.
      
        Documentation/vm/hmm.rst:292: WARNING: Unexpected indentation.
        Documentation/vm/hmm.rst:300: WARNING: Unexpected indentation.
      
      Link: http://lkml.kernel.org/r/c5995359-7c82-4e47-c7be-b58a4dda0953@infradead.org
      Fixes: 023a019a
      
       ("mm/hmm: add default fault flags to avoid the need to pre-fill pfns arrays")
      Signed-off-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Reviewed-by: default avatarJérôme Glisse <jglisse@redhat.com>
      Reviewed-by: default avatarMike Rapoport <rppt@linux.ibm.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      91173c6e
    • Masahiro Yamada's avatar
      treewide: fix typos of SPDX-License-Identifier · 8e82fe2a
      Masahiro Yamada authored
      
      
      Prior to the adoption of SPDX, it was difficult for tools to determine
      the correct license due to incomplete or badly formatted license text.
      The SPDX solves this issue, assuming people can correctly spell
      "SPDX-License-Identifier" although this assumption is broken in some
      places.
      
      Since scripts/spdxcheck.py parses only lines that exactly matches to
      the correct tag, it cannot (should not) detect this kind of error.
      
      If the correct tag is missing, scripts/checkpatch.pl warns like this:
      
       WARNING: Missing or malformed SPDX-License-Identifier tag in line *
      
      So, people should notice it before the patch submission, but in reality
      broken tags sometimes slip in. The checkpatch warning is not useful for
      checking the committed files globally since large number of files still
      have no SPDX tag.
      
      Also, I am not sure about the legal effect when the SPDX tag is broken.
      
      Anyway, these typos are absolutely worth fixing. It is pretty easy to
      find suspicious lines by grep.
      
        $ git grep --not -e SPDX-License-Identifier --and -e SPDX- -- \
          :^LICENSES :^scripts/spdxcheck.py :^*/license-rules.rst
        arch/arm/kernel/bugs.c:// SPDX-Identifier: GPL-2.0
        drivers/phy/st/phy-stm32-usbphyc.c:// SPDX-Licence-Identifier: GPL-2.0
        drivers/pinctrl/sh-pfc/pfc-r8a77980.c:// SPDX-Lincense-Identifier: GPL 2.0
        lib/test_stackinit.c:// SPDX-Licenses: GPLv2
        sound/soc/codecs/max9759.c:// SPDX-Licence-Identifier: GPL-2.0
      
      Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      8e82fe2a
    • Alex Xu (Hello71)'s avatar
      crypto: ux500 - fix license comment syntax error · 62e139eb
      Alex Xu (Hello71) authored
      Causes error: drivers/crypto/ux500/cryp/Makefile:5: *** missing
      separator.  Stop.
      
      Fixes: af873fce
      
       ("treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 194")
      Signed-off-by: default avatarAlex Xu (Hello71) <alex_y_xu@yahoo.ca>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      62e139eb
  3. Jun 01, 2019