1. 18 Dec, 2023 18 commits
  2. 17 Dec, 2023 10 commits
  3. 16 Dec, 2023 3 commits
    • Linus Torvalds's avatar
      Merge tag 'trace-v6.7-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace · 3b8a9b2e
      Linus Torvalds authored
      Pull tracing fixes from Steven Rostedt:
      
       - Fix eventfs to check creating new files for events with names greater
         than NAME_MAX. The eventfs lookup needs to check the return result of
         simple_lookup().
      
       - Fix the ring buffer to check the proper max data size. Events must be
         able to fit on the ring buffer sub-buffer, if it cannot, then it
         fails to be written and the logic to add the event is avoided. The
         code to check if an event can fit failed to add the possible absolute
         timestamp which may make the event not be able to fit. This causes
         the ring buffer to go into an infinite loop trying to find a
         sub-buffer that would fit the event. Luckily, there's a check that
         will bail out if it looped over a 1000 times and it also warns.
      
         The real fix is not to add the absolute timestamp to an event that is
         starting at the beginning of a sub-buffer because it uses the
         sub-buffer timestamp.
      
         By avoiding the timestamp at the start of the sub-buffer allows
         events that pass the first check to always find a sub-buffer that it
         can fit on.
      
       - Have large events that do not fit on a trace_seq to print "LINE TOO
         BIG" like it does for the trace_pipe instead of what it does now
         which is to silently drop the output.
      
       - Fix a memory leak of forgetting to free the spare page that is saved
         by a trace instance.
      
       - Update the size of the snapshot buffer when the main buffer is
         updated if the snapshot buffer is allocated.
      
       - Fix ring buffer timestamp logic by removing all the places that tried
         to put the before_stamp back to the write stamp so that the next
         event doesn't add an absolute timestamp. But each of these updates
         added a race where by making the two timestamp equal, it was
         validating the write_stamp so that it can be incorrectly used for
         calculating the delta of an event.
      
       - There's a temp buffer used for printing the event that was using the
         event data size for allocation when it needed to use the size of the
         entire event (meta-data and payload data)
      
       - For hardening, use "%.*s" for printing the trace_marker output, to
         limit the amount that is printed by the size of the event. This was
         discovered by development that added a bug that truncated the '\0'
         and caused a crash.
      
       - Fix a use-after-free bug in the use of the histogram files when an
         instance is being removed.
      
       - Remove a useless update in the rb_try_to_discard of the write_stamp.
         The before_stamp was already changed to force the next event to add
         an absolute timestamp that the write_stamp is not used. But the
         write_stamp is modified again using an unneeded 64-bit cmpxchg.
      
       - Fix several races in the 32-bit implementation of the
         rb_time_cmpxchg() that does a 64-bit cmpxchg.
      
       - While looking at fixing the 64-bit cmpxchg, I noticed that because
         the ring buffer uses normal cmpxchg, and this can be done in NMI
         context, there's some architectures that do not have a working
         cmpxchg in NMI context. For these architectures, fail recording
         events that happen in NMI context.
      
      * tag 'trace-v6.7-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace:
        ring-buffer: Do not record in NMI if the arch does not support cmpxchg in NMI
        ring-buffer: Have rb_time_cmpxchg() set the msb counter too
        ring-buffer: Fix 32-bit rb_time_read() race with rb_time_cmpxchg()
        ring-buffer: Fix a race in rb_time_cmpxchg() for 32 bit archs
        ring-buffer: Remove useless update to write_stamp in rb_try_to_discard()
        ring-buffer: Do not try to put back write_stamp
        tracing: Fix uaf issue when open the hist or hist_debug file
        tracing: Add size check when printing trace_marker output
        ring-buffer: Have saved event hold the entire event
        ring-buffer: Do not update before stamp when switching sub-buffers
        tracing: Update snapshot buffer on resize if it is allocated
        ring-buffer: Fix memory leak of free page
        eventfs: Fix events beyond NAME_MAX blocking tasks
        tracing: Have large events show up as '[LINE TOO BIG]' instead of nothing
        ring-buffer: Fix writing to the buffer with max_data_size
      3b8a9b2e
    • Linus Torvalds's avatar
      Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux · c8e97fc6
      Linus Torvalds authored
      Pull arm64 fixes from Catalin Marinas:
      
       - Arm CMN perf: fix the DTC allocation failure path which can end up
         erroneously clearing live counters
      
       - arm64/mm: fix hugetlb handling of the dirty page state leading to a
         continuous fault loop in user on hardware without dirty bit
         management (DBM). That's caused by the dirty+writeable information
         not being properly preserved across a series of mprotect(PROT_NONE),
         mprotect(PROT_READ|PROT_WRITE)
      
      * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
        arm64: mm: Always make sw-dirty PTEs hw-dirty in pte_modify
        perf/arm-cmn: Fail DTC counter allocation correctly
      c8e97fc6
    • Linus Torvalds's avatar
      Merge tag 'pci-v6.7-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pci/pci · 2e3f280b
      Linus Torvalds authored
      Pull pci fixes from Bjorn Helgaas:
      
       - Limit Max_Read_Request_Size (MRRS) on some MIPS Loongson systems
         because they don't all support MRRS > 256, and firmware doesn't
         always initialize it correctly, which meant some PCIe devices didn't
         work (Jiaxun Yang)
      
       - Add and use pci_enable_link_state_locked() to prevent potential
         deadlocks in vmd and qcom drivers (Johan Hovold)
      
       - Revert recent (v6.5) acpiphp resource assignment changes that fixed
         issues with hot-adding devices on a root bus or with large BARs, but
         introduced new issues with GPU initialization and hot-adding SCSI
         disks in QEMU VMs and (Bjorn Helgaas)
      
      * tag 'pci-v6.7-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pci/pci:
        Revert "PCI: acpiphp: Reassign resources on bridge if necessary"
        PCI/ASPM: Add pci_disable_link_state_locked() lockdep assert
        PCI/ASPM: Clean up __pci_disable_link_state() 'sem' parameter
        PCI: qcom: Clean up ASPM comment
        PCI: qcom: Fix potential deadlock when enabling ASPM
        PCI: vmd: Fix potential deadlock when enabling ASPM
        PCI/ASPM: Add pci_enable_link_state_locked()
        PCI: loongson: Limit MRRS to 256
      2e3f280b
  4. 15 Dec, 2023 9 commits
    • Josef Bacik's avatar
      btrfs: do not allow non subvolume root targets for snapshot · a8892fd7
      Josef Bacik authored
      Our btrfs subvolume snapshot <source> <destination> utility enforces
      that <source> is the root of the subvolume, however this isn't enforced
      in the kernel.  Update the kernel to also enforce this limitation to
      avoid problems with other users of this ioctl that don't have the
      appropriate checks in place.
      Reported-by: default avatarMartin Michaelis <code@mgjm.de>
      CC: stable@vger.kernel.org # 4.14+
      Reviewed-by: default avatarNeal Gompa <neal@gompa.dev>
      Signed-off-by: default avatarJosef Bacik <josef@toxicpanda.com>
      Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
      Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
      a8892fd7
    • Jens Axboe's avatar
      cred: get rid of CONFIG_DEBUG_CREDENTIALS · ae191417
      Jens Axboe authored
      This code is rarely (never?) enabled by distros, and it hasn't caught
      anything in decades. Let's kill off this legacy debug code.
      Suggested-by: default avatarLinus Torvalds <torvalds@linuxfoundation.org>
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      ae191417
    • Jens Axboe's avatar
      cred: switch to using atomic_long_t · f8fa5d76
      Jens Axboe authored
      There are multiple ways to grab references to credentials, and the only
      protection we have against overflowing it is the memory required to do
      so.
      
      With memory sizes only moving in one direction, let's bump the reference
      count to 64-bit and move it outside the realm of feasibly overflowing.
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      f8fa5d76
    • Bjorn Helgaas's avatar
      Revert "PCI: acpiphp: Reassign resources on bridge if necessary" · 5df12742
      Bjorn Helgaas authored
      This reverts commit 40613da5 and the
      subsequent fix to it:
      
        cc22522f ("PCI: acpiphp: Use pci_assign_unassigned_bridge_resources() only for non-root bus")
      
      40613da5 fixed a problem where hot-adding a device with large BARs
      failed if the bridge windows programmed by firmware were not large enough.
      
      cc22522f ("PCI: acpiphp: Use pci_assign_unassigned_bridge_resources()
      only for non-root bus") fixed a problem with 40613da5: an ACPI hot-add
      of a device on a PCI root bus (common in the virt world) or firmware
      sending ACPI Bus Check to non-existent Root Ports (e.g., on Dell Inspiron
      7352/0W6WV0) caused a NULL pointer dereference and suspend/resume hangs.
      
      Unfortunately the combination of 40613da5 and cc22522f caused other
      problems:
      
        - Fiona reported that hot-add of SCSI disks in QEMU virtual machine fails
          sometimes.
      
        - Dongli reported a similar problem with hot-add of SCSI disks.
      
        - Jonathan reported a console freeze during boot on bare metal due to an
          error in radeon GPU initialization.
      
      Revert both patches to avoid adding these problems.  This means we will
      again see the problems with hot-adding devices with large BARs and the NULL
      pointer dereferences and suspend/resume issues that 40613da5 and
      cc22522f were intended to fix.
      
      Fixes: 40613da5 ("PCI: acpiphp: Reassign resources on bridge if necessary")
      Fixes: cc22522f ("PCI: acpiphp: Use pci_assign_unassigned_bridge_resources() only for non-root bus")
      Reported-by: default avatarFiona Ebner <f.ebner@proxmox.com>
      Closes: https://lore.kernel.org/r/9eb669c0-d8f2-431d-a700-6da13053ae54@proxmox.comReported-by: default avatarDongli Zhang <dongli.zhang@oracle.com>
      Closes: https://lore.kernel.org/r/3c4a446a-b167-11b8-f36f-d3c1b49b42e9@oracle.comReported-by: default avatarJonathan Woithe <jwoithe@just42.net>
      Closes: https://lore.kernel.org/r/ZXpaNCLiDM+Kv38H@marvin.atrad.com.auSigned-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      Acked-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      Acked-by: default avatarIgor Mammedov <imammedo@redhat.com>
      Cc: <stable@vger.kernel.org>
      5df12742
    • Linus Torvalds's avatar
      Merge tag 'io_uring-6.7-2023-12-15' of git://git.kernel.dk/linux · 3bd7d748
      Linus Torvalds authored
      Pull io_uring fixes from Jens Axboe:
       "Just two minor fixes:
      
         - Fix for the io_uring socket option commands using the wrong value
           on some archs (Al)
      
         - Tweak to the poll lazy wake enable (me)"
      
      * tag 'io_uring-6.7-2023-12-15' of git://git.kernel.dk/linux:
        io_uring/cmd: fix breakage in SOCKET_URING_OP_SIOC* implementation
        io_uring/poll: don't enable lazy wake for POLLEXCLUSIVE
      3bd7d748
    • Linus Torvalds's avatar
      Merge tag 'mm-hotfixes-stable-2023-12-15-07-11' of... · a62aa88b
      Linus Torvalds authored
      Merge tag 'mm-hotfixes-stable-2023-12-15-07-11' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
      
      Pull misc fixes from Andrew Morton:
       "17 hotfixes. 8 are cc:stable and the other 9 pertain to post-6.6
        issues"
      
      * tag 'mm-hotfixes-stable-2023-12-15-07-11' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm:
        mm/mglru: reclaim offlined memcgs harder
        mm/mglru: respect min_ttl_ms with memcgs
        mm/mglru: try to stop at high watermarks
        mm/mglru: fix underprotected page cache
        mm/shmem: fix race in shmem_undo_range w/THP
        Revert "selftests: error out if kernel header files are not yet built"
        crash_core: fix the check for whether crashkernel is from high memory
        x86, kexec: fix the wrong ifdeffery CONFIG_KEXEC
        sh, kexec: fix the incorrect ifdeffery and dependency of CONFIG_KEXEC
        mips, kexec: fix the incorrect ifdeffery and dependency of CONFIG_KEXEC
        m68k, kexec: fix the incorrect ifdeffery and build dependency of CONFIG_KEXEC
        loongarch, kexec: change dependency of object files
        mm/damon/core: make damon_start() waits until kdamond_fn() starts
        selftests/mm: cow: print ksft header before printing anything else
        mm: fix VMA heap bounds checking
        riscv: fix VMALLOC_START definition
        kexec: drop dependency on ARCH_SUPPORTS_KEXEC from CRASH_DUMP
      a62aa88b
    • Linus Torvalds's avatar
      Merge tag 'sound-6.7-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound · 26e7a301
      Linus Torvalds authored
      Pull sound fixes from Takashi Iwai:
       "A collection of HD-audio quirks for TAS2781 codec and device-specific
        workarounds"
      
      * tag 'sound-6.7-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
        ALSA: hda/tas2781: reset the amp before component_add
        ALSA: hda/tas2781: call cleanup functions only once
        ALSA: hda/tas2781: handle missing EFI calibration data
        ALSA: hda/tas2781: leave hda_component in usable state
        ALSA: hda/realtek: Apply mute LED quirk for HP15-db
        ALSA: hda/hdmi: add force-connect quirks for ASUSTeK Z170 variants
        ALSA: hda/hdmi: add force-connect quirk for NUC5CPYB
      26e7a301
    • Linus Torvalds's avatar
      Merge tag 'drm-fixes-2023-12-15' of git://anongit.freedesktop.org/drm/drm · 595609b2
      Linus Torvalds authored
      Pull drm fixes from Dave Airlie:
       "More regular fixes, amdgpu, i915, mediatek and nouveau are most of
        them this week. Nothing too major, then a few misc bits and pieces in
        core, panel and ivpu.
      
        drm:
         - fix uninit problems in crtc
         - fix fd ownership check
         - edid: add modes in fallback paths
      
        panel:
         - move LG panel into DSI yaml
         - ltk050h3146w: set burst mode
      
        mediatek:
         - mtk_disp_gamma: Fix breakage due to merge issue
         - fix kernel oops if no crtc is found
         - Add spinlock for setting vblank event in atomic_begin
         - Fix access violation in mtk_drm_crtc_dma_dev_get
      
        i915:
         - Fix selftest engine reset count storage for multi-tile
         - Fix out-of-bounds reads for engine reset counts
         - Fix ADL+ remapped stride with CCS
         - Fix intel_atomic_setup_scalers() plane_state handling
         - Fix ADL+ tiled plane stride when the POT stride is smaller than the original
         - Fix eDP 1.4 rate select method link configuration
      
        amdgpu:
         - Fix suspend fix that got accidently mangled last week
         - Fix OD regression
         - PSR fixes
         - OLED Backlight regression fix
         - JPEG 4.0.5 fix
         - Misc display fixes
         - SDMA 5.2 fix
         - SDMA 2.4 regression fix
         - GPUVM race fix
      
        nouveau:
         - fix gk20a instobj hierarchy
         - fix headless iors inheritance regression
      
        ivpu:
         - fix WA initialisation"
      
      * tag 'drm-fixes-2023-12-15' of git://anongit.freedesktop.org/drm/drm: (31 commits)
        drm/nouveau/kms/nv50-: Don't allow inheritance of headless iors
        drm/nouveau: Fixup gk20a instobj hierarchy
        drm/amdgpu: warn when there are still mappings when a BO is destroyed v2
        drm/amdgpu: fix tear down order in amdgpu_vm_pt_free
        drm/amd: Fix a probing order problem on SDMA 2.4
        drm/amdgpu/sdma5.2: add begin/end_use ring callbacks
        drm/panel: ltk050h3146w: Set burst mode for ltk050h3148w
        dt-bindings: panel-simple-dsi: move LG 5" HD TFT LCD panel into DSI yaml
        drm/amd/display: Disable PSR-SU on Parade 0803 TCON again
        drm/amd/display: Populate dtbclk from bounding box
        drm/amd/display: Revert "Fix conversions between bytes and KB"
        drm/amdgpu/jpeg: configure doorbell for each playback
        drm/amd/display: Restore guard against default backlight value < 1 nit
        drm/amd/display: fix hw rotated modes when PSR-SU is enabled
        drm/amd/pm: fix pp_*clk_od typo
        drm/amdgpu: fix buffer funcs setting order on suspend harder
        drm/mediatek: Fix access violation in mtk_drm_crtc_dma_dev_get
        drm/edid: also call add modes in EDID connector update fallback
        drm/i915/edp: don't write to DP_LINK_BW_SET when using rate select
        drm/i915: Fix ADL+ tiled plane stride when the POT stride is smaller than the original
        ...
      595609b2
    • Steven Rostedt (Google)'s avatar
      ring-buffer: Do not record in NMI if the arch does not support cmpxchg in NMI · 71229230
      Steven Rostedt (Google) authored
      As the ring buffer recording requires cmpxchg() to work, if the
      architecture does not support cmpxchg in NMI, then do not do any recording
      within an NMI.
      
      Link: https://lore.kernel.org/linux-trace-kernel/20231213175403.6fc18540@gandalf.local.home
      
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
      Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
      71229230