1. 19 Feb, 2023 2 commits
    • Darrell Kavanagh's avatar
      firmware/efi sysfb_efi: Add quirk for Lenovo IdeaPad Duet 3 · e1d44715
      Darrell Kavanagh authored
      Another Lenovo convertable which reports a landscape resolution of
      1920x1200 with a pitch of (1920 * 4) bytes, while the actual framebuffer
      has a resolution of 1200x1920 with a pitch of (1200 * 4) bytes.
      Signed-off-by: default avatarDarrell Kavanagh <darrell.kavanagh@gmail.com>
      Reviewed-by: default avatarHans de Goede <hdegoede@redhat.com>
      Signed-off-by: default avatarArd Biesheuvel <ardb@kernel.org>
      e1d44715
    • Pierre Gondois's avatar
      arm64: efi: Make efi_rt_lock a raw_spinlock · 0e68b551
      Pierre Gondois authored
      Running a rt-kernel base on 6.2.0-rc3-rt1 on an Ampere Altra outputs
      the following:
        BUG: sleeping function called from invalid context at kernel/locking/spinlock_rt.c:46
        in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 9, name: kworker/u320:0
        preempt_count: 2, expected: 0
        RCU nest depth: 0, expected: 0
        3 locks held by kworker/u320:0/9:
        #0: ffff3fff8c27d128 ((wq_completion)efi_rts_wq){+.+.}-{0:0}, at: process_one_work (./include/linux/atomic/atomic-long.h:41)
        #1: ffff80000861bdd0 ((work_completion)(&efi_rts_work.work)){+.+.}-{0:0}, at: process_one_work (./include/linux/atomic/atomic-long.h:41)
        #2: ffffdf7e1ed3e460 (efi_rt_lock){+.+.}-{3:3}, at: efi_call_rts (drivers/firmware/efi/runtime-wrappers.c:101)
        Preemption disabled at:
        efi_virtmap_load (./arch/arm64/include/asm/mmu_context.h:248)
        CPU: 0 PID: 9 Comm: kworker/u320:0 Tainted: G        W          6.2.0-rc3-rt1
        Hardware name: WIWYNN Mt.Jade Server System B81.03001.0005/Mt.Jade Motherboard, BIOS 1.08.20220218 (SCP: 1.08.20220218) 2022/02/18
        Workqueue: efi_rts_wq efi_call_rts
        Call trace:
        dump_backtrace (arch/arm64/kernel/stacktrace.c:158)
        show_stack (arch/arm64/kernel/stacktrace.c:165)
        dump_stack_lvl (lib/dump_stack.c:107 (discriminator 4))
        dump_stack (lib/dump_stack.c:114)
        __might_resched (kernel/sched/core.c:10134)
        rt_spin_lock (kernel/locking/rtmutex.c:1769 (discriminator 4))
        efi_call_rts (drivers/firmware/efi/runtime-wrappers.c:101)
        [...]
      
      This seems to come from commit ff7a1679 ("arm64: efi: Execute
      runtime services from a dedicated stack") which adds a spinlock. This
      spinlock is taken through:
      efi_call_rts()
      \-efi_call_virt()
        \-efi_call_virt_pointer()
          \-arch_efi_call_virt_setup()
      
      Make 'efi_rt_lock' a raw_spinlock to avoid being preempted.
      
      [ardb: The EFI runtime services are called with a different set of
             translation tables, and are permitted to use the SIMD registers.
             The context switch code preserves/restores neither, and so EFI
             calls must be made with preemption disabled, rather than only
             disabling migration.]
      
      Fixes: ff7a1679 ("arm64: efi: Execute runtime services from a dedicated stack")
      Signed-off-by: default avatarPierre Gondois <pierre.gondois@arm.com>
      Cc: <stable@vger.kernel.org> # v6.1+
      Signed-off-by: default avatarArd Biesheuvel <ardb@kernel.org>
      0e68b551
  2. 10 Feb, 2023 1 commit
    • Ard Biesheuvel's avatar
      efi: Add mixed-mode thunk recipe for GetMemoryAttributes · 45d51654
      Ard Biesheuvel authored
      EFI mixed mode on x86 requires a recipe for each protocol method or
      firmware service that takes u64 arguments by value, or returns pointer
      or 'native int' (UINTN) values by reference (e.g,, through a void ** or
      unsigned long * parameter), due to the fact that these types cannot be
      translated 1:1 between the i386 and MS x64 calling conventions.
      
      So add the missing recipe for GetMemoryAttributes, which is not actually
      being used yet on x86, but the code exists and can be built for x86 so
      let's make sure it works as it should.
      
      Cc: Evgeniy Baskov <baskov@ispras.ru>
      Signed-off-by: default avatarArd Biesheuvel <ardb@kernel.org>
      45d51654
  3. 09 Feb, 2023 2 commits
  4. 04 Feb, 2023 1 commit
  5. 03 Feb, 2023 4 commits
    • Dan Williams's avatar
      efi/cper, cxl: Remove cxl_err.h · b0048092
      Dan Williams authored
      While going to create include/linux/cxl.h for some cross-subsystem CXL
      definitions I noticed that include/linux/cxl_err.h was already present.
      That header has no reason to be global, and it duplicates the RAS
      Capability Structure definitions in drivers/cxl/cxl.h. A follow-on patch
      can consider unifying the CXL native error tracing with the CPER error
      printing.
      
      Also fixed up the spec reference as the latest released spec is v3.0.
      
      Cc: Smita Koralahalli <Smita.KoralahalliChannabasappa@amd.com>
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      Reviewed-by: default avatarIra Weiny <ira.weiny@intel.com>
      Signed-off-by: default avatarArd Biesheuvel <ardb@kernel.org>
      b0048092
    • Ard Biesheuvel's avatar
      efi: Use standard format for printing the EFI revision · 1758817e
      Ard Biesheuvel authored
      The UEFI spec section 4.2.1 describes the way the human readable EFI
      revision should be constructed from the 32-bit revision field in the
      system table:
      
        The upper 16 bits of this field contain the major revision value,
        and the lower 16 bits contain the minor revision value. The minor
        revision values are binary coded decimals and are limited to the
        range of 00..99.
      
        When printed or displayed UEFI spec revision is referred as (Major
        revision).(Minor revision upper decimal).(Minor revision lower
        decimal) or (Major revision).(Minor revision upper decimal) in case
        Minor revision lower decimal is set to 0.
      
      Let's adhere to this when logging the EFI revision to the kernel log.
      
      Note that the bit about binary coded decimals is bogus, and the minor
      revision lower decimal is simply the minor revision modulo 10, given the
      symbolic definitions provided by the spec itself:
      
        #define EFI_2_40_SYSTEM_TABLE_REVISION ((2<<16) | (40))
        #define EFI_2_31_SYSTEM_TABLE_REVISION ((2<<16) | (31))
        #define EFI_2_30_SYSTEM_TABLE_REVISION ((2<<16) | (30))
      Signed-off-by: default avatarArd Biesheuvel <ardb@kernel.org>
      1758817e
    • Ard Biesheuvel's avatar
      efi: Drop minimum EFI version check at boot · 234fa51d
      Ard Biesheuvel authored
      We currently pass a minimum major version to the generic EFI helper that
      checks the system table magic and version, and refuse to boot if the
      value is lower.
      
      The motivation for this check is unknown, and even the code that uses
      major version 2 as the minimum (ARM, arm64 and RISC-V) should make it
      past this check without problems, and boot to a point where we have
      access to a console or some other means to inform the user that the
      firmware's major revision number made us unhappy. (Revision 2.0 of the
      UEFI specification was released in January 2006, whereas ARM, arm64 and
      RISC-V support where added in 2009, 2013 and 2017, respectively, so
      checking for major version 2 or higher is completely arbitrary)
      
      So just drop the check.
      Signed-off-by: default avatarArd Biesheuvel <ardb@kernel.org>
      234fa51d
    • Ard Biesheuvel's avatar
      efi: zboot: Use EFI protocol to remap code/data with the right attributes · ace013a5
      Ard Biesheuvel authored
      Use the recently introduced EFI_MEMORY_ATTRIBUTES_PROTOCOL in the zboot
      implementation to set the right attributes for the code and data
      sections of the decompressed image, i.e., EFI_MEMORY_RO for code and
      EFI_MEMORY_XP for data.
      Signed-off-by: default avatarArd Biesheuvel <ardb@kernel.org>
      ace013a5
  6. 30 Jan, 2023 1 commit
  7. 26 Jan, 2023 3 commits
    • Johan Hovold's avatar
      efi: efivars: prevent double registration · 0217a40d
      Johan Hovold authored
      Add the missing sanity check to efivars_register() so that it is no
      longer possible to override an already registered set of efivar ops
      (without first deregistering them).
      
      This can help debug initialisation ordering issues where drivers have so
      far unknowingly been relying on overriding the generic ops.
      Signed-off-by: default avatarJohan Hovold <johan+linaro@kernel.org>
      Signed-off-by: default avatarArd Biesheuvel <ardb@kernel.org>
      0217a40d
    • Johan Hovold's avatar
      efi: verify that variable services are supported · bad267f9
      Johan Hovold authored
      Current Qualcomm UEFI firmware does not implement the variable services
      but not all revisions clear the corresponding bits in the RT_PROP table
      services mask and instead the corresponding calls return
      EFI_UNSUPPORTED.
      
      This leads to efi core registering the generic efivar ops even when the
      variable services are not supported or when they are accessed through
      some other interface (e.g. Google SMI or the upcoming Qualcomm SCM
      implementation).
      
      Instead of playing games with init call levels to make sure that the
      custom implementations are registered after the generic one, make sure
      that get_next_variable() is actually supported before registering the
      generic ops.
      Signed-off-by: default avatarJohan Hovold <johan+linaro@kernel.org>
      Signed-off-by: default avatarArd Biesheuvel <ardb@kernel.org>
      bad267f9
    • Johan Hovold's avatar
      efivarfs: always register filesystem · 301de9a2
      Johan Hovold authored
      The efivar ops are typically registered at subsys init time so that
      they are available when efivarfs is registered at module init time.
      
      Other efivars implementations, such as Google SMI, exist and can
      currently be built as modules which means that efivar may not be
      available when efivarfs is initialised.
      
      Move the efivar availability check from module init to when the
      filesystem is mounted to allow late registration of efivars.
      Signed-off-by: default avatarJohan Hovold <johan+linaro@kernel.org>
      Signed-off-by: default avatarArd Biesheuvel <ardb@kernel.org>
      301de9a2
  8. 23 Jan, 2023 4 commits
  9. 22 Jan, 2023 2 commits
  10. 17 Jan, 2023 2 commits
  11. 10 Jan, 2023 2 commits
  12. 25 Dec, 2022 2 commits
    • Linus Torvalds's avatar
      Linux 6.2-rc1 · 1b929c02
      Linus Torvalds authored
      1b929c02
    • Steven Rostedt (Google)'s avatar
      treewide: Convert del_timer*() to timer_shutdown*() · 292a089d
      Steven Rostedt (Google) authored
      Due to several bugs caused by timers being re-armed after they are
      shutdown and just before they are freed, a new state of timers was added
      called "shutdown".  After a timer is set to this state, then it can no
      longer be re-armed.
      
      The following script was run to find all the trivial locations where
      del_timer() or del_timer_sync() is called in the same function that the
      object holding the timer is freed.  It also ignores any locations where
      the timer->function is modified between the del_timer*() and the free(),
      as that is not considered a "trivial" case.
      
      This was created by using a coccinelle script and the following
      commands:
      
          $ cat timer.cocci
          @@
          expression ptr, slab;
          identifier timer, rfield;
          @@
          (
          -       del_timer(&ptr->timer);
          +       timer_shutdown(&ptr->timer);
          |
          -       del_timer_sync(&ptr->timer);
          +       timer_shutdown_sync(&ptr->timer);
          )
            ... when strict
                when != ptr->timer
          (
                  kfree_rcu(ptr, rfield);
          |
                  kmem_cache_free(slab, ptr);
          |
                  kfree(ptr);
          )
      
          $ spatch timer.cocci . > /tmp/t.patch
          $ patch -p1 < /tmp/t.patch
      
      Link: https://lore.kernel.org/lkml/20221123201306.823305113@linutronix.de/Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
      Acked-by: Pavel Machek <pavel@ucw.cz> [ LED ]
      Acked-by: Kalle Valo <kvalo@kernel.org> [ wireless ]
      Acked-by: Paolo Abeni <pabeni@redhat.com> [ networking ]
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      292a089d
  13. 23 Dec, 2022 14 commits
    • Linus Torvalds's avatar
      Merge tag 'spi-fix-v6.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi · 72a85e2b
      Linus Torvalds authored
      Pull spi fix from Mark Brown:
       "One driver specific change here which handles the case where a SPI
        device for some reason tries to change the bus speed during a message
        on fsl_spi hardware, this should be very unusual"
      
      * tag 'spi-fix-v6.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi:
        spi: fsl_spi: Don't change speed while chipselect is active
      72a85e2b
    • Linus Torvalds's avatar
      Merge tag 'regulator-fix-v6.2-rc1' of... · 0a023cbb
      Linus Torvalds authored
      Merge tag 'regulator-fix-v6.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator
      
      Pull regulator fixes from Mark Brown:
       "Two core fixes here, one for a long standing race which some Qualcomm
        systems have started triggering with their UFS driver and another
        fixing a problem with supply lookup introduced by the fixes for devm
        related use after free issues that were introduced in this merge
        window"
      
      * tag 'regulator-fix-v6.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator:
        regulator: core: fix deadlock on regulator enable
        regulator: core: Fix resolve supply lookup issue
      0a023cbb
    • Linus Torvalds's avatar
      Merge tag 'coccinelle-6.2' of git://git.kernel.org/pub/scm/linux/kernel/git/jlawall/linux · 2c91ce92
      Linus Torvalds authored
      Pull coccicheck update from Julia Lawall:
       "Modernize use of grep in coccicheck:
      
        Use 'grep -E' instead of 'egrep'"
      
      * tag 'coccinelle-6.2' of git://git.kernel.org/pub/scm/linux/kernel/git/jlawall/linux:
        scripts: coccicheck: use "grep -E" instead of "egrep"
      2c91ce92
    • Linus Torvalds's avatar
      Merge tag 'hardening-v6.2-rc1-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux · 51094a24
      Linus Torvalds authored
      Pull kernel hardening fixes from Kees Cook:
      
       - Fix CFI failure with KASAN (Sami Tolvanen)
      
       - Fix LKDTM + CFI under GCC 7 and 8 (Kristina Martsenko)
      
       - Limit CONFIG_ZERO_CALL_USED_REGS to Clang > 15.0.6 (Nathan
         Chancellor)
      
       - Ignore "contents" argument in LoadPin's LSM hook handling
      
       - Fix paste-o in /sys/kernel/warn_count API docs
      
       - Use READ_ONCE() consistently for oops/warn limit reading
      
      * tag 'hardening-v6.2-rc1-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
        cfi: Fix CFI failure with KASAN
        exit: Use READ_ONCE() for all oops/warn limit reads
        security: Restrict CONFIG_ZERO_CALL_USED_REGS to gcc or clang > 15.0.6
        lkdtm: cfi: Make PAC test work with GCC 7 and 8
        docs: Fix path paste-o for /sys/kernel/warn_count
        LoadPin: Ignore the "contents" argument of the LSM hooks
      51094a24
    • Linus Torvalds's avatar
      Merge tag 'pstore-v6.2-rc1-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux · edb23125
      Linus Torvalds authored
      Pull pstore fixes from Kees Cook:
      
       - Switch pmsg_lock to an rt_mutex to avoid priority inversion (John
         Stultz)
      
       - Correctly assign mem_type property (Luca Stefani)
      
      * tag 'pstore-v6.2-rc1-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
        pstore: Properly assign mem_type property
        pstore: Make sure CONFIG_PSTORE_PMSG selects CONFIG_RT_MUTEXES
        pstore: Switch pmsg_lock to an rt_mutex to avoid priority inversion
      edb23125
    • Linus Torvalds's avatar
      Merge tag 'dma-mapping-2022-12-23' of git://git.infradead.org/users/hch/dma-mapping · 59d2c635
      Linus Torvalds authored
      Pull dma-mapping fixes from Christoph Hellwig:
       "Fix up the sound code to not pass __GFP_COMP to the non-coherent DMA
        allocator, as it copes with that just as badly as the coherent
        allocator, and then add a check to make sure no one passes the flag
        ever again"
      
      * tag 'dma-mapping-2022-12-23' of git://git.infradead.org/users/hch/dma-mapping:
        dma-mapping: reject GFP_COMP for noncoherent allocations
        ALSA: memalloc: don't use GFP_COMP for non-coherent dma allocations
      59d2c635
    • Linus Torvalds's avatar
      Merge tag '9p-for-6.2-rc1' of https://github.com/martinetd/linux · e3b862ed
      Linus Torvalds authored
      Pull 9p updates from Dominique Martinet:
      
       - improve p9_check_errors to check buffer size instead of msize when
         possible (e.g. not zero-copy)
      
       - some more syzbot and KCSAN fixes
      
       - minor headers include cleanup
      
      * tag '9p-for-6.2-rc1' of https://github.com/martinetd/linux:
        9p/client: fix data race on req->status
        net/9p: fix response size check in p9_check_errors()
        net/9p: distinguish zero-copy requests
        9p/xen: do not memcpy header into req->rc
        9p: set req refcount to zero to avoid uninitialized usage
        9p/net: Remove unneeded idr.h #include
        9p/fs: Remove unneeded idr.h #include
      e3b862ed
    • Linus Torvalds's avatar
      Merge tag 'sound-6.2-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound · a27405b2
      Linus Torvalds authored
      Pull more sound updates from Takashi Iwai:
       "A few more updates for 6.2: most of changes are about ASoC
        device-specific fixes.
      
         - Lots of ASoC Intel AVS extensions and refactoring
      
         - Quirks for ASoC Intel SOF as well as regression fixes
      
         - ASoC Mediatek and Rockchip fixes
      
         - Intel HD-audio HDMI workarounds
      
         - Usual HD- and USB-audio device-specific quirks"
      
      * tag 'sound-6.2-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (54 commits)
        ALSA: usb-audio: Add new quirk FIXED_RATE for JBL Quantum810 Wireless
        ALSA: azt3328: Remove the unused function snd_azf3328_codec_outl()
        ASoC: lochnagar: Fix unused lochnagar_of_match warning
        ASoC: Intel: Add HP Stream 8 to bytcr_rt5640.c
        ASoC: SOF: mediatek: initialize panic_info to zero
        ASoC: rt5670: Remove unbalanced pm_runtime_put()
        ASoC: Intel: bytcr_rt5640: Add quirk for the Advantech MICA-071 tablet
        ASoC: Intel: soc-acpi: update codec addr on 0C11/0C4F product
        ASoC: rockchip: spdif: Add missing clk_disable_unprepare() in rk_spdif_runtime_resume()
        ASoC: wm8994: Fix potential deadlock
        ASoC: mediatek: mt8195: add sof be ops to check audio active
        ASoC: SOF: Revert: "core: unregister clients and machine drivers in .shutdown"
        ASoC: SOF: Intel: pci-tgl: unblock S5 entry if DMA stop has failed"
        ALSA: hda/hdmi: fix stream-id config keep-alive for rt suspend
        ALSA: hda/hdmi: set default audio parameters for KAE silent-stream
        ALSA: hda/hdmi: fix i915 silent stream programming flow
        ALSA: hda: Error out if invalid stream is being setup
        ASoC: dt-bindings: fsl-sai: Reinstate i.MX93 SAI compatible string
        ASoC: soc-pcm.c: Clear DAIs parameters after stream_active is updated
        ASoC: codecs: wcd-clsh: Remove the unused function
        ...
      a27405b2
    • Linus Torvalds's avatar
      Merge tag 'drm-next-2022-12-23' of git://anongit.freedesktop.org/drm/drm · 55c7d6a9
      Linus Torvalds authored
      Pull drm fixes from Dave Airlie:
       "Holiday fixes!
      
        Two batches from amd, and one group of i915 changes.
      
        amdgpu:
         - Spelling fix
         - BO pin fix
         - Properly handle polaris 10/11 overlap asics
         - GMC9 fix
         - SR-IOV suspend fix
         - DCN 3.1.4 fix
         - KFD userptr locking fix
         - SMU13.x fixes
         - GDS/GWS/OA handling fix
         - Reserved VMID handling fixes
         - FRU EEPROM fix
         - BO validation fixes
         - Avoid large variable on the stack
         - S0ix fixes
         - SMU 13.x fixes
         - VCN fix
         - Add missing fence reference
      
        amdkfd:
         - Fix init vm error handling
         - Fix double release of compute pasid
      
        i915
         - Documentation fixes
         - OA-perf related fix
         - VLV/CHV HDMI/DP audio fix
         - Display DDI/Transcoder fix
         - Migrate fixes"
      
      * tag 'drm-next-2022-12-23' of git://anongit.freedesktop.org/drm/drm: (39 commits)
        drm/amdgpu: grab extra fence reference for drm_sched_job_add_dependency
        drm/amdgpu: enable VCN DPG for GC IP v11.0.4
        drm/amdgpu: skip mes self test after s0i3 resume for MES IP v11.0
        drm/amd/pm: correct the fan speed retrieving in PWM for some SMU13 asics
        drm/amd/pm: bump SMU13.0.0 driver_if header to version 0x34
        drm/amdgpu: skip MES for S0ix as well since it's part of GFX
        drm/amd/pm: avoid large variable on kernel stack
        drm/amdkfd: Fix double release compute pasid
        drm/amdkfd: Fix kfd_process_device_init_vm error handling
        drm/amd/pm: update SMU13.0.0 reported maximum shader clock
        drm/amd/pm: correct SMU13.0.0 pstate profiling clock settings
        drm/amd/pm: enable GPO dynamic control support for SMU13.0.7
        drm/amd/pm: enable GPO dynamic control support for SMU13.0.0
        drm/amdgpu: revert "generally allow over-commit during BO allocation"
        drm/amdgpu: Remove unnecessary domain argument
        drm/amdgpu: Fix size validation for non-exclusive domains (v4)
        drm/amdgpu: Check if fru_addr is not NULL (v2)
        drm/i915/ttm: consider CCS for backup objects
        drm/i915/migrate: fix corner case in CCS aux copying
        drm/amdgpu: rework reserved VMID handling
        ...
      55c7d6a9
    • Linus Torvalds's avatar
      Merge tag 'mips_6.2_1' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux · 06d65a6f
      Linus Torvalds authored
      Pull MIPS fixes from Thomas Bogendoerfer:
       "Fixes due to DT changes"
      
      * tag 'mips_6.2_1' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux:
        MIPS: dts: bcm63268: Add missing properties to the TWD node
        MIPS: ralink: mt7621: avoid to init common ralink reset controller
      06d65a6f
    • Linus Torvalds's avatar
      Merge tag 'mm-hotfixes-stable-2022-12-22-14-34' of... · 699aee7b
      Linus Torvalds authored
      Merge tag 'mm-hotfixes-stable-2022-12-22-14-34' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
      
      Pull hotfixes from Andrew Morton:
       "Eight fixes, all cc:stable. One is for gcov and the remainder are MM"
      
      * tag 'mm-hotfixes-stable-2022-12-22-14-34' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm:
        gcov: add support for checksum field
        test_maple_tree: add test for mas_spanning_rebalance() on insufficient data
        maple_tree: fix mas_spanning_rebalance() on insufficient data
        hugetlb: really allocate vma lock for all sharable vmas
        kmsan: export kmsan_handle_urb
        kmsan: include linux/vmalloc.h
        mm/mempolicy: fix memory leak in set_mempolicy_home_node system call
        mm, mremap: fix mremap() expanding vma with addr inside vma
      699aee7b
    • Luca Stefani's avatar
      pstore: Properly assign mem_type property · beca3e31
      Luca Stefani authored
      If mem-type is specified in the device tree
      it would end up overriding the record_size
      field instead of populating mem_type.
      
      As record_size is currently parsed after the
      improper assignment with default size 0 it
      continued to work as expected regardless of the
      value found in the device tree.
      
      Simply changing the target field of the struct
      is enough to get mem-type working as expected.
      
      Fixes: 9d843e8f ("pstore: Add mem_type property DT parsing support")
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarLuca Stefani <luca@osomprivacy.com>
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      Link: https://lore.kernel.org/r/20221222131049.286288-1-luca@osomprivacy.com
      beca3e31
    • John Stultz's avatar
      pstore: Make sure CONFIG_PSTORE_PMSG selects CONFIG_RT_MUTEXES · 2f4fec59
      John Stultz authored
      In commit 76d62f24 ("pstore: Switch pmsg_lock to an rt_mutex
      to avoid priority inversion") I changed a lock to an rt_mutex.
      
      However, its possible that CONFIG_RT_MUTEXES is not enabled,
      which then results in a build failure, as the 0day bot detected:
        https://lore.kernel.org/linux-mm/202212211244.TwzWZD3H-lkp@intel.com/
      
      Thus this patch changes CONFIG_PSTORE_PMSG to select
      CONFIG_RT_MUTEXES, which ensures the build will not fail.
      
      Cc: Wei Wang <wvw@google.com>
      Cc: Midas Chien<midaschieh@google.com>
      Cc: Connor O'Brien <connoro@google.com>
      Cc: Kees Cook <keescook@chromium.org>
      Cc: Anton Vorontsov <anton@enomsg.org>
      Cc: Colin Cross <ccross@android.com>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: kernel test robot <lkp@intel.com>
      Cc: kernel-team@android.com
      Fixes: 76d62f24 ("pstore: Switch pmsg_lock to an rt_mutex to avoid priority inversion")
      Reported-by: default avatarkernel test robot <lkp@intel.com>
      Signed-off-by: default avatarJohn Stultz <jstultz@google.com>
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      Link: https://lore.kernel.org/r/20221221051855.15761-1-jstultz@google.com
      2f4fec59
    • Sami Tolvanen's avatar
      cfi: Fix CFI failure with KASAN · cf801640
      Sami Tolvanen authored
      When CFI_CLANG and KASAN are both enabled, LLVM doesn't generate a
      CFI type hash for asan.module_ctor functions in translation units
      where CFI is disabled, which leads to a CFI failure during boot when
      do_ctors calls the affected constructors:
      
        CFI failure at do_basic_setup+0x64/0x90 (target:
        asan.module_ctor+0x0/0x28; expected type: 0xa540670c)
      
      Specifically, this happens because CFI is disabled for
      kernel/cfi.c. There's no reason to keep CFI disabled here anymore, so
      fix the failure by not filtering out CC_FLAGS_CFI for the file.
      
      Note that https://reviews.llvm.org/rG3b14862f0a96 fixed the issue
      where LLVM didn't emit CFI type hashes for any sanitizer constructors,
      but now type hashes are emitted correctly for TUs that use CFI.
      
      Link: https://github.com/ClangBuiltLinux/linux/issues/1742
      Fixes: 89245600 ("cfi: Switch to -fsanitize=kcfi")
      Reported-by: default avatarMark Rutland <mark.rutland@arm.com>
      Signed-off-by: default avatarSami Tolvanen <samitolvanen@google.com>
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      Link: https://lore.kernel.org/r/20221222225747.3538676-1-samitolvanen@google.com
      cf801640