Skip to content
  1. Mar 04, 2022
    • Linus Torvalds's avatar
      Merge tag 'mips-fixes-5.17_4' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux · e58bd49d
      Linus Torvalds authored
      Pull MIPS fixes from Thomas Bogendoerfer:
      
       - Fix memory detection for MT7621 devices
      
       - Fix setnocoherentio kernel option
      
       - Fix warning when CONFIG_SCHED_CORE is enabled
      
      * tag 'mips-fixes-5.17_4' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux:
        MIPS: ralink: mt7621: use bitwise NOT instead of logical
        mips: setup: fix setnocoherentio() boolean setting
        MIPS: smp: fill in sibling and core maps earlier
        MIPS: ralink: mt7621: do memory detection on KSEG1
      e58bd49d
    • Linus Torvalds's avatar
      Merge tag 'auxdisplay-for-linus-v5.17-rc7' of git://github.com/ojeda/linux · 4d5ae234
      Linus Torvalds authored
      Pull auxdisplay fixes from Miguel Ojeda:
       "A few lcd2s fixes from Andy Shevchenko"
      
      * tag 'auxdisplay-for-linus-v5.17-rc7' of git://github.com/ojeda/linux:
        auxdisplay: lcd2s: Use proper API to free the instance of charlcd object
        auxdisplay: lcd2s: Fix memory leak in ->remove()
        auxdisplay: lcd2s: Fix lcd2s_redefine_char() feature
      4d5ae234
  2. Mar 03, 2022
    • Linus Torvalds's avatar
      Merge branch 'ucount-rlimit-fixes-for-v5.17' of... · 5859a2b1
      Linus Torvalds authored
      Merge branch 'ucount-rlimit-fixes-for-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace
      
      Pull ucounts fix from Eric Biederman:
       "Etienne Dechamps recently found a regression caused by enforcing
        RLIMIT_NPROC for root where the rlimit was not previously enforced.
      
        Michal Koutný had previously pointed out the inconsistency in
        enforcing the RLIMIT_NPROC that had been on the root owned process
        after the root user creates a user namespace.
      
        Which makes the fix for the regression simply removing the
        inconsistency"
      
      * 'ucount-rlimit-fixes-for-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace:
        ucounts: Fix systemd LimitNPROC with private users regression
      5859a2b1
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm · 7e3d7613
      Linus Torvalds authored
      Pull ARM fixes from Russell King:
      
       - Fix kgdb breakpoint for Thumb2
      
       - Fix dependency for BITREVERSE kconfig
      
       - Fix nommu early_params and __setup returns
      
      * tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm:
        ARM: 9182/1: mmu: fix returns from early_param() and __setup() functions
        ARM: 9178/1: fix unmet dependency on BITREVERSE for HAVE_ARCH_BITREVERSE
        ARM: Fix kgdb breakpoint for Thumb2
      7e3d7613
    • Andy Shevchenko's avatar
      auxdisplay: lcd2s: Use proper API to free the instance of charlcd object · 9ed331f8
      Andy Shevchenko authored
      While it might work, the current approach is fragile in a few ways:
      - whenever members in the structure are shuffled, the pointer will be wrong
      - the resource freeing may include more than covered by kfree()
      
      Fix this by using charlcd_free() call instead of kfree().
      
      Fixes: 8c9108d0
      
       ("auxdisplay: add a driver for lcd2s character display")
      Cc: Lars Poeschel <poeschel@lemonage.de>
      Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Signed-off-by: default avatarMiguel Ojeda <ojeda@kernel.org>
      9ed331f8
    • Andy Shevchenko's avatar
      auxdisplay: lcd2s: Fix memory leak in ->remove() · 898c0a15
      Andy Shevchenko authored
      Once allocated the struct lcd2s_data is never freed.
      Fix the memory leak by switching to devm_kzalloc().
      
      Fixes: 8c9108d0
      
       ("auxdisplay: add a driver for lcd2s character display")
      Cc: Lars Poeschel <poeschel@lemonage.de>
      Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Signed-off-by: default avatarMiguel Ojeda <ojeda@kernel.org>
      898c0a15
    • Andy Shevchenko's avatar
      auxdisplay: lcd2s: Fix lcd2s_redefine_char() feature · 4424c35e
      Andy Shevchenko authored
      It seems that the lcd2s_redefine_char() has never been properly
      tested. The buffer is filled by DEF_CUSTOM_CHAR command followed
      by the character number (from 0 to 7), but immediately after that
      these bytes are rewritten by the decoded hex stream.
      
      Fix the index to fill the buffer after the command and number.
      
      Fixes: 8c9108d0
      
       ("auxdisplay: add a driver for lcd2s character display")
      Cc: Lars Poeschel <poeschel@lemonage.de>
      Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Reviewed-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
      [fixed typo in commit message]
      Signed-off-by: default avatarMiguel Ojeda <ojeda@kernel.org>
      4424c35e
    • Linus Torvalds's avatar
      Merge tag 'erofs-for-5.17-rc7-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs · 92ebf5f9
      Linus Torvalds authored
      Pull erofs fix from Gao Xiang:
       "A one-line patch to fix the new ztailpacking feature on > 4GiB
        filesystems because z_idataoff can get trimmed improperly.
      
        ztailpacking is still a brand new EXPERIMENTAL feature, but it'd be
        better to fix the issue as soon as possible to avoid unnecessary
        backporting.
      
        Summary:
      
         - Fix ztailpacking z_idataoff getting trimmed on > 4GiB filesystems"
      
      * tag 'erofs-for-5.17-rc7-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs:
        erofs: fix ztailpacking on > 4GiB filesystems
      92ebf5f9
    • Linus Torvalds's avatar
      Merge tag 'ntb-5.17-bugfixes' of git://github.com/jonmason/ntb · ae5f531d
      Linus Torvalds authored
      Pull NTB fixes from Jon Mason:
       "Bug fixes for sparse warning, intel port config offset, and a new
        mailing list"
      
      * tag 'ntb-5.17-bugfixes' of git://github.com/jonmason/ntb:
        MAINTAINERS: update mailing list address for NTB subsystem
        ntb: intel: fix port config status offset for SPR
        NTB/msi: Use struct_size() helper in devm_kzalloc()
      ae5f531d
  3. Mar 02, 2022
    • Gao Xiang's avatar
      erofs: fix ztailpacking on > 4GiB filesystems · 22ba5e99
      Gao Xiang authored
      z_idataoff here is an absolute physical offset, so it should use
      erofs_off_t (64 bits at least). Otherwise, it'll get trimmed and
      cause the decompresion failure.
      
      Link: https://lore.kernel.org/r/20220222033118.20540-1-hsiangkao@linux.alibaba.com
      Fixes: ab92184f
      
       ("erofs: add on-disk compressed tail-packing inline support")
      Reviewed-by: default avatarYue Hu <huyue2@yulong.com>
      Reviewed-by: default avatarChao Yu <chao@kernel.org>
      Signed-off-by: default avatarGao Xiang <hsiangkao@linux.alibaba.com>
      22ba5e99
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm · fb184c4a
      Linus Torvalds authored
      Pull kvm fixes from Paolo Bonzini:
       "The bigger part of the change is a revert for x86 hosts. Here the
        second patch was supposed to fix the first, but in reality it was just
        as broken, so both have to go.
      
        x86 host:
      
         - Revert incorrect assumption that cr3 changes come with preempt
           notifier callbacks (they don't when static branches are changed,
           for example)
      
        ARM host:
      
         - Correctly synchronise PMR and co on PSCI CPU_SUSPEND
      
         - Skip tests that depend on GICv3 when the HW isn't available"
      
      * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
        KVM: selftests: aarch64: Skip tests if we can't create a vgic-v3
        Revert "KVM: VMX: Save HOST_CR3 in vmx_prepare_switch_to_guest()"
        Revert "KVM: VMX: Save HOST_CR3 in vmx_set_host_fs_gs()"
        KVM: arm64: Don't miss pending interrupts for suspended vCPU
      fb184c4a
    • Linus Torvalds's avatar
      Merge tag 'binfmt_elf-v5.17-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux · 57511536
      Linus Torvalds authored
      Pull binfmt_elf fix from Kees Cook:
       "This addresses a regression[1] under ia64 where some ET_EXEC binaries
        were not loading"
      
      Link: https://linux-regtracking.leemhuis.info/regzbot/regression/a3edd529-c42d-3b09-135c-7e98a15b150f@leemhuis.info/ [1]
      
      - Fix ia64 ET_EXEC loading
      
      * tag 'binfmt_elf-v5.17-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
        binfmt_elf: Avoid total_mapping_size for ET_EXEC
      57511536
    • Kees Cook's avatar
      binfmt_elf: Avoid total_mapping_size for ET_EXEC · 439a8468
      Kees Cook authored
      Partially revert commit 5f501d55
      
       ("binfmt_elf: reintroduce using
      MAP_FIXED_NOREPLACE"), which applied the ET_DYN "total_mapping_size"
      logic also to ET_EXEC.
      
      At least ia64 has ET_EXEC PT_LOAD segments that are not virtual-address
      contiguous (but _are_ file-offset contiguous). This would result in a
      giant mapping attempting to cover the entire span, including the virtual
      address range hole, and well beyond the size of the ELF file itself,
      causing the kernel to refuse to load it. For example:
      
      $ readelf -lW /usr/bin/gcc
      ...
      Program Headers:
        Type Offset   VirtAddr           PhysAddr           FileSiz  MemSiz   ...
      ...
        LOAD 0x000000 0x4000000000000000 0x4000000000000000 0x00b5a0 0x00b5a0 ...
        LOAD 0x00b5a0 0x600000000000b5a0 0x600000000000b5a0 0x0005ac 0x000710 ...
      ...
             ^^^^^^^^ ^^^^^^^^^^^^^^^^^^                    ^^^^^^^^ ^^^^^^^^
      
      File offset range     : 0x000000-0x00bb4c
      			0x00bb4c bytes
      
      Virtual address range : 0x4000000000000000-0x600000000000bcb0
      			0x200000000000bcb0 bytes
      
      Remove the total_mapping_size logic for ET_EXEC, which reduces the
      ET_EXEC MAP_FIXED_NOREPLACE coverage to only the first PT_LOAD (better
      than nothing), and retains it for ET_DYN.
      
      Ironically, this is the reverse of the problem that originally caused
      problems with MAP_FIXED_NOREPLACE: overlapping PT_LOAD segments. Future
      work could restore full coverage if load_elf_binary() were to perform
      mappings in a separate phase from the loading (where it could resolve
      both overlaps and holes).
      
      Cc: Eric Biederman <ebiederm@xmission.com>
      Cc: Alexander Viro <viro@zeniv.linux.org.uk>
      Cc: linux-fsdevel@vger.kernel.org
      Cc: linux-mm@kvack.org
      Reported-by: default avatarmatoro <matoro_bugzilla_kernel@matoro.tk>
      Fixes: 5f501d55
      
       ("binfmt_elf: reintroduce using MAP_FIXED_NOREPLACE")
      Link: https://lore.kernel.org/r/a3edd529-c42d-3b09-135c-7e98a15b150f@leemhuis.info
      Tested-by: default avatarmatoro <matoro_mailinglist_kernel@matoro.tk>
      Link: https://lore.kernel.org/lkml/ce8af9c13bcea9230c7689f3c1e0e2cd@matoro.tk
      Tested-By: default avatarJohn Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
      Link: https://lore.kernel.org/lkml/49182d0d-708b-4029-da5f-bc18603440a6@physik.fu-berlin.de
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      439a8468
  4. Mar 01, 2022
    • Ilya Lipnitskiy's avatar
      MIPS: ralink: mt7621: use bitwise NOT instead of logical · 5d896570
      Ilya Lipnitskiy authored
      It was the intention to reverse the bits, not make them all zero by
      using logical NOT operator.
      
      Fixes: cc19db8b
      
       ("MIPS: ralink: mt7621: do memory detection on KSEG1")
      Suggested-by: default avatarChuanhong Guo <gch981213@gmail.com>
      Signed-off-by: default avatarIlya Lipnitskiy <ilya.lipnitskiy@gmail.com>
      Reviewed-by: default avatarSergio Paracuellos <sergio.paracuellos@gmail.com>
      Signed-off-by: default avatarThomas Bogendoerfer <tsbogend@alpha.franken.de>
      5d896570
    • Linus Torvalds's avatar
      Merge tag 'soc-fixes-5.17-2' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc · 719fce75
      Linus Torvalds authored
      Pull ARM SoC fixes from Arnd Bergmann:
       "The code changes address mostly minor problems:
      
         - Several NXP/FSL SoC driver fixes, addressing issues with error
           handling and compilation
      
         - Fix a clock disabling imbalance in gpcv2 driver.
      
         - Arm Juno DMA coherency issue
      
         - Trivial firmware driver fixes for op-tee and scmi firmware
      
        The remaining changes address issues in the devicetree files:
      
         - A timer regression for the OMAP devkit8000, which has to use the
           alternative timer.
      
         - A hang in the i.MX8MM power domain configuration
      
         - Multiple fixes for the Rockchip RK3399 addressing issues with sound
           and eMMC
      
         - Cosmetic fixes for i.MX8ULP, RK3xxx, and Tegra124"
      
      * tag 'soc-fixes-5.17-2' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (32 commits)
        ARM: tegra: Move panels to AUX bus
        soc: imx: gpcv2: Fix clock disabling imbalance in error path
        soc: fsl: qe: Check of ioremap return value
        soc: fsl: qe: fix typo in a comment
        soc: fsl: guts: Add a missing memory allocation failure check
        soc: fsl: guts: Revert commit 3c0d64e8
        soc: fsl: Correct MAINTAINERS database (SOC)
        soc: fsl: Correct MAINTAINERS database (QUICC ENGINE LIBRARY)
        soc: fsl: Replace kernel.h with the necessary inclusions
        dt-bindings: fsl,layerscape-dcfg: add missing compatible for lx2160a
        dt-bindings: qoriq-clock: add missing compatible for lx2160a
        ARM: dts: Use 32KiHz oscillator on devkit8000
        ARM: dts: switch timer config to common devkit8000 devicetree
        tee: optee: fix error return code in probe function
        arm64: dts: imx8ulp: Set #thermal-sensor-cells to 1 as required
        arm64: dts: imx8mm: Fix VPU Hanging
        ARM: dts: rockchip: fix a typo on rk3288 crypto-controller
        ARM: dts: rockchip: reorder rk322x hmdi clocks
        firmware: arm_scmi: Remove space in MODULE_ALIAS name
        arm64: dts: agilex: use the compatible "intel,socfpga-agilex-hsotg"
        ...
      719fce75
    • Linus Torvalds's avatar
      Merge tag 'efi-urgent-for-v5.17-2' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi · 201b5c01
      Linus Torvalds authored
      Pull EFI fixes from Ard Biesheuvel:
      
       - don't treat valid hartid U32_MAX as a failure return code (RISC-V)
      
       - avoid blocking query_variable_info() call when blocking is not
         allowed
      
      * tag 'efi-urgent-for-v5.17-2' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi:
        efivars: Respect "block" flag in efivar_entry_set_safe()
        riscv/efi_stub: Fix get_boot_hartid_from_fdt() return value
      201b5c01
  5. Feb 28, 2022
  6. Feb 27, 2022
    • Linus Torvalds's avatar
      Merge tag 'trace-v5.17-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace · 2293be58
      Linus Torvalds authored
      Pull tracing fixes from Steven Rostedt:
      
       - rtla (Real-Time Linux Analysis tool):
          - fix typo in man page
          - Update API -e to -E before it is released
          - Error message fix and memory leak fix
      
       - Partially uninline trace event soft disable to shrink text
      
       - Fix function graph start up test
      
       - Have triggers affect the trace instance they are in and not top level
      
       - Have osnoise sleep in the units it says it uses
      
       - Remove unused ftrace stub function
      
       - Remove event probe redundant info from event in the buffer
      
       - Fix group ownership setting in tracefs
      
       - Ensure trace buffer is minimum size to prevent crashes
      
      * tag 'trace-v5.17-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
        rtla/osnoise: Fix error message when failing to enable trace instance
        rtla/osnoise: Free params at the exit
        rtla/hist: Make -E the short version of --entries
        tracing: Fix selftest config check for function graph start up test
        tracefs: Set the group ownership in apply_options() not parse_options()
        tracing/osnoise: Make osnoise_main to sleep for microseconds
        ftrace: Remove unused ftrace_startup_enable() stub
        tracing: Ensure trace buffer is at least 4096 bytes large
        tracing: Uninline trace_trigger_soft_disabled() partly
        eprobes: Remove redundant event type information
        tracing: Have traceon and traceoff trigger honor the instance
        tracing: Dump stacktrace trigger to the corresponding instance
        rtla: Fix systme -> system typo on man page
      2293be58
    • Linus Torvalds's avatar
      Merge tag 'fixes-2022-02-26' of git://git.kernel.org/pub/scm/linux/kernel/git/rppt/memblock · e41898d2
      Linus Torvalds authored
      Pull memblock fix from Mike Rapoport:
       "Use kfree() to release kmalloced memblock regions
      
        memblock.{reserved,memory}.regions may be allocated using kmalloc()
        in memblock_double_array(). Use kfree() to release these kmalloced
        regions"
      
      * tag 'fixes-2022-02-26' of git://git.kernel.org/pub/scm/linux/kernel/git/rppt/memblock:
        memblock: use kfree() to release kmalloced memblock regions
      e41898d2
    • Linus Torvalds's avatar
      Merge branch 'akpm' (patches from Andrew) · 086ee11b
      Linus Torvalds authored
      Merge misc fixes from Andrew Morton:
       "12 patches.
      
        Subsystems affected by this patch series: MAINTAINERS, mailmap, memfd,
        and mm (hugetlb, kasan, hugetlbfs, pagemap, selftests, memcg, and
        slab)"
      
      * emailed patches from Andrew Morton <akpm@linux-foundation.org>:
        selftests/memfd: clean up mapping in mfd_fail_write
        mailmap: update Roman Gushchin's email
        MAINTAINERS, SLAB: add Roman as reviewer, git tree
        MAINTAINERS: add Shakeel as a memcg co-maintainer
        MAINTAINERS: remove Vladimir from memcg maintainers
        MAINTAINERS: add Roman as a memcg co-maintainer
        selftest/vm: fix map_fixed_noreplace test failure
        mm: fix use-after-free bug when mm->mmap is reused after being freed
        hugetlbfs: fix a truncation issue in hugepages parameter
        kasan: test: prevent cache merging in kmem_cache_double_destroy
        mm/hugetlb: fix kernel crash with hugetlb mremap
        MAINTAINERS: add sysctl-next git tree
      086ee11b
    • Linus Torvalds's avatar
      Merge tag 'riscv-for-linus-5.17-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux · 2c8c230e
      Linus Torvalds authored
      Pull RISC-V fixes from Palmer Dabbelt:
      
       - A fix for the K210 sdcard defconfig, to avoid using a
         fixed delay for the root FS
      
       - A fix to make sure there's a proper call frame for
         trace_hardirqs_{on,off}().
      
      * tag 'riscv-for-linus-5.17-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux:
        riscv: fix oops caused by irqsoff latency tracer
        riscv: fix nommu_k210_sdcard_defconfig
      2c8c230e
    • Linus Torvalds's avatar
      Merge tag 'xfs-5.17-fixes-2' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux · 3bd9dd81
      Linus Torvalds authored
      Pull xfs fixes from Darrick Wong:
       "Nothing exciting, just more fixes for not returning sync_filesystem
        error values (and eliding it when it's not necessary).
      
        Summary:
      
         - Only call sync_filesystem when we're remounting the filesystem
           readonly readonly, and actually check its return value"
      
      * tag 'xfs-5.17-fixes-2' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux:
        xfs: only bother with sync_filesystem during readonly remount
      3bd9dd81
    • Mike Kravetz's avatar
      selftests/memfd: clean up mapping in mfd_fail_write · fda153c8
      Mike Kravetz authored
      
      
      Running the memfd script ./run_hugetlbfs_test.sh will often end in error
      as follows:
      
          memfd-hugetlb: CREATE
          memfd-hugetlb: BASIC
          memfd-hugetlb: SEAL-WRITE
          memfd-hugetlb: SEAL-FUTURE-WRITE
          memfd-hugetlb: SEAL-SHRINK
          fallocate(ALLOC) failed: No space left on device
          ./run_hugetlbfs_test.sh: line 60: 166855 Aborted                 (core dumped) ./memfd_test hugetlbfs
          opening: ./mnt/memfd
          fuse: DONE
      
      If no hugetlb pages have been preallocated, run_hugetlbfs_test.sh will
      allocate 'just enough' pages to run the test.  In the SEAL-FUTURE-WRITE
      test the mfd_fail_write routine maps the file, but does not unmap.  As a
      result, two hugetlb pages remain reserved for the mapping.  When the
      fallocate call in the SEAL-SHRINK test attempts allocate all hugetlb
      pages, it is short by the two reserved pages.
      
      Fix by making sure to unmap in mfd_fail_write.
      
      Link: https://lkml.kernel.org/r/20220219004340.56478-1-mike.kravetz@oracle.com
      Signed-off-by: default avatarMike Kravetz <mike.kravetz@oracle.com>
      Cc: Joel Fernandes <joel@joelfernandes.org>
      Cc: Shuah Khan <shuah@kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      fda153c8
    • Roman Gushchin's avatar
      mailmap: update Roman Gushchin's email · 9502bdbf
      Roman Gushchin authored
      
      
      I'm moving to a @linux.dev account. Map my old addresses.
      
      Link: https://lkml.kernel.org/r/20220221200006.416377-1-roman.gushchin@linux.dev
      Signed-off-by: default avatarRoman Gushchin <roman.gushchin@linux.dev>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      9502bdbf
    • Vlastimil Babka's avatar
      MAINTAINERS, SLAB: add Roman as reviewer, git tree · 7b0112f3
      Vlastimil Babka authored
      
      
      The slab code has an overlap with kmem accounting, where Roman has done
      a lot of work recently and it would be useful to make sure he's CC'd on
      patches that potentially affect it.  Thus add him as a reviewer for the
      SLAB subsystem.
      
      Also while at it, add the link to slab git tree.
      
      Link: https://lkml.kernel.org/r/20220222103104.13241-1-vbabka@suse.cz
      Signed-off-by: default avatarVlastimil Babka <vbabka@suse.cz>
      Acked-by: default avatarDavid Rientjes <rientjes@google.com>
      Acked-by: default avatarRoman Gushchin <roman.gushchin@linux.dev>
      Cc: Christoph Lameter <cl@linux.com>
      Cc: Pekka Enberg <penberg@kernel.org>
      Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      7b0112f3
    • Shakeel Butt's avatar
      MAINTAINERS: add Shakeel as a memcg co-maintainer · bb9d5454
      Shakeel Butt authored
      
      
      I have been contributing and reviewing to the memcg codebase for last
      couple of years.  So, making it official.
      
      Link: https://lkml.kernel.org/r/20220224060148.4092228-1-shakeelb@google.com
      Signed-off-by: default avatarShakeel Butt <shakeelb@google.com>
      Acked-by: default avatarRoman Gushchin <roman.gushchin@linux.dev>
      Acked-by: default avatarMichal Hocko <mhocko@suse.com>
      Cc: Johannes Weiner <hannes@cmpxchg.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      bb9d5454
    • Vladimir Davydov's avatar
      MAINTAINERS: remove Vladimir from memcg maintainers · 0a972e72
      Vladimir Davydov authored
      
      
      Link: https://lkml.kernel.org/r/4ad1f8da49d7b71c84a0c15bd5347f5ce704e730.1645608825.git.vdavydov.dev@gmail.com
      Signed-off-by: default avatarVladimir Davydov <vdavydov.dev@gmail.com>
      Acked-by: default avatarJohannes Weiner <hannes@cmpxchg.org>
      Acked-by: default avatarMichal Hocko <mhocko@suse.com>
      Cc: Roman Gushchin <roman.gushchin@linux.dev>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      0a972e72
    • Roman Gushchin's avatar
      MAINTAINERS: add Roman as a memcg co-maintainer · 7d547dcf
      Roman Gushchin authored
      
      
      Add myself as a memcg co-maintainer.  My primary focus over last few
      years was the kernel memory accounting stack, but I do work on some
      other parts of the memory controller as well.
      
      Link: https://lkml.kernel.org/r/20220221233951.659048-1-roman.gushchin@linux.dev
      Signed-off-by: default avatarRoman Gushchin <roman.gushchin@linux.dev>
      Acked-by: default avatarMichal Hocko <mhocko@suse.com>
      Acked-by: default avatarJohannes Weiner <hannes@cmpxchg.org>
      Acked-by: default avatarVlastimil Babka <vbabka@suse.cz>
      Cc: Vladimir Davydov <vdavydov.dev@gmail.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      7d547dcf
    • Aneesh Kumar K.V's avatar
      selftest/vm: fix map_fixed_noreplace test failure · f39c5800
      Aneesh Kumar K.V authored
      
      
      On the latest RHEL the test fails due to executable mapped at 256MB
      address
      
           # ./map_fixed_noreplace
          mmap() @ 0x10000000-0x10050000 p=0xffffffffffffffff result=File exists
          10000000-10010000 r-xp 00000000 fd:04 34905657                           /root/rpmbuild/BUILD/kernel-5.14.0-56.el9/linux-5.14.0-56.el9.ppc64le/tools/testing/selftests/vm/map_fixed_noreplace
          10010000-10020000 r--p 00000000 fd:04 34905657                           /root/rpmbuild/BUILD/kernel-5.14.0-56.el9/linux-5.14.0-56.el9.ppc64le/tools/testing/selftests/vm/map_fixed_noreplace
          10020000-10030000 rw-p 00010000 fd:04 34905657                           /root/rpmbuild/BUILD/kernel-5.14.0-56.el9/linux-5.14.0-56.el9.ppc64le/tools/testing/selftests/vm/map_fixed_noreplace
          10029b90000-10029bc0000 rw-p 00000000 00:00 0                            [heap]
          7fffbb510000-7fffbb750000 r-xp 00000000 fd:04 24534                      /usr/lib64/libc.so.6
          7fffbb750000-7fffbb760000 r--p 00230000 fd:04 24534                      /usr/lib64/libc.so.6
          7fffbb760000-7fffbb770000 rw-p 00240000 fd:04 24534                      /usr/lib64/libc.so.6
          7fffbb780000-7fffbb7a0000 r--p 00000000 00:00 0                          [vvar]
          7fffbb7a0000-7fffbb7b0000 r-xp 00000000 00:00 0                          [vdso]
          7fffbb7b0000-7fffbb800000 r-xp 00000000 fd:04 24514                      /usr/lib64/ld64.so.2
          7fffbb800000-7fffbb810000 r--p 00040000 fd:04 24514                      /usr/lib64/ld64.so.2
          7fffbb810000-7fffbb820000 rw-p 00050000 fd:04 24514                      /usr/lib64/ld64.so.2
          7fffd93f0000-7fffd9420000 rw-p 00000000 00:00 0                          [stack]
          Error: couldn't map the space we need for the test
      
      Fix this by finding a free address using mmap instead of hardcoding
      BASE_ADDRESS.
      
      Link: https://lkml.kernel.org/r/20220217083417.373823-1-aneesh.kumar@linux.ibm.com
      Signed-off-by: default avatarAneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Jann Horn <jannh@google.com>
      Cc: Shuah Khan <shuah@kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      f39c5800
    • Suren Baghdasaryan's avatar
      mm: fix use-after-free bug when mm->mmap is reused after being freed · f798a1d4
      Suren Baghdasaryan authored
      oom reaping (__oom_reap_task_mm) relies on a 2 way synchronization with
      exit_mmap.  First it relies on the mmap_lock to exclude from unlock
      path[1], page tables tear down (free_pgtables) and vma destruction.
      This alone is not sufficient because mm->mmap is never reset.
      
      For historical reasons[2] the lock is taken there is also MMF_OOM_SKIP
      set for oom victims before.
      
      The oom reaper only ever looks at oom victims so the whole scheme works
      properly but process_mrelease can opearate on any task (with fatal
      signals pending) which doesn't really imply oom victims.  That means
      that the MMF_OOM_SKIP part of the synchronization doesn't work and it
      can see a task after the whole address space has been demolished and
      traverse an already released mm->mmap list.  This leads to use after
      free as properly caught up by KASAN report.
      
      Fix the issue by reseting mm->mmap so that MMF_OOM_SKIP synchronization
      is not needed anymore.  The MMF_OOM_SKIP is not removed from exit_mmap
      yet but it acts mostly as an optimization now.
      
      [1] 27ae357f ("mm, oom: fix concurrent munlock and oom reaper unmap, v3")
      [2] 21292580 ("mm: oom: let oom_reap_task and exit_mmap run concurrently")
      
      [mhocko@suse.com: changelog rewrite]
      
      Link: https://lore.kernel.org/all/00000000000072ef2c05d7f81950@google.com/
      Link: https://lkml.kernel.org/r/20220215201922.1908156-1-surenb@google.com
      Fixes: 64591e86
      
       ("mm: protect free_pgtables with mmap_lock write lock in exit_mmap")
      Signed-off-by: default avatarSuren Baghdasaryan <surenb@google.com>
      Reported-by: default avatar <syzbot+2ccf63a4bd07cf39cab0@syzkaller.appspotmail.com>
      Suggested-by: default avatarMichal Hocko <mhocko@suse.com>
      Reviewed-by: default avatarRik van Riel <riel@surriel.com>
      Reviewed-by: default avatarYang Shi <shy828301@gmail.com>
      Acked-by: default avatarMichal Hocko <mhocko@suse.com>
      Cc: David Rientjes <rientjes@google.com>
      Cc: Matthew Wilcox <willy@infradead.org>
      Cc: Johannes Weiner <hannes@cmpxchg.org>
      Cc: Roman Gushchin <roman.gushchin@linux.dev>
      Cc: Rik van Riel <riel@surriel.com>
      Cc: Minchan Kim <minchan@kernel.org>
      Cc: Kirill A. Shutemov <kirill@shutemov.name>
      Cc: Andrea Arcangeli <aarcange@redhat.com>
      Cc: Christian Brauner <brauner@kernel.org>
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: David Hildenbrand <david@redhat.com>
      Cc: Jann Horn <jannh@google.com>
      Cc: Shakeel Butt <shakeelb@google.com>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Christian Brauner <christian.brauner@ubuntu.com>
      Cc: Florian Weimer <fweimer@redhat.com>
      Cc: Jan Engelhardt <jengelh@inai.de>
      Cc: Tim Murray <timmurray@google.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      f798a1d4
    • Liu Yuntao's avatar
      hugetlbfs: fix a truncation issue in hugepages parameter · e79ce983
      Liu Yuntao authored
      When we specify a large number for node in hugepages parameter, it may
      be parsed to another number due to truncation in this statement:
      
      	node = tmp;
      
      For example, add following parameter in command line:
      
      	hugepagesz=1G hugepages=4294967297:5
      
      and kernel will allocate 5 hugepages for node 1 instead of ignoring it.
      
      I move the validation check earlier to fix this issue, and slightly
      simplifies the condition here.
      
      Link: https://lkml.kernel.org/r/20220209134018.8242-1-liuyuntao10@huawei.com
      Fixes: b5389086
      
       ("hugetlbfs: extend the definition of hugepages parameter to support node allocation")
      Signed-off-by: default avatarLiu Yuntao <liuyuntao10@huawei.com>
      Reviewed-by: default avatarMike Kravetz <mike.kravetz@oracle.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>
      e79ce983
    • Andrey Konovalov's avatar
      kasan: test: prevent cache merging in kmem_cache_double_destroy · 70effdc3
      Andrey Konovalov authored
      With HW_TAGS KASAN and kasan.stacktrace=off, the cache created in the
      kmem_cache_double_destroy() test might get merged with an existing one.
      Thus, the first kmem_cache_destroy() call won't actually destroy it but
      will only decrease the refcount.  This causes the test to fail.
      
      Provide an empty constructor for the created cache to prevent the cache
      from getting merged.
      
      Link: https://lkml.kernel.org/r/b597bd434c49591d8af00ee3993a42c609dc9a59.1644346040.git.andreyknvl@google.com
      Fixes: f98f966c
      
       ("kasan: test: add test case for double-kmem_cache_destroy()")
      Signed-off-by: default avatarAndrey Konovalov <andreyknvl@google.com>
      Reviewed-by: default avatarMarco Elver <elver@google.com>
      Cc: Alexander Potapenko <glider@google.com>
      Cc: Dmitry Vyukov <dvyukov@google.com>
      Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      70effdc3
    • Aneesh Kumar K.V's avatar
      mm/hugetlb: fix kernel crash with hugetlb mremap · db110a99
      Aneesh Kumar K.V authored
      This fixes the below crash:
      
        kernel BUG at include/linux/mm.h:2373!
        cpu 0x5d: Vector: 700 (Program Check) at [c00000003c6e76e0]
            pc: c000000000581a54: pmd_to_page+0x54/0x80
            lr: c00000000058d184: move_hugetlb_page_tables+0x4e4/0x5b0
            sp: c00000003c6e7980
           msr: 9000000000029033
          current = 0xc00000003bd8d980
          paca    = 0xc000200fff610100   irqmask: 0x03   irq_happened: 0x01
            pid   = 9349, comm = hugepage-mremap
        kernel BUG at include/linux/mm.h:2373!
          move_hugetlb_page_tables+0x4e4/0x5b0 (link register)
          move_hugetlb_page_tables+0x22c/0x5b0 (unreliable)
          move_page_tables+0xdbc/0x1010
          move_vma+0x254/0x5f0
          sys_mremap+0x7c0/0x900
          system_call_exception+0x160/0x2c0
      
      the kernel can't use huge_pte_offset before it set the pte entry because
      a page table lookup check for huge PTE bit in the page table to
      differentiate between a huge pte entry and a pointer to pte page.  A
      huge_pte_alloc won't mark the page table entry huge and hence kernel
      should not use huge_pte_offset after a huge_pte_alloc.
      
      Link: https://lkml.kernel.org/r/20220211063221.99293-1-aneesh.kumar@linux.ibm.com
      Fixes: 550a7d60
      
       ("mm, hugepages: add mremap() support for hugepage backed vma")
      Signed-off-by: default avatarAneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
      Reviewed-by: default avatarMike Kravetz <mike.kravetz@oracle.com>
      Reviewed-by: default avatarMina Almasry <almasrymina@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>
      db110a99
    • Luis Chamberlain's avatar
      MAINTAINERS: add sysctl-next git tree · bbcf7b0e
      Luis Chamberlain authored
      
      
      Add a git tree for sysctls as there's been quite a bit of work lately to
      remove all the syctls out of kernel/sysctl.c and move to their respective
      places, so coordination has been needed to avoid conflicts.  This tree
      will also help soak these changes on linux-next prior to getting to Linus.
      
      Link: https://lkml.kernel.org/r/20220218182736.3694508-1-mcgrof@kernel.org
      Signed-off-by: default avatarLuis Chamberlain <mcgrof@kernel.org>
      Cc: Kees Cook <keescook@chromium.org>
      Cc: Iurii Zaikin <yzaikin@google.com>
      Cc: Stephen Rothwell <sfr@canb.auug.org.au>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      bbcf7b0e