1. 13 Jan, 2023 4 commits
    • Miaoqian Lin's avatar
      iommu: Fix refcount leak in iommu_device_claim_dma_owner · a6a9a5da
      Miaoqian Lin authored
      iommu_group_get() returns the group with the reference incremented.
      Move iommu_group_get() after owner check to fix the refcount leak.
      
      Fixes: 89395cce ("iommu: Add device-centric DMA ownership interfaces")
      Signed-off-by: default avatarMiaoqian Lin <linmq006@gmail.com>
      Reviewed-by: default avatarLu Baolu <baolu.lu@linux.intel.com>
      Reviewed-by: default avatarJason Gunthorpe <jgg@nvidia.com>
      Link: https://lore.kernel.org/r/20221230083100.1489569-1-linmq006@gmail.com
      [ joro: Remove *group = NULL initialization ]
      Signed-off-by: default avatarJoerg Roedel <jroedel@suse.de>
      a6a9a5da
    • Vladimir Oltean's avatar
      iommu/arm-smmu-v3: Don't unregister on shutdown · 32ea2c57
      Vladimir Oltean authored
      Similar to SMMUv2, this driver calls iommu_device_unregister() from the
      shutdown path, which removes the IOMMU groups with no coordination
      whatsoever with their users - shutdown methods are optional in device
      drivers. This can lead to NULL pointer dereferences in those drivers'
      DMA API calls, or worse.
      
      Instead of calling the full arm_smmu_device_remove() from
      arm_smmu_device_shutdown(), let's pick only the relevant function call -
      arm_smmu_device_disable() - more or less the reverse of
      arm_smmu_device_reset() - and call just that from the shutdown path.
      
      Fixes: 57365a04 ("iommu: Move bus setup to IOMMU device registration")
      Suggested-by: default avatarRobin Murphy <robin.murphy@arm.com>
      Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Link: https://lore.kernel.org/r/20221215141251.3688780-2-vladimir.oltean@nxp.comSigned-off-by: default avatarWill Deacon <will@kernel.org>
      32ea2c57
    • Vladimir Oltean's avatar
      iommu/arm-smmu: Don't unregister on shutdown · ce31e6ca
      Vladimir Oltean authored
      Michael Walle says he noticed the following stack trace while performing
      a shutdown with "reboot -f". He suggests he got "lucky" and just hit the
      correct spot for the reboot while there was a packet transmission in
      flight.
      
      Unable to handle kernel NULL pointer dereference at virtual address 0000000000000098
      CPU: 0 PID: 23 Comm: kworker/0:1 Not tainted 6.1.0-rc5-00088-gf3600ff8e322 #1930
      Hardware name: Kontron KBox A-230-LS (DT)
      pc : iommu_get_dma_domain+0x14/0x20
      lr : iommu_dma_map_page+0x9c/0x254
      Call trace:
       iommu_get_dma_domain+0x14/0x20
       dma_map_page_attrs+0x1ec/0x250
       enetc_start_xmit+0x14c/0x10b0
       enetc_xmit+0x60/0xdc
       dev_hard_start_xmit+0xb8/0x210
       sch_direct_xmit+0x11c/0x420
       __dev_queue_xmit+0x354/0xb20
       ip6_finish_output2+0x280/0x5b0
       __ip6_finish_output+0x15c/0x270
       ip6_output+0x78/0x15c
       NF_HOOK.constprop.0+0x50/0xd0
       mld_sendpack+0x1bc/0x320
       mld_ifc_work+0x1d8/0x4dc
       process_one_work+0x1e8/0x460
       worker_thread+0x178/0x534
       kthread+0xe0/0xe4
       ret_from_fork+0x10/0x20
      Code: d503201f f9416800 d503233f d50323bf (f9404c00)
      ---[ end trace 0000000000000000 ]---
      Kernel panic - not syncing: Oops: Fatal exception in interrupt
      
      This appears to be reproducible when the board has a fixed IP address,
      is ping flooded from another host, and "reboot -f" is used.
      
      The following is one more manifestation of the issue:
      
      $ reboot -f
      kvm: exiting hardware virtualization
      cfg80211: failed to load regulatory.db
      arm-smmu 5000000.iommu: disabling translation
      sdhci-esdhc 2140000.mmc: Removing from iommu group 11
      sdhci-esdhc 2150000.mmc: Removing from iommu group 12
      fsl-edma 22c0000.dma-controller: Removing from iommu group 17
      dwc3 3100000.usb: Removing from iommu group 9
      dwc3 3110000.usb: Removing from iommu group 10
      ahci-qoriq 3200000.sata: Removing from iommu group 2
      fsl-qdma 8380000.dma-controller: Removing from iommu group 20
      platform f080000.display: Removing from iommu group 0
      etnaviv-gpu f0c0000.gpu: Removing from iommu group 1
      etnaviv etnaviv: Removing from iommu group 1
      caam_jr 8010000.jr: Removing from iommu group 13
      caam_jr 8020000.jr: Removing from iommu group 14
      caam_jr 8030000.jr: Removing from iommu group 15
      caam_jr 8040000.jr: Removing from iommu group 16
      fsl_enetc 0000:00:00.0: Removing from iommu group 4
      arm-smmu 5000000.iommu: Blocked unknown Stream ID 0x429; boot with "arm-smmu.disable_bypass=0" to allow, but this may have security implications
      arm-smmu 5000000.iommu:         GFSR 0x80000002, GFSYNR0 0x00000002, GFSYNR1 0x00000429, GFSYNR2 0x00000000
      fsl_enetc 0000:00:00.1: Removing from iommu group 5
      arm-smmu 5000000.iommu: Blocked unknown Stream ID 0x429; boot with "arm-smmu.disable_bypass=0" to allow, but this may have security implications
      arm-smmu 5000000.iommu:         GFSR 0x80000002, GFSYNR0 0x00000002, GFSYNR1 0x00000429, GFSYNR2 0x00000000
      arm-smmu 5000000.iommu: Blocked unknown Stream ID 0x429; boot with "arm-smmu.disable_bypass=0" to allow, but this may have security implications
      arm-smmu 5000000.iommu:         GFSR 0x80000002, GFSYNR0 0x00000000, GFSYNR1 0x00000429, GFSYNR2 0x00000000
      fsl_enetc 0000:00:00.2: Removing from iommu group 6
      fsl_enetc_mdio 0000:00:00.3: Removing from iommu group 8
      mscc_felix 0000:00:00.5: Removing from iommu group 3
      fsl_enetc 0000:00:00.6: Removing from iommu group 7
      pcieport 0001:00:00.0: Removing from iommu group 18
      arm-smmu 5000000.iommu: Blocked unknown Stream ID 0x429; boot with "arm-smmu.disable_bypass=0" to allow, but this may have security implications
      arm-smmu 5000000.iommu:         GFSR 0x00000002, GFSYNR0 0x00000000, GFSYNR1 0x00000429, GFSYNR2 0x00000000
      pcieport 0002:00:00.0: Removing from iommu group 19
      Unable to handle kernel NULL pointer dereference at virtual address 00000000000000a8
      pc : iommu_get_dma_domain+0x14/0x20
      lr : iommu_dma_unmap_page+0x38/0xe0
      Call trace:
       iommu_get_dma_domain+0x14/0x20
       dma_unmap_page_attrs+0x38/0x1d0
       enetc_unmap_tx_buff.isra.0+0x6c/0x80
       enetc_poll+0x170/0x910
       __napi_poll+0x40/0x1e0
       net_rx_action+0x164/0x37c
       __do_softirq+0x128/0x368
       run_ksoftirqd+0x68/0x90
       smpboot_thread_fn+0x14c/0x190
      Code: d503201f f9416800 d503233f d50323bf (f9405400)
      ---[ end trace 0000000000000000 ]---
      Kernel panic - not syncing: Oops: Fatal exception in interrupt
      ---[ end Kernel panic - not syncing: Oops: Fatal exception in interrupt ]---
      
      The problem seems to be that iommu_group_remove_device() is allowed to
      run with no coordination whatsoever with the shutdown procedure of the
      enetc PCI device. In fact, it almost seems as if it implies that the
      pci_driver :: shutdown() method is mandatory if DMA is used with an
      IOMMU, otherwise this is inevitable. That was never the case; shutdown
      methods are optional in device drivers.
      
      This is the call stack that leads to iommu_group_remove_device() during
      reboot:
      
      kernel_restart
      -> device_shutdown
         -> platform_shutdown
            -> arm_smmu_device_shutdown
               -> arm_smmu_device_remove
                  -> iommu_device_unregister
                     -> bus_for_each_dev
                        -> remove_iommu_group
                           -> iommu_release_device
                              -> iommu_group_remove_device
      
      I don't know much about the arm_smmu driver, but
      arm_smmu_device_shutdown() invoking arm_smmu_device_remove() looks
      suspicious, since it causes the IOMMU device to unregister and that's
      where everything starts to unravel. It forces all other devices which
      depend on IOMMU groups to also point their ->shutdown() to ->remove(),
      which will make reboot slower overall.
      
      There are 2 moments relevant to this behavior. First was commit
      b06c076e ("Revert "iommu/arm-smmu: Make arm-smmu explicitly
      non-modular"") when arm_smmu_device_shutdown() was made to run the exact
      same thing as arm_smmu_device_remove(). Prior to that, there was no
      iommu_device_unregister() call in arm_smmu_device_shutdown(). However,
      that was benign until commit 57365a04 ("iommu: Move bus setup to
      IOMMU device registration"), which made iommu_device_unregister() call
      remove_iommu_group().
      
      Restore the old shutdown behavior by making remove() call shutdown(),
      but shutdown() does not call the remove() specific bits.
      
      Fixes: 57365a04 ("iommu: Move bus setup to IOMMU device registration")
      Reported-by: default avatarMichael Walle <michael@walle.cc>
      Tested-by: Michael Walle <michael@walle.cc> # on kontron-sl28
      Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Link: https://lore.kernel.org/r/20221215141251.3688780-1-vladimir.oltean@nxp.comSigned-off-by: default avatarWill Deacon <will@kernel.org>
      ce31e6ca
    • Robin Murphy's avatar
      iommu/arm-smmu: Report IOMMU_CAP_CACHE_COHERENCY even betterer · ac9c5e92
      Robin Murphy authored
      Although it's vanishingly unlikely that anyone would integrate an SMMU
      within a coherent interconnect without also making the pagetable walk
      interface coherent, the same effect happens if a coherent SMMU fails to
      advertise CTTW correctly. This turns out to be the case on some popular
      NXP SoCs, where VFIO started failing the IOMMU_CAP_CACHE_COHERENCY test,
      even though IOMMU_CACHE *was* previously achieving the desired effect
      anyway thanks to the underlying integration.
      
      While those SoCs stand to gain some more general benefits from a
      firmware update to override CTTW correctly in DT/ACPI, it's also easy
      to work around this in Linux as well, to avoid imposing too much on
      affected users - since the upstream client devices *are* correctly
      marked as coherent, we can trivially infer their coherent paths through
      the SMMU as well.
      Reported-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Fixes: df198b37 ("iommu/arm-smmu: Report IOMMU_CAP_CACHE_COHERENCY better")
      Signed-off-by: default avatarRobin Murphy <robin.murphy@arm.com>
      Tested-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Link: https://lore.kernel.org/r/d6dc41952961e5c7b21acac08a8bf1eb0f69e124.1671123115.git.robin.murphy@arm.comSigned-off-by: default avatarWill Deacon <will@kernel.org>
      ac9c5e92
  2. 08 Jan, 2023 3 commits
  3. 07 Jan, 2023 6 commits
  4. 06 Jan, 2023 19 commits
    • Linus Torvalds's avatar
      Merge tag 'drm-fixes-2023-01-06' of git://anongit.freedesktop.org/drm/drm · 0a715535
      Linus Torvalds authored
      Pull drm fixes from Daniel Vetter:
       "Still not much, but more than last week. Dave should be back next week
        from the beaching.
      
        drivers:
         - i915-gvt fixes
         - amdgpu/kfd fixes
         - panfrost bo refcounting fix
         - meson afbc corruption fix
         - imx plane width fix
      
        core:
         - drm/sched fixes
         - drm/mm kunit test fix
         - dma-buf export error handling fixes"
      
      * tag 'drm-fixes-2023-01-06' of git://anongit.freedesktop.org/drm/drm:
        Revert "drm/amd/display: Enable Freesync Video Mode by default"
        drm/i915/gvt: fix double free bug in split_2MB_gtt_entry
        drm/i915/gvt: use atomic operations to change the vGPU status
        drm/i915/gvt: fix vgpu debugfs clean in remove
        drm/i915/gvt: fix gvt debugfs destroy
        drm/i915: unpin on error in intel_vgpu_shadow_mm_pin()
        drm/amd/display: Uninitialized variables causing 4k60 UCLK to stay at DPM1 and not DPM0
        drm/amdkfd: Fix kernel warning during topology setup
        drm/scheduler: Fix lockup in drm_sched_entity_kill()
        drm/imx: ipuv3-plane: Fix overlay plane width
        drm/scheduler: Fix lockup in drm_sched_entity_kill()
        drm/virtio: Fix memory leak in virtio_gpu_object_create()
        drm/meson: Reduce the FIFO lines held when AFBC is not used
        drm/tests: reduce drm_mm_test stack usage
        drm/panfrost: Fix GEM handle creation ref-counting
        drm/plane-helper: Add the missing declaration of drm_atomic_state
        dma-buf: fix dma_buf_export init order v2
      0a715535
    • Jason A. Donenfeld's avatar
      tpm: Allow system suspend to continue when TPM suspend fails · 1382999a
      Jason A. Donenfeld authored
      TPM 1 is sometimes broken across system suspends, due to races or
      locking issues or something else that haven't been diagnosed or fixed
      yet, most likely having to do with concurrent reads from the TPM's
      hardware random number generator driver. These issues prevent the system
      from actually suspending, with errors like:
      
        tpm tpm0: A TPM error (28) occurred continue selftest
        ...
        tpm tpm0: A TPM error (28) occurred attempting get random
        ...
        tpm tpm0: Error (28) sending savestate before suspend
        tpm_tis 00:08: PM: __pnp_bus_suspend(): tpm_pm_suspend+0x0/0x80 returns 28
        tpm_tis 00:08: PM: dpm_run_callback(): pnp_bus_suspend+0x0/0x10 returns 28
        tpm_tis 00:08: PM: failed to suspend: error 28
        PM: Some devices failed to suspend, or early wake event detected
      
      This issue was partially fixed by 23393c64 ("char: tpm: Protect
      tpm_pm_suspend with locks"), in a last minute 6.1 commit that Linus took
      directly because the TPM maintainers weren't available. However, it
      seems like this just addresses the most common cases of the bug, rather
      than addressing it entirely. So there are more things to fix still,
      apparently.
      
      In lieu of actually fixing the underlying bug, just allow system suspend
      to continue, so that laptops still go to sleep fine. Later, this can be
      reverted when the real bug is fixed.
      
      Link: https://lore.kernel.org/lkml/7cbe96cf-e0b5-ba63-d1b4-f63d2e826efa@suse.cz/
      Cc: stable@vger.kernel.org # 6.1+
      Reported-by: default avatarVlastimil Babka <vbabka@suse.cz>
      Suggested-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Acked-by: default avatarLuigi Semenzato <semenzato@chromium.org>
      Cc: Peter Huewe <peterhuewe@gmx.de>
      Cc: Jarkko Sakkinen <jarkko@kernel.org>
      Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
      Cc: Johannes Altmanninger <aclopte@gmail.com>
      Signed-off-by: default avatarJason A. Donenfeld <Jason@zx2c4.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      1382999a
    • Linus Torvalds's avatar
      hfs/hfsplus: avoid WARN_ON() for sanity check, use proper error handling · cb7a95af
      Linus Torvalds authored
      Commit 55d1cbbb ("hfs/hfsplus: use WARN_ON for sanity check") fixed
      a build warning by turning a comment into a WARN_ON(), but it turns out
      that syzbot then complains because it can trigger said warning with a
      corrupted hfs image.
      
      The warning actually does warn about a bad situation, but we are much
      better off just handling it as the error it is.  So rather than warn
      about us doing bad things, stop doing the bad things and return -EIO.
      
      While at it, also fix a memory leak that was introduced by an earlier
      fix for a similar syzbot warning situation, and add a check for one case
      that historically wasn't handled at all (ie neither comment nor
      subsequent WARN_ON).
      
      Reported-by: syzbot+7bb7cd3595533513a9e7@syzkaller.appspotmail.com
      Fixes: 55d1cbbb ("hfs/hfsplus: use WARN_ON for sanity check")
      Fixes: 8d824e69 ("hfs: fix OOB Read in __hfs_brec_find")
      Link: https://lore.kernel.org/lkml/000000000000dbce4e05f170f289@google.com/Tested-by: default avatarMichael Schmitz <schmitzmic@gmail.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Matthew Wilcox <willy@infradead.org>
      Cc: Viacheslav Dubeyko <slava@dubeyko.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      cb7a95af
    • Linus Torvalds's avatar
      Merge tag 'block-2023-01-06' of git://git.kernel.dk/linux · a689b938
      Linus Torvalds authored
      Pull block fixes from Jens Axboe:
       "The big change here is obviously the revert of the pktcdvd driver
        removal. Outside of that, just minor tweaks. In detail:
      
         - Re-instate the pktcdvd driver, which necessitates adding back
           bio_copy_data_iter() and the fops->devnode() hook for now (me)
      
         - Fix for splitting of a bio marked as NOWAIT, causing either nowait
           reads or writes to error with EAGAIN even if parts of the IO
           completed (me)
      
         - Fix for ublk, punting management commands to io-wq as they can all
           easily block for extended periods of time (Ming)
      
         - Removal of SRCU dependency for the block layer (Paul)"
      
      * tag 'block-2023-01-06' of git://git.kernel.dk/linux:
        block: Remove "select SRCU"
        Revert "pktcdvd: remove driver."
        Revert "block: remove devnode callback from struct block_device_operations"
        Revert "block: bio_copy_data_iter"
        ublk: honor IO_URING_F_NONBLOCK for handling control command
        block: don't allow splitting of a REQ_NOWAIT bio
        block: handle bio_split_to_limits() NULL return
      a689b938
    • Linus Torvalds's avatar
      Merge tag 'io_uring-2023-01-06' of git://git.kernel.dk/linux · ef1a4a77
      Linus Torvalds authored
      Pull io_uring fixes from Jens Axboe:
       "A few minor fixes that should go into the 6.2 release:
      
         - Fix for a memory leak in io-wq worker creation, if we ultimately
           end up canceling the worker creation before it gets created (me)
      
         - lockdep annotations for the CQ locking (Pavel)
      
         - A regression fix for CQ timeout handling (Pavel)
      
         - Ring pinning around deferred task_work fix (Pavel)
      
         - A trivial member move in struct io_ring_ctx, saving us some memory
           (me)"
      
      * tag 'io_uring-2023-01-06' of git://git.kernel.dk/linux:
        io_uring: fix CQ waiting timeout handling
        io_uring: move 'poll_multi_queue' bool in io_ring_ctx
        io_uring: lockdep annotate CQ locking
        io_uring: pin context while queueing deferred tw
        io_uring/io-wq: free worker if task_work creation is canceled
      ef1a4a77
    • Linus Torvalds's avatar
      Merge tag 'tif-notify-signal-2023-01-06' of git://git.kernel.dk/linux · 93387d49
      Linus Torvalds authored
      Pull arm TIF_NOTIFY_SIGNAL fixup from Jens Axboe:
       "Hui Tang reported a performance regressions with _TIF_WORK_MASK in
        newer kernels, which he tracked to a change that went into 5.11. After
        this change, we'll call do_work_pending() more often than we need to,
        because we're now testing bits 0..15 rather than just 0..7.
      
        Shuffle the bits around to avoid this"
      
      * tag 'tif-notify-signal-2023-01-06' of git://git.kernel.dk/linux:
        ARM: renumber bits related to _TIF_WORK_MASK
      93387d49
    • Linus Torvalds's avatar
      Merge tag 'ceph-for-6.2-rc3' of https://github.com/ceph/ceph-client · 5c1a712f
      Linus Torvalds authored
      Pull ceph fixes from Ilya Dryomov:
       "Two file locking fixes from Xiubo"
      
      * tag 'ceph-for-6.2-rc3' of https://github.com/ceph/ceph-client:
        ceph: avoid use-after-free in ceph_fl_release_lock()
        ceph: switch to vfs_inode_has_locks() to fix file lock bug
      5c1a712f
    • Linus Torvalds's avatar
      Merge tag 'fixes_for_v6.2-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs · 7b8c854c
      Linus Torvalds authored
      Pull UDF fixes from Jan Kara:
       "Two fixups of the UDF changes that went into 6.2-rc1"
      
      * tag 'fixes_for_v6.2-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
        udf: initialize newblock to 0
        udf: Fix extension of the last extent in the file
      7b8c854c
    • Linus Torvalds's avatar
      Merge tag 'for-6.2-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux · fc7b76c4
      Linus Torvalds authored
      Pull btrfs fixes from David Sterba:
       "A few more regression and regular fixes:
      
         - regressions:
             - fix assertion condition using = instead of ==
             - fix false alert on bad tree level check
             - fix off-by-one error in delalloc search during lseek
      
         - fix compat ro feature check at read-write remount
      
         - handle case when read-repair happens with ongoing device replace
      
         - updated error messages"
      
      * tag 'for-6.2-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux:
        btrfs: fix compat_ro checks against remount
        btrfs: always report error in run_one_delayed_ref()
        btrfs: handle case when repair happens with dev-replace
        btrfs: fix off-by-one in delalloc search during lseek
        btrfs: fix false alert on bad tree level check
        btrfs: add error message for metadata level mismatch
        btrfs: fix ASSERT em->len condition in btrfs_get_extent
      fc7b76c4
    • Linus Torvalds's avatar
      Merge tag 'riscv-for-linus-6.2-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux · a389e546
      Linus Torvalds authored
      Pull RISC-V fixes from Palmer Dabbelt:
      
       - use the correct mask for c.jr/c.jalr when decoding instructions
      
       - build fix for get_user() to avoid a sparse warning
      
      * tag 'riscv-for-linus-6.2-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux:
        riscv: uaccess: fix type of 0 variable on error in get_user()
        riscv, kprobes: Stricter c.jr/c.jalr decoding
      a389e546
    • Linus Torvalds's avatar
      Merge tag 'perf-tools-fixes-for-v6.2-1-2023-01-06' of... · 56f81458
      Linus Torvalds authored
      Merge tag 'perf-tools-fixes-for-v6.2-1-2023-01-06' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux
      
      Pull perf tools fixes from Arnaldo Carvalho de Melo:
      
       - Fix segfault when trying to process tracepoints present in a
         perf.data file and not linked with libtraceevent.
      
       - Fix build on uClibc systems by adding missing sys/types.h include,
         that was being obtained indirectly which stopped being the case when
         tools/lib/traceevent was removed.
      
       - Don't show commands in 'perf help' that depend on linking with
         libtraceevent when not building with that library, which is now a
         possibility since we no longer ship a copy in tools/lib/traceevent.
      
       - Fix failure in 'perf test' entry testing the combination of 'perf
         probe' user space function + 'perf record' + 'perf script' where it
         expects a backtrace leading to glibc's inet_pton() from 'ping' that
         now happens more than once with glibc 2.35 for IPv6 addreses.
      
       - Fix for the inet_pton perf test on s/390 where
         'text_to_binary_address' now appears on the backtrace.
      
       - Fix build error on riscv due to missing header for 'struct
         perf_sample'.
      
       - Fix 'make -C tools perf_install' install variant by not propagating
         the 'subdir' to submakes for the 'install_headers' targets.
      
       - Fix handling of unsupported cgroup events when using BPF counters in
         'perf stat'.
      
       - Count all cgroups, not just the last one when using 'perf stat' and
         combining --for-each-cgroup with --bpf-counters.
      
         This makes the output using BPF counters match the output without
         using it, which was the intention all along, the output should be the
         same using --bpf-counters or not.
      
       - Fix 'perf lock contention' core dump related to not finding the
         "__sched_text_end" symbol on s/390.
      
       - Fix build failure when HEAD is signed: exclude the signature from the
         version string.
      
       - Add missing closedir() calls to in perf_data__open_dir(), plugging a
         fd leak.
      
      * tag 'perf-tools-fixes-for-v6.2-1-2023-01-06' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux:
        perf tools: Fix build on uClibc systems by adding missing sys/types.h include
        perf stat: Fix handling of --for-each-cgroup with --bpf-counters to match non BPF mode
        perf stat: Fix handling of unsupported cgroup events when using BPF counters
        perf test record_probe_libc_inet_pton: Fix test on s/390 where 'text_to_binary_address' now appears on the backtrace
        perf lock contention: Fix core dump related to not finding the "__sched_text_end" symbol on s/390
        perf build: Don't propagate subdir to submakes for install_headers
        perf test record_probe_libc_inet_pton: Fix failure due to extra inet_pton() backtrace in glibc >= 2.35
        perf tools: Fix segfault when trying to process tracepoints in perf.data and not linked with libtraceevent
        perf tools: Don't include signature in version strings
        perf help: Use HAVE_LIBTRACEEVENT to filter out unsupported commands
        perf tools riscv: Fix build error on riscv due to missing header for 'struct perf_sample'
        perf tools: Fix resources leak in perf_data__open_dir()
      56f81458
    • Linus Torvalds's avatar
      Merge tag 'perf-urgent-2023-01-06' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · d7a0853d
      Linus Torvalds authored
      Pull perf fix from Ingo Molnar:
       "Intel RAPL updates for new model IDs"
      
      * tag 'perf-urgent-2023-01-06' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        perf/x86/rapl: Add support for Intel Emerald Rapids
        perf/x86/rapl: Add support for Intel Meteor Lake
        perf/x86/rapl: Treat Tigerlake like Icelake
      d7a0853d
    • Linus Torvalds's avatar
      Merge tag 'v6.2-p2' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 · 90bc52c5
      Linus Torvalds authored
      Pull crypto fixes from Herbert Xu:
       "This fixes a CFI crash in arm64/sm4 as well as a regression in the
        caam driver"
      
      * tag 'v6.2-p2' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
        crypto: arm64/sm4 - fix possible crash with CFI enabled
        crypto: caam - fix CAAM io mem access in blob_gen
      90bc52c5
    • Thinh Nguyen's avatar
      usb: dwc3: gadget: Ignore End Transfer delay on teardown · c4e3ef56
      Thinh Nguyen authored
      If we delay sending End Transfer for Setup TRB to be prepared, we need
      to check if the End Transfer was in preparation for a driver
      teardown/soft-disconnect. In those cases, just send the End Transfer
      command without delay.
      
      In the case of soft-disconnect, there's a very small chance the command
      may not go through immediately. But should it happen, the Setup TRB will
      be prepared during the polling of the controller halted state, allowing
      the command to go through then.
      
      In the case of disabling endpoint due to reconfiguration (e.g.
      set_interface(alt-setting) or usb reset), then it's driven by the host.
      Typically the host wouldn't immediately cancel the control request and
      send another control transfer to trigger the End Transfer command
      timeout.
      
      Fixes: 4db0fbb6 ("usb: dwc3: gadget: Don't delay End Transfer on delayed_status")
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarThinh Nguyen <Thinh.Nguyen@synopsys.com>
      Link: https://lore.kernel.org/r/f1617a323e190b9cc408fb8b65456e32b5814113.1670546756.git.Thinh.Nguyen@synopsys.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c4e3ef56
    • Arnd Bergmann's avatar
      usb: dwc3: xilinx: include linux/gpio/consumer.h · e498a044
      Arnd Bergmann authored
      The newly added gpio consumer calls cause a build failure in configurations
      that fail to include the right header implicitly:
      
      drivers/usb/dwc3/dwc3-xilinx.c: In function 'dwc3_xlnx_init_zynqmp':
      drivers/usb/dwc3/dwc3-xilinx.c:207:22: error: implicit declaration of function 'devm_gpiod_get_optional'; did you mean 'devm_clk_get_optional'? [-Werror=implicit-function-declaration]
        207 |         reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW);
            |                      ^~~~~~~~~~~~~~~~~~~~~~~
            |                      devm_clk_get_optional
      
      Fixes: ca05b382 ("usb: dwc3: xilinx: Add gpio-reset support")
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Link: https://lore.kernel.org/r/20230103121755.956027-1-arnd@kernel.orgSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      e498a044
    • Tom Rix's avatar
      udf: initialize newblock to 0 · 23970a1c
      Tom Rix authored
      The clang build reports this error
      fs/udf/inode.c:805:6: error: variable 'newblock' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized]
              if (*err < 0)
                  ^~~~~~~~
      newblock is never set before error handling jump.
      Initialize newblock to 0 and remove redundant settings.
      
      Fixes: d8b39db5fab8 ("udf: Handle error when adding extent to a file")
      Reported-by: default avatarNathan Chancellor <nathan@kernel.org>
      Signed-off-by: default avatarTom Rix <trix@redhat.com>
      Signed-off-by: default avatarJan Kara <jack@suse.cz>
      Message-Id: <20221230175341.1629734-1-trix@redhat.com>
      23970a1c
    • Jan Kara's avatar
      udf: Fix extension of the last extent in the file · 83c7423d
      Jan Kara authored
      When extending the last extent in the file within the last block, we
      wrongly computed the length of the last extent. This is mostly a
      cosmetical problem since the extent does not contain any data and the
      length will be fixed up by following operations but still.
      
      Fixes: 1f3868f0 ("udf: Fix extending file within last block")
      Signed-off-by: default avatarJan Kara <jack@suse.cz>
      83c7423d
    • Daniel Vetter's avatar
      Merge tag 'drm-intel-fixes-2023-01-05' of... · 5193326c
      Daniel Vetter authored
      Merge tag 'drm-intel-fixes-2023-01-05' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes
      
      Only gvt-fixes:
           - debugfs fixes (Zhenyu)
           - fix up for vgpu status (Zhi)
           - double free fix in split_2MB_gtt_entry (Zheng)
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      From: Rodrigo Vivi <rodrigo.vivi@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/Y7cszBkLRvAy6uao@intel.com
      5193326c
    • Yang Yingliang's avatar
      usb: fotg210-udc: fix error return code in fotg210_udc_probe() · 1a5a23b9
      Yang Yingliang authored
      After commit  5f217ccd ("fotg210-udc: Support optional external PHY"),
      the error code is re-assigned to 0 in fotg210_udc_probe(), if allocate or
      map memory fails after the assignment, it can't return an error code. Set
      the error code to -ENOMEM to fix this problem.
      
      Fixes: 5f217ccd ("fotg210-udc: Support optional external PHY")
      Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
      Reviewed-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Link: https://lore.kernel.org/r/20221230065427.944586-1-yangyingliang@huawei.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      1a5a23b9
  5. 05 Jan, 2023 8 commits
    • Linus Torvalds's avatar
      Merge tag 'thermal-6.2-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · 1f5abbd7
      Linus Torvalds authored
      Pull thermal control fix from Rafael Wysocki:
       "Add a missing sysfs attribute to the int340x thermal driver (Srinivas
        Pandruvada)"
      
      * tag 'thermal-6.2-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        thermal: int340x: Add missing attribute for data rate base
      1f5abbd7
    • Linus Torvalds's avatar
      Merge tag 'net-6.2-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net · 50011c32
      Linus Torvalds authored
      Pull networking fixes from Jakub Kicinski:
       "Including fixes from bpf, wifi, and netfilter.
      
        Current release - regressions:
      
         - bpf: fix nullness propagation for reg to reg comparisons, avoid
           null-deref
      
         - inet: control sockets should not use current thread task_frag
      
         - bpf: always use maximal size for copy_array()
      
         - eth: bnxt_en: don't link netdev to a devlink port for VFs
      
        Current release - new code bugs:
      
         - rxrpc: fix a couple of potential use-after-frees
      
         - netfilter: conntrack: fix IPv6 exthdr error check
      
         - wifi: iwlwifi: fw: skip PPAG for JF, avoid FW crashes
      
         - eth: dsa: qca8k: various fixes for the in-band register access
      
         - eth: nfp: fix schedule in atomic context when sync mc address
      
         - eth: renesas: rswitch: fix getting mac address from device tree
      
         - mobile: ipa: use proper endpoint mask for suspend
      
        Previous releases - regressions:
      
         - tcp: add TIME_WAIT sockets in bhash2, fix regression caught by
           Jiri / python tests
      
         - net: tc: don't intepret cls results when asked to drop, fix
           oob-access
      
         - vrf: determine the dst using the original ifindex for multicast
      
         - eth: bnxt_en:
            - fix XDP RX path if BPF adjusted packet length
            - fix HDS (header placement) and jumbo thresholds for RX packets
      
         - eth: ice: xsk: do not use xdp_return_frame() on tx_buf->raw_buf,
           avoid memory corruptions
      
        Previous releases - always broken:
      
         - ulp: prevent ULP without clone op from entering the LISTEN status
      
         - veth: fix race with AF_XDP exposing old or uninitialized
           descriptors
      
         - bpf:
            - pull before calling skb_postpull_rcsum() (fix checksum support
              and avoid a WARN())
            - fix panic due to wrong pageattr of im->image (when livepatch and
              kretfunc coexist)
            - keep a reference to the mm, in case the task is dead
      
         - mptcp: fix deadlock in fastopen error path
      
         - netfilter:
            - nf_tables: perform type checking for existing sets
            - nf_tables: honor set timeout and garbage collection updates
            - ipset: fix hash:net,port,net hang with /0 subnet
            - ipset: avoid hung task warning when adding/deleting entries
      
         - selftests: net:
            - fix cmsg_so_mark.sh test hang on non-x86 systems
            - fix the arp_ndisc_evict_nocarrier test for IPv6
      
         - usb: rndis_host: secure rndis_query check against int overflow
      
         - eth: r8169: fix dmar pte write access during suspend/resume with
           WOL
      
         - eth: lan966x: fix configuration of the PCS
      
         - eth: sparx5: fix reading of the MAC address
      
         - eth: qed: allow sleep in qed_mcp_trace_dump()
      
         - eth: hns3:
            - fix interrupts re-initialization after VF FLR
            - fix handling of promisc when MAC addr table gets full
            - refine the handling for VF heartbeat
      
         - eth: mlx5:
            - properly handle ingress QinQ-tagged packets on VST
            - fix io_eq_size and event_eq_size params validation on big endian
            - fix RoCE setting at HCA level if not supported at all
            - don't turn CQE compression on by default for IPoIB
      
         - eth: ena:
            - fix toeplitz initial hash key value
            - account for the number of XDP-processed bytes in interface stats
            - fix rx_copybreak value update
      
        Misc:
      
         - ethtool: harden phy stat handling against buggy drivers
      
         - docs: netdev: convert maintainer's doc from FAQ to a normal
           document"
      
      * tag 'net-6.2-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (112 commits)
        caif: fix memory leak in cfctrl_linkup_request()
        inet: control sockets should not use current thread task_frag
        net/ulp: prevent ULP without clone op from entering the LISTEN status
        qed: allow sleep in qed_mcp_trace_dump()
        MAINTAINERS: Update maintainers for ptp_vmw driver
        usb: rndis_host: Secure rndis_query check against int overflow
        net: dpaa: Fix dtsec check for PCS availability
        octeontx2-pf: Fix lmtst ID used in aura free
        drivers/net/bonding/bond_3ad: return when there's no aggregator
        netfilter: ipset: Rework long task execution when adding/deleting entries
        netfilter: ipset: fix hash:net,port,net hang with /0 subnet
        net: sparx5: Fix reading of the MAC address
        vxlan: Fix memory leaks in error path
        net: sched: htb: fix htb_classify() kernel-doc
        net: sched: cbq: dont intepret cls results when asked to drop
        net: sched: atm: dont intepret cls results when asked to drop
        dt-bindings: net: marvell,orion-mdio: Fix examples
        dt-bindings: net: sun8i-emac: Add phy-supply property
        net: ipa: use proper endpoint mask for suspend
        selftests: net: return non-zero for failures reported in arp_ndisc_evict_nocarrier
        ...
      50011c32
    • Ben Dooks's avatar
      riscv: uaccess: fix type of 0 variable on error in get_user() · b9b916ae
      Ben Dooks authored
      If the get_user(x, ptr) has x as a pointer, then the setting
      of (x) = 0 is going to produce the following sparse warning,
      so fix this by forcing the type of 'x' when access_ok() fails.
      
      fs/aio.c:2073:21: warning: Using plain integer as NULL pointer
      Signed-off-by: default avatarBen Dooks <ben-linux@fluff.org>
      Reviewed-by: default avatarPalmer Dabbelt <palmer@rivosinc.com>
      Link: https://lore.kernel.org/r/20221229170545.718264-1-ben-linux@fluff.org
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarPalmer Dabbelt <palmer@rivosinc.com>
      b9b916ae
    • Björn Töpel's avatar
      riscv, kprobes: Stricter c.jr/c.jalr decoding · b2d473a6
      Björn Töpel authored
      In the compressed instruction extension, c.jr, c.jalr, c.mv, and c.add
      is encoded the following way (each instruction is 16b):
      
      ---+-+-----------+-----------+--
      100 0 rs1[4:0]!=0       00000 10 : c.jr
      100 1 rs1[4:0]!=0       00000 10 : c.jalr
      100 0  rd[4:0]!=0 rs2[4:0]!=0 10 : c.mv
      100 1  rd[4:0]!=0 rs2[4:0]!=0 10 : c.add
      
      The following logic is used to decode c.jr and c.jalr:
      
        insn & 0xf007 == 0x8002 => instruction is an c.jr
        insn & 0xf007 == 0x9002 => instruction is an c.jalr
      
      When 0xf007 is used to mask the instruction, c.mv can be incorrectly
      decoded as c.jr, and c.add as c.jalr.
      
      Correct the decoding by changing the mask from 0xf007 to 0xf07f.
      
      Fixes: c22b0bcb ("riscv: Add kprobes supported")
      Signed-off-by: default avatarBjörn Töpel <bjorn@rivosinc.com>
      Reviewed-by: default avatarConor Dooley <conor.dooley@microchip.com>
      Reviewed-by: default avatarGuo Ren <guoren@kernel.org>
      Link: https://lore.kernel.org/r/20230102160748.1307289-1-bjorn@kernel.org
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarPalmer Dabbelt <palmer@rivosinc.com>
      b2d473a6
    • Linus Torvalds's avatar
      Merge tag 'gpio-fixes-for-v6.2-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux · aa01a183
      Linus Torvalds authored
      Pull gpio fixes from Bartosz Golaszewski:
       "A reference leak fix, two fixes for using uninitialized variables and
        more drivers converted to using immutable irqchips:
      
         - fix a reference leak in gpio-sifive
      
         - fix a potential use of an uninitialized variable in core gpiolib
      
         - fix a potential use of an uninitialized variable in gpio-pca953x
      
         - make GPIO irqchips immutable in gpio-pmic-eic-sprd, gpio-eic-sprd
           and gpio-sprd"
      
      * tag 'gpio-fixes-for-v6.2-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux:
        gpio: sifive: Fix refcount leak in sifive_gpio_probe
        gpio: sprd: Make the irqchip immutable
        gpio: pmic-eic-sprd: Make the irqchip immutable
        gpio: eic-sprd: Make the irqchip immutable
        gpio: pca953x: avoid to use uninitialized value pinctrl
        gpiolib: Fix using uninitialized lookup-flags on ACPI platforms
      aa01a183
    • Yishai Hadas's avatar
      lib/scatterlist: Fix to merge contiguous pages into the last SG properly · e95d50d7
      Yishai Hadas authored
      When sg_alloc_append_table_from_pages() calls to pages_are_mergeable() in
      its 'sgt_append->prv' flow to check whether it can merge contiguous pages
      into the last SG, it passes the page arguments in the wrong order.
      
      The first parameter should be the next candidate page to be merged to
      the last page and not the opposite.
      
      The current code leads to a corrupted SG which resulted in OOPs and
      unexpected errors when non-contiguous pages are merged wrongly.
      
      Fix to pass the page parameters in the right order.
      
      Fixes: 1567b49d ("lib/scatterlist: add check when merging zone device pages")
      Link: https://lore.kernel.org/r/20230105112339.107969-1-yishaih@nvidia.comSigned-off-by: default avatarYishai Hadas <yishaih@nvidia.com>
      Reviewed-by: default avatarJason Gunthorpe <jgg@nvidia.com>
      Reviewed-by: default avatarLogan Gunthorpe <logang@deltatee.com>
      Signed-off-by: default avatarJason Gunthorpe <jgg@nvidia.com>
      e95d50d7
    • Linus Torvalds's avatar
      Merge tag 'fbdev-for-6.2-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev · 5e9af4b4
      Linus Torvalds authored
      Pull fbdev fixes from Helge Deller:
      
       - Fix Matrox G200eW initialization failure
      
       - Fix build failure of offb driver when built as module
      
       - Optimize stack usage in omapfb
      
      * tag 'fbdev-for-6.2-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev:
        fbdev: omapfb: avoid stack overflow warning
        fbdev: matroxfb: G200eW: Increase max memory from 1 MB to 16 MB
        fbdev: atyfb: use strscpy() to instead of strncpy()
        fbdev: omapfb: use strscpy() to instead of strncpy()
        fbdev: make offb driver tristate
      5e9af4b4
    • Paul E. McKenney's avatar
      block: Remove "select SRCU" · b2b50d57
      Paul E. McKenney authored
      Now that the SRCU Kconfig option is unconditionally selected, there is
      no longer any point in selecting it.  Therefore, remove the "select SRCU"
      Kconfig statements.
      Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: linux-block@vger.kernel.org
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      b2b50d57