1. 25 Oct, 2023 1 commit
  2. 24 Oct, 2023 3 commits
    • Linus Torvalds's avatar
      Merge tag 'mm-hotfixes-stable-2023-10-24-09-40' of... · 4f828701
      Linus Torvalds authored
      Merge tag 'mm-hotfixes-stable-2023-10-24-09-40' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
      
      Pull misc fixes from Andrew Morton:
       "20 hotfixes. 12 are cc:stable and the remainder address post-6.5
        issues or aren't considered necessary for earlier kernel versions"
      
      * tag 'mm-hotfixes-stable-2023-10-24-09-40' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm:
        maple_tree: add GFP_KERNEL to allocations in mas_expected_entries()
        selftests/mm: include mman header to access MREMAP_DONTUNMAP identifier
        mailmap: correct email aliasing for Oleksij Rempel
        mailmap: map Bartosz's old address to the current one
        mm/damon/sysfs: check DAMOS regions update progress from before_terminate()
        MAINTAINERS: Ondrej has moved
        kasan: disable kasan_non_canonical_hook() for HW tags
        kasan: print the original fault addr when access invalid shadow
        hugetlbfs: close race between MADV_DONTNEED and page fault
        hugetlbfs: extend hugetlb_vma_lock to private VMAs
        hugetlbfs: clear resv_map pointer if mmap fails
        mm: zswap: fix pool refcount bug around shrink_worker()
        mm/migrate: fix do_pages_move for compat pointers
        riscv: fix set_huge_pte_at() for NAPOT mappings when a swap entry is set
        riscv: handle VM_FAULT_[HWPOISON|HWPOISON_LARGE] faults instead of panicking
        mmap: fix error paths with dup_anon_vma()
        mmap: fix vma_iterator in error path of vma_merge()
        mm: fix vm_brk_flags() to not bail out while holding lock
        mm/mempolicy: fix set_mempolicy_home_node() previous VMA pointer
        mm/page_alloc: correct start page when guard page debug is enabled
      4f828701
    • Linus Torvalds's avatar
      Merge tag 'pull-nfsd-fix' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs · d88520ad
      Linus Torvalds authored
      Pull nfsd fix from Al Viro:
       "Catch from lock_rename() audit; nfsd_rename() checked that both
        directories belonged to the same filesystem, but only after having
        done lock_rename().
      
        Trivial fix, tested and acked by nfs folks"
      
      * tag 'pull-nfsd-fix' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
        nfsd: lock_rename() needs both directories to live on the same fs
      d88520ad
    • Linus Torvalds's avatar
      Merge tag 'urgent/nolibc.2023.10.16a' of... · 84186fcb
      Linus Torvalds authored
      Merge tag 'urgent/nolibc.2023.10.16a' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu
      
      Pull nolibc fixes from Paul McKenney:
      
       - tools/nolibc: i386: Fix a stack misalign bug on _start
      
       - MAINTAINERS: nolibc: update tree location
      
       - tools/nolibc: mark start_c as weak to avoid linker errors
      
      * tag 'urgent/nolibc.2023.10.16a' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu:
        tools/nolibc: mark start_c as weak
        MAINTAINERS: nolibc: update tree location
        tools/nolibc: i386: Fix a stack misalign bug on _start
      84186fcb
  3. 23 Oct, 2023 3 commits
    • Linus Torvalds's avatar
      Merge tag 'for-6.6-rc7-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux · e017769f
      Linus Torvalds authored
      Pull btrfs fix from David Sterba:
       "One more fix for a problem with snapshot of a newly created subvolume
        that can lead to inconsistent data under some circumstances. Kernel
        6.5 added a performance optimization to skip transaction commit for
        subvolume creation but this could end up with newer data on disk but
        not linked to other structures.
      
        The fix itself is an added condition, the rest of the patch is a
        parameter added to several functions"
      
      * tag 'for-6.6-rc7-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux:
        btrfs: fix unwritten extent buffer after snapshotting a new subvolume
      e017769f
    • Linus Torvalds's avatar
      Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost · 7c145640
      Linus Torvalds authored
      Pull virtio fixes from Michael Tsirkin:
       "A collection of small fixes that look like worth having in this
        release"
      
      * tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost:
        virtio_pci: fix the common cfg map size
        virtio-crypto: handle config changed by work queue
        vhost: Allow null msg.size on VHOST_IOTLB_INVALIDATE
        vdpa/mlx5: Fix firmware error on creation of 1k VQs
        virtio_balloon: Fix endless deflation and inflation on arm64
        vdpa/mlx5: Fix double release of debugfs entry
        virtio-mmio: fix memory leak of vm_dev
        vdpa_sim_blk: Fix the potential leak of mgmt_dev
        tools/virtio: Add dma sync api for virtio test
      7c145640
    • Filipe Manana's avatar
      btrfs: fix unwritten extent buffer after snapshotting a new subvolume · eb96e221
      Filipe Manana authored
      When creating a snapshot of a subvolume that was created in the current
      transaction, we can end up not persisting a dirty extent buffer that is
      referenced by the snapshot, resulting in IO errors due to checksum failures
      when trying to read the extent buffer later from disk. A sequence of steps
      that leads to this is the following:
      
      1) At ioctl.c:create_subvol() we allocate an extent buffer, with logical
         address 36007936, for the leaf/root of a new subvolume that has an ID
         of 291. We mark the extent buffer as dirty, and at this point the
         subvolume tree has a single node/leaf which is also its root (level 0);
      
      2) We no longer commit the transaction used to create the subvolume at
         create_subvol(). We used to, but that was recently removed in
         commit 1b53e51a ("btrfs: don't commit transaction for every subvol
         create");
      
      3) The transaction used to create the subvolume has an ID of 33, so the
         extent buffer 36007936 has a generation of 33;
      
      4) Several updates happen to subvolume 291 during transaction 33, several
         files created and its tree height changes from 0 to 1, so we end up with
         a new root at level 1 and the extent buffer 36007936 is now a leaf of
         that new root node, which is extent buffer 36048896.
      
         The commit root remains as 36007936, since we are still at transaction
         33;
      
      5) Creation of a snapshot of subvolume 291, with an ID of 292, starts at
         ioctl.c:create_snapshot(). This triggers a commit of transaction 33 and
         we end up at transaction.c:create_pending_snapshot(), in the critical
         section of a transaction commit.
      
         There we COW the root of subvolume 291, which is extent buffer 36048896.
         The COW operation returns extent buffer 36048896, since there's no need
         to COW because the extent buffer was created in this transaction and it
         was not written yet.
      
         The we call btrfs_copy_root() against the root node 36048896. During
         this operation we allocate a new extent buffer to turn into the root
         node of the snapshot, copy the contents of the root node 36048896 into
         this snapshot root extent buffer, set the owner to 292 (the ID of the
         snapshot), etc, and then we call btrfs_inc_ref(). This will create a
         delayed reference for each leaf pointed by the root node with a
         reference root of 292 - this includes a reference for the leaf
         36007936.
      
         After that we set the bit BTRFS_ROOT_FORCE_COW in the root's state.
      
         Then we call btrfs_insert_dir_item(), to create the directory entry in
         in the tree of subvolume 291 that points to the snapshot. This ends up
         needing to modify leaf 36007936 to insert the respective directory
         items. Because the bit BTRFS_ROOT_FORCE_COW is set for the root's state,
         we need to COW the leaf. We end up at btrfs_force_cow_block() and then
         at update_ref_for_cow().
      
         At update_ref_for_cow() we call btrfs_block_can_be_shared() which
         returns false, despite the fact the leaf 36007936 is shared - the
         subvolume's root and the snapshot's root point to that leaf. The
         reason that it incorrectly returns false is because the commit root
         of the subvolume is extent buffer 36007936 - it was the initial root
         of the subvolume when we created it. So btrfs_block_can_be_shared()
         which has the following logic:
      
         int btrfs_block_can_be_shared(struct btrfs_root *root,
                                       struct extent_buffer *buf)
         {
             if (test_bit(BTRFS_ROOT_SHAREABLE, &root->state) &&
                 buf != root->node && buf != root->commit_root &&
                 (btrfs_header_generation(buf) <=
                  btrfs_root_last_snapshot(&root->root_item) ||
                  btrfs_header_flag(buf, BTRFS_HEADER_FLAG_RELOC)))
                     return 1;
      
             return 0;
         }
      
         Returns false (0) since 'buf' (extent buffer 36007936) matches the
         root's commit root.
      
         As a result, at update_ref_for_cow(), we don't check for the number
         of references for extent buffer 36007936, we just assume it's not
         shared and therefore that it has only 1 reference, so we set the local
         variable 'refs' to 1.
      
         Later on, in the final if-else statement at update_ref_for_cow():
      
         static noinline int update_ref_for_cow(struct btrfs_trans_handle *trans,
                                                struct btrfs_root *root,
                                                struct extent_buffer *buf,
                                                struct extent_buffer *cow,
                                                int *last_ref)
         {
            (...)
            if (refs > 1) {
                (...)
            } else {
                (...)
                btrfs_clear_buffer_dirty(trans, buf);
                *last_ref = 1;
            }
         }
      
         So we mark the extent buffer 36007936 as not dirty, and as a result
         we don't write it to disk later in the transaction commit, despite the
         fact that the snapshot's root points to it.
      
         Attempting to access the leaf or dumping the tree for example shows
         that the extent buffer was not written:
      
         $ btrfs inspect-internal dump-tree -t 292 /dev/sdb
         btrfs-progs v6.2.2
         file tree key (292 ROOT_ITEM 33)
         node 36110336 level 1 items 2 free space 119 generation 33 owner 292
         node 36110336 flags 0x1(WRITTEN) backref revision 1
         checksum stored a8103e3e
         checksum calced a8103e3e
         fs uuid 90c9a46f-ae9f-4626-9aff-0cbf3e2e3a79
         chunk uuid e8c9c885-78f4-4d31-85fe-89e5f5fd4a07
                 key (256 INODE_ITEM 0) block 36007936 gen 33
                 key (257 EXTENT_DATA 0) block 36052992 gen 33
         checksum verify failed on 36007936 wanted 0x00000000 found 0x86005f29
         checksum verify failed on 36007936 wanted 0x00000000 found 0x86005f29
         total bytes 107374182400
         bytes used 38572032
         uuid 90c9a46f-ae9f-4626-9aff-0cbf3e2e3a79
      
         The respective on disk region is full of zeroes as the device was
         trimmed at mkfs time.
      
         Obviously 'btrfs check' also detects and complains about this:
      
         $ btrfs check /dev/sdb
         Opening filesystem to check...
         Checking filesystem on /dev/sdb
         UUID: 90c9a46f-ae9f-4626-9aff-0cbf3e2e3a79
         generation: 33 (33)
         [1/7] checking root items
         [2/7] checking extents
         checksum verify failed on 36007936 wanted 0x00000000 found 0x86005f29
         checksum verify failed on 36007936 wanted 0x00000000 found 0x86005f29
         checksum verify failed on 36007936 wanted 0x00000000 found 0x86005f29
         bad tree block 36007936, bytenr mismatch, want=36007936, have=0
         owner ref check failed [36007936 4096]
         ERROR: errors found in extent allocation tree or chunk allocation
         [3/7] checking free space tree
         [4/7] checking fs roots
         checksum verify failed on 36007936 wanted 0x00000000 found 0x86005f29
         checksum verify failed on 36007936 wanted 0x00000000 found 0x86005f29
         checksum verify failed on 36007936 wanted 0x00000000 found 0x86005f29
         bad tree block 36007936, bytenr mismatch, want=36007936, have=0
         The following tree block(s) is corrupted in tree 292:
              tree block bytenr: 36110336, level: 1, node key: (256, 1, 0)
         root 292 root dir 256 not found
         ERROR: errors found in fs roots
         found 38572032 bytes used, error(s) found
         total csum bytes: 16048
         total tree bytes: 1265664
         total fs tree bytes: 1118208
         total extent tree bytes: 65536
         btree space waste bytes: 562598
         file data blocks allocated: 65978368
          referenced 36569088
      
      Fix this by updating btrfs_block_can_be_shared() to consider that an
      extent buffer may be shared if it matches the commit root and if its
      generation matches the current transaction's generation.
      
      This can be reproduced with the following script:
      
         $ cat test.sh
         #!/bin/bash
      
         MNT=/mnt/sdi
         DEV=/dev/sdi
      
         # Use a filesystem with a 64K node size so that we have the same node
         # size on every machine regardless of its page size (on x86_64 default
         # node size is 16K due to the 4K page size, while on PPC it's 64K by
         # default). This way we can make sure we are able to create a btree for
         # the subvolume with a height of 2.
         mkfs.btrfs -f -n 64K $DEV
         mount $DEV $MNT
      
         btrfs subvolume create $MNT/subvol
      
         # Create a few empty files on the subvolume, this bumps its btree
         # height to 2 (root node at level 1 and 2 leaves).
         for ((i = 1; i <= 300; i++)); do
             echo -n > $MNT/subvol/file_$i
         done
      
         btrfs subvolume snapshot -r $MNT/subvol $MNT/subvol/snap
      
         umount $DEV
      
         btrfs check $DEV
      
      Running it on a 6.5 kernel (or any 6.6-rc kernel at the moment):
      
         $ ./test.sh
         Create subvolume '/mnt/sdi/subvol'
         Create a readonly snapshot of '/mnt/sdi/subvol' in '/mnt/sdi/subvol/snap'
         Opening filesystem to check...
         Checking filesystem on /dev/sdi
         UUID: bbdde2ff-7d02-45ca-8a73-3c36f23755a1
         [1/7] checking root items
         [2/7] checking extents
         parent transid verify failed on 30539776 wanted 7 found 5
         parent transid verify failed on 30539776 wanted 7 found 5
         parent transid verify failed on 30539776 wanted 7 found 5
         Ignoring transid failure
         owner ref check failed [30539776 65536]
         ERROR: errors found in extent allocation tree or chunk allocation
         [3/7] checking free space tree
         [4/7] checking fs roots
         parent transid verify failed on 30539776 wanted 7 found 5
         Ignoring transid failure
         Wrong key of child node/leaf, wanted: (256, 1, 0), have: (2, 132, 0)
         Wrong generation of child node/leaf, wanted: 5, have: 7
         root 257 root dir 256 not found
         ERROR: errors found in fs roots
         found 917504 bytes used, error(s) found
         total csum bytes: 0
         total tree bytes: 851968
         total fs tree bytes: 393216
         total extent tree bytes: 65536
         btree space waste bytes: 736550
         file data blocks allocated: 0
          referenced 0
      
      A test case for fstests will follow soon.
      
      Fixes: 1b53e51a ("btrfs: don't commit transaction for every subvol create")
      CC: stable@vger.kernel.org # 6.5+
      Reviewed-by: default avatarJosef Bacik <josef@toxicpanda.com>
      Signed-off-by: default avatarFilipe Manana <fdmanana@suse.com>
      Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
      eb96e221
  4. 22 Oct, 2023 5 commits
    • Linus Torvalds's avatar
      Linux 6.6-rc7 · 05d3ef8b
      Linus Torvalds authored
      05d3ef8b
    • Linus Torvalds's avatar
      Merge tag 'phy-fixes-6.6' of git://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy · fe3cfe86
      Linus Torvalds authored
      Pull phy fixes from Vinod Koul:
      
       - mapphone-mdm6600 runtime pm & pinctrl handling fixes
      
       - Qualcomm qmp usb pcs register fixes, qmp pcie register size warning
         fix, m31 fixes for wrong pointer in PTR_ERR and dropping wrong vreg
         check, qmp combo fix for 8550 power config register
      
       - realtek usb fix for debugfs_create_dir() and kconfig dependency
      
      * tag 'phy-fixes-6.6' of git://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy:
        phy: realtek: Realtek PHYs should depend on ARCH_REALTEK
        phy: qualcomm: Fix typos in comments
        phy: qcom-qmp-combo: initialize PCS_USB registers
        phy: qcom-qmp-combo: Square out 8550 POWER_STATE_CONFIG1
        phy: qcom: m31: Remove unwanted qphy->vreg is NULL check
        phy: realtek: usb: Drop unnecessary error check for debugfs_create_dir()
        phy: qcom: phy-qcom-m31: change m31_ipq5332_regs to static
        phy: qcom: phy-qcom-m31: fix wrong pointer pass to PTR_ERR()
        dt-bindings: phy: qcom,ipq8074-qmp-pcie: fix warning regarding reg size
        phy: qcom-qmp-usb: split PCS_USB init table for sc8280xp and sa8775p
        phy: qcom-qmp-usb: initialize PCS_USB registers
        phy: mapphone-mdm6600: Fix pinctrl_pm handling for sleep pins
        phy: mapphone-mdm6600: Fix runtime PM for remove
        phy: mapphone-mdm6600: Fix runtime disable on probe
      fe3cfe86
    • Linus Torvalds's avatar
      Merge tag 'efi-fixes-for-v6.6-3' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi · 70e65afc
      Linus Torvalds authored
      Pull EFI fixes from Ard Biesheuvel:
       "The boot_params pointer fix uses a somewhat ugly extern struct
        declaration but this will be cleaned up the next cycle.
      
         - don't try to print warnings to the console when it is no longer
           available
      
         - fix theoretical memory leak in SSDT override handling
      
         - make sure that the boot_params global variable is set before the
           KASLR code attempts to hash it for 'randomness'
      
         - avoid soft lockups in the memory acceptance code"
      
      * tag 'efi-fixes-for-v6.6-3' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi:
        efi/unaccepted: Fix soft lockups caused by parallel memory acceptance
        x86/boot: efistub: Assign global boot_params variable
        efi: fix memory leak in krealloc failure handling
        x86/efistub: Don't try to print after ExitBootService()
      70e65afc
    • Xiang Chen's avatar
      ACPI: NFIT: Install Notify() handler before getting NFIT table · 9b311b73
      Xiang Chen authored
      If there is no NFIT at startup, it will return 0 immediately in function
      acpi_nfit_add() and will not install Notify() handler. If hotplugging
      a nvdimm device later, it will not be identified as there is no Notify()
      handler.
      
      Install the handler before getting NFI table in function acpi_nfit_add()
      to avoid above issue.
      
      Fixes: dcca12ab ("ACPI: NFIT: Install Notify() handler directly")
      Signed-off-by: default avatarXiang Chen <chenxiang66@hisilicon.com>
      [ rjw: Subject and changelog edits ]
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      9b311b73
    • Linus Torvalds's avatar
      Merge tag 'powerpc-6.6-5' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux · 1acfd2bd
      Linus Torvalds authored
      Pull powerpc fixes from Michael Ellerman:
      
       - Fix stale propagated yield_cpu in qspinlocks leading to lockups
      
       - Fix broken hugepages on some configs due to ARCH_FORCE_MAX_ORDER
      
       - Fix a spurious warning when copros are in use at exit time
      
      Thanks to Nicholas Piggin, Christophe Leroy, Nysal Jan K.A Sachin Sant,
      and Shrikanth Hegde.
      
      * tag 'powerpc-6.6-5' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
        powerpc/qspinlock: Fix stale propagated yield_cpu
        powerpc/64s/radix: Don't warn on copros in radix__tlb_flush()
        powerpc/mm: Allow ARCH_FORCE_MAX_ORDER up to 12
      1acfd2bd
  5. 21 Oct, 2023 10 commits
  6. 20 Oct, 2023 18 commits
    • Linus Torvalds's avatar
      Merge tag 'perf-tools-fixes-for-v6.6-2-2023-10-20' of... · 9c5d00cb
      Linus Torvalds authored
      Merge tag 'perf-tools-fixes-for-v6.6-2-2023-10-20' of git://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools
      
      Pull perf tools fixes from Arnaldo Carvalho de Melo:
      
       - Fix regression in reading scale and unit files from sysfs for PMU
         events, so that we can use that info to pretty print instead of
         printing raw numbers:
      
           # perf stat -e power/energy-ram/,power/energy-gpu/ sleep 2
      
            Performance counter stats for 'system wide':
      
                       1.64 Joules power/energy-ram/
                       0.20 Joules power/energy-gpu/
      
                2.001228914 seconds time elapsed
           #
           # grep -m1 "model name" /proc/cpuinfo
           model name	: Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz
           #
      
       - The small llvm.cpp file used to check if the llvm devel files are
         present was incorrectly deleted when removing the BPF event in 'perf
         trace', put it back as it is also used by tools/bpf/bpftool, that
         uses llvm routines to do disassembly of BPF object files.
      
       - Fix use of addr_location__exit() in dlfilter__object_code(), making
         sure that it is only used to pair a previous addr_location__init()
         call.
      
      * tag 'perf-tools-fixes-for-v6.6-2-2023-10-20' of git://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools:
        tools build: Fix llvm feature detection, still used by bpftool
        perf dlfilter: Add a test for object_code()
        perf dlfilter: Fix use of addr_location__exit() in dlfilter__object_code()
        perf pmu: Fix perf stat output with correct scale and unit
      9c5d00cb
    • Linus Torvalds's avatar
      Merge tag 'linux_kselftest_active-fixes-6.6-rc7' of... · 444ccf1b
      Linus Torvalds authored
      Merge tag 'linux_kselftest_active-fixes-6.6-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest
      
      Pull Kselftest fix from Shuah Khan:
       "One single fix to assert check in user_events abi_test to properly
        check bit value on Big Endian architectures. The code treated the bit
        values as Little Endian and the check failed on Big Endian"
      
      * tag 'linux_kselftest_active-fixes-6.6-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest:
        selftests/user_events: Fix abi_test for BE archs
      444ccf1b
    • Linus Torvalds's avatar
      Merge tag 'nfs-for-6.6-4' of git://git.linux-nfs.org/projects/anna/linux-nfs · f74e3ea3
      Linus Torvalds authored
      Pull NFS client fixes from Anna Schumaker:
       "Stable Fix:
         - Fix a pNFS hang in nfs4_evict_inode()
      
        Fixes:
         - Force update of suid/sgid bits after an NFS v4.2 ALLOCATE op
         - Fix a potential oops in nfs_inode_remove_request()
         - Check the validity of the layout pointer in ff_layout_mirror_prepare_stats()
         - Fix incorrectly marking the pNFS MDS with USE_PNFS_DS in some cases"
      
      * tag 'nfs-for-6.6-4' of git://git.linux-nfs.org/projects/anna/linux-nfs:
        NFSv4.1: fixup use EXCHGID4_FLAG_USE_PNFS_DS for DS server
        pNFS/flexfiles: Check the layout validity in ff_layout_mirror_prepare_stats
        pNFS: Fix a hang in nfs4_evict_inode()
        NFS: Fix potential oops in nfs_inode_remove_request()
        nfs42: client needs to strip file mode's suid/sgid bit after ALLOCATE op
      f74e3ea3
    • Linus Torvalds's avatar
      Merge tag 'fsnotify_for_v6.6-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs · 0e97fd29
      Linus Torvalds authored
      Pull fanotify fix from Jan Kara:
       "Disable superblock / mount marks for filesystems that can encode file
        handles but not open them (currently only overlayfs).
      
        It is not clear the functionality is useful in any way so let's better
        disable it before someone comes up with some creative misuse"
      
      * tag 'fsnotify_for_v6.6-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
        fanotify: limit reporting of event with non-decodeable file handles
      0e97fd29
    • Linus Torvalds's avatar
      Merge tag 'acpi-6.6-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · f20f29cb
      Linus Torvalds authored
      Pull ACPI fixes from Rafael Wysocki:
       "These fix the ACPI initialization ordering on ARM and ACPI IRQ
        management in the cases when irq_create_fwspec_mapping() fails.
      
        Specifics:
      
         - Fix ACPI initialization ordering on ARM that was changed
           incorrectly during the 6.5 development cycle (Hanjun Guo)
      
         - Make acpi_register_gsi() return an error code as appropriate when
           irq_create_fwspec_mapping() returns 0 on failure (Sunil V L)"
      
      * tag 'acpi-6.6-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        ACPI: bus: Move acpi_arm_init() to the place of after acpi_ghes_init()
        ACPI: irq: Fix incorrect return value in acpi_register_gsi()
      f20f29cb
    • Linus Torvalds's avatar
      Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi · 75e167c2
      Linus Torvalds authored
      Pull SCSI fixes from James Bottomley:
       "Two small fixes, both in drivers.
      
        The mptsas one is really fixing an error path issue where it can leave
        the misc driver loaded even though the sas driver fails to initialize"
      
      * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
        scsi: qla2xxx: Fix double free of dsd_list during driver load
        scsi: mpt3sas: Fix in error path
      75e167c2
    • Linus Torvalds's avatar
      Merge tag 'pinctrl-v6.6-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl · 659eaa00
      Linus Torvalds authored
      Pull pin control fixes from Linus Walleij:
      
       - Concurrent register updates in the Qualcomm LPASS pin controller gets
         a proper lock.
      
       - revert a mutex fix that was causing problems: contention on the mutex
         or something of the sort lead to probe reordering and MMC block
         devices start to register in a different order, which unsuspecting
         userspace is not ready to handle
      
      * tag 'pinctrl-v6.6-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl:
        Revert "pinctrl: avoid unsafe code pattern in find_pinctrl()"
        pinctrl: qcom: lpass-lpi: fix concurrent register updates
      659eaa00
    • Linus Torvalds's avatar
      Merge tag 'mtd/fixes-for-6.6-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux · f6176471
      Linus Torvalds authored
      Pull MTD fixes from Miquel Raynal:
       "In the raw NAND subsystem, the major fix prevents using cached reads
        with devices not supporting it. There was two bug reports about this.
      
        Apart from that, three drivers (pl353, arasan and marvell) could
        sometimes hide page program failures due to their their own program
        page helper not being fully compliant with the specification (many
        drivers use the default helpers shared by the core). Adding a missing
        check prevents these situation.
      
        Finally, the Qualcomm driver had a broken error path.
      
        In the SPI-NAND subsystem one Micron device used a wrong bitmak
        reporting possibly corrupted ECC status.
      
        Finally, the physmap-core got stripped from its map_rom fallback by
        mistake, this feature is added back"
      
      * tag 'mtd/fixes-for-6.6-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux:
        mtd: rawnand: Ensure the nand chip supports cached reads
        mtd: rawnand: qcom: Unmap the right resource upon probe failure
        mtd: rawnand: pl353: Ensure program page operations are successful
        mtd: rawnand: arasan: Ensure program page operations are successful
        mtd: spinand: micron: correct bitmask for ecc status
        mtd: physmap-core: Restore map_rom fallback
        mtd: rawnand: marvell: Ensure program page operations are successful
      f6176471
    • Linus Torvalds's avatar
      Merge tag 'mmc-v6.6-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc · 7da6c042
      Linus Torvalds authored
      Pull MMC fixes from Ulf Hansson:
       "MMC core:
         - Capture correct oemid-bits for eMMC cards
         - Fix error propagation for some ioctl commands
         - Hold retuning if SDIO is in 1-bit mode
      
        MMC host:
         - mtk-sd: Use readl_poll_timeout_atomic to not "schedule while atomic"
         - sdhci-msm: Correct minimum number of clocks
         - sdhci-pci-gli: Fix LPM negotiation so x86/S0ix SoCs can suspend
         - sdhci-sprd: Fix error code in sdhci_sprd_tuning()"
      
      * tag 'mmc-v6.6-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc:
        mmc: core: Capture correct oemid-bits for eMMC cards
        mmc: mtk-sd: Use readl_poll_timeout_atomic in msdc_reset_hw
        mmc: core: Fix error propagation for some ioctl commands
        mmc: sdhci-sprd: Fix error code in sdhci_sprd_tuning()
        mmc: sdhci-pci-gli: fix LPM negotiation so x86/S0ix SoCs can suspend
        mmc: core: sdio: hold retuning if sdio in 1-bit mode
        dt-bindings: mmc: sdhci-msm: correct minimum number of clocks
      7da6c042
    • Linus Torvalds's avatar
      Merge tag 'block-6.6-2023-10-20' of git://git.kernel.dk/linux · c3200081
      Linus Torvalds authored
      Pull block fixes from Jens Axboe:
       "A fix for a regression with sed-opal and saved keys, and outside of
        that an NVMe pull request fixing a few minor issues on that front"
      
      * tag 'block-6.6-2023-10-20' of git://git.kernel.dk/linux:
        nvme-pci: add BOGUS_NID for Intel 0a54 device
        nvmet-auth: complete a request only after freeing the dhchap pointers
        nvme: sanitize metadata bounce buffer for reads
        block: Fix regression in sed-opal for a saved key.
        nvme-auth: use chap->s2 to indicate bidirectional authentication
        nvmet-tcp: Fix a possible UAF in queue intialization setup
        nvme-rdma: do not try to stop unallocated queues
      c3200081
    • Linus Torvalds's avatar
      Merge tag 'io_uring-6.6-2023-10-20' of git://git.kernel.dk/linux · 747b7628
      Linus Torvalds authored
      Pull io_uring fix from Jens Axboe:
       "Just a single fix for a bug report that came in, fixing a case where
        failure to init a ring with IORING_SETUP_NO_MMAP can trigger a NULL
        pointer dereference"
      
      * tag 'io_uring-6.6-2023-10-20' of git://git.kernel.dk/linux:
        io_uring: fix crash with IORING_SETUP_NO_MMAP and invalid SQ ring address
      747b7628
    • Linus Torvalds's avatar
      Merge tag 'sound-6.6-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound · 14f68633
      Linus Torvalds authored
      Pull sound fixes from Takashi Iwai:
       "Still higher volume than wished, but all are driver-specific small
        fixes and look safe for this late RC.
      
        The majority of changes are for ASoC, especially for wcd938x driver
        and Cirrus codec drivers, while there are other random fixes including
        usual HD-audio quirks"
      
      * tag 'sound-6.6-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (22 commits)
        ASoC: da7219: Correct the process of setting up Gnd switch in AAD
        ALSA: hda/realtek - Fixed ASUS platform headset Mic issue
        ALSA: hda/realtek: Add quirk for ASUS ROG GU603ZV
        ALSA: hda/relatek: Enable Mute LED on HP Laptop 15s-fq5xxx
        ASoC: dwc: Fix non-DT instantiation
        ASoC: codecs: tas2780: Fix log of failed reset via I2C.
        ASoC: rt5650: fix the wrong result of key button
        ASoC: cs42l42: Fix missing include of gpio/consumer.h
        ASoC: cs42l43: Update values for bias sense
        ASoC: dt-bindings: cirrus,cs42l43: Update values for bias sense
        ASoC: cs35l56: ASP1 DOUT must default to Hi-Z when not transmitting
        ASoC: pxa: fix a memory leak in probe()
        ASoC: cs35l56: Fix illegal use of init_completion()
        ASoC: codecs: wcd938x-sdw: fix runtime PM imbalance on probe errors
        ASoC: codecs: wcd938x-sdw: fix use after free on driver unbind
        ASoC: codecs: wcd938x: fix runtime PM imbalance on remove
        ASoC: codecs: wcd938x: fix regulator leaks on probe errors
        ASoC: codecs: wcd938x: fix resource leaks on bind errors
        ASoC: codecs: wcd938x: fix unbind tear down order
        ASoC: codecs: wcd938x: drop bogus bind error handling
        ...
      14f68633
    • Linus Torvalds's avatar
      Merge tag 'drm-fixes-2023-10-20' of git://anongit.freedesktop.org/drm/drm · c8045b4a
      Linus Torvalds authored
      Pull drm fixes from Dave Airlie:
       "Regular fixes for the week, amdgpu, i915, nouveau, with some other
        scattered around, nothing major.
      
        amdgpu:
         - Fix possible NULL pointer dereference
         - Avoid possible BUG_ON in GPUVM updates
         - Disable AMD_CTX_PRIORITY_UNSET
      
        i915:
         - Fix display issue that was blocking S0ix
         - Retry gtt fault when out of fence registers
      
        bridge:
         - ti-sn65dsi86: Fix device lifetime
      
        edid:
         - Add quirk for BenQ GW2765
      
        ivpu:
         - Extend address range for MMU mmap
      
        nouveau:
         - DP-connector fixes
         - Documentation fixes
      
        panel:
         - Move AUX B116XW03 into panel-simple
      
        scheduler:
         - Eliminate DRM_SCHED_PRIORITY_UNSET
      
        ttm:
         - Fix possible NULL-ptr deref in cleanup
      
        mediatek:
         - Correctly free sg_table in gem prime vmap"
      
      * tag 'drm-fixes-2023-10-20' of git://anongit.freedesktop.org/drm/drm:
        drm/amdgpu: Reserve fences for VM update
        drm/amdgpu: Fix possible null pointer dereference
        accel/ivpu: Extend address range for MMU mmap
        Revert "accel/ivpu: Use cached buffers for FW loading"
        accel/ivpu: Don't enter d0i3 during FLR
        drm/i915: Retry gtt fault when out of fence registers
        drm/i915/cx0: Only clear/set the Pipe Reset bit of the PHY Lanes Owned
        gpu/drm: Eliminate DRM_SCHED_PRIORITY_UNSET
        drm/amdgpu: Unset context priority is now invalid
        drm/mediatek: Correctly free sg_table in gem prime vmap
        drm/edid: add 8 bpc quirk to the BenQ GW2765
        drm/ttm: Reorder sys manager cleanup step
        drm/nouveau/disp: fix DP capable DSM connectors
        drm/nouveau: exec: fix ioctl kernel-doc warning
        drm/panel: Move AUX B116XW03 out of panel-edp back to panel-simple
        drm/bridge: ti-sn65dsi86: Associate DSI device lifetime with auxiliary device
      c8045b4a
    • Ard Biesheuvel's avatar
      c03d21f0
    • Kirill A. Shutemov's avatar
      efi/unaccepted: Fix soft lockups caused by parallel memory acceptance · 50e782a8
      Kirill A. Shutemov authored
      Michael reported soft lockups on a system that has unaccepted memory.
      This occurs when a user attempts to allocate and accept memory on
      multiple CPUs simultaneously.
      
      The root cause of the issue is that memory acceptance is serialized with
      a spinlock, allowing only one CPU to accept memory at a time. The other
      CPUs spin and wait for their turn, leading to starvation and soft lockup
      reports.
      
      To address this, the code has been modified to release the spinlock
      while accepting memory. This allows for parallel memory acceptance on
      multiple CPUs.
      
      A newly introduced "accepting_list" keeps track of which memory is
      currently being accepted. This is necessary to prevent parallel
      acceptance of the same memory block. If a collision occurs, the lock is
      released and the process is retried.
      
      Such collisions should rarely occur. The main path for memory acceptance
      is the page allocator, which accepts memory in MAX_ORDER chunks. As long
      as MAX_ORDER is equal to or larger than the unit_size, collisions will
      never occur because the caller fully owns the memory block being
      accepted.
      
      Aside from the page allocator, only memblock and deferered_free_range()
      accept memory, but this only happens during boot.
      
      The code has been tested with unit_size == 128MiB to trigger collisions
      and validate the retry codepath.
      
      Fixes: 2053bc57 ("efi: Add unaccepted memory support")
      Signed-off-by: default avatarKirill A. Shutemov <kirill.shutemov@linux.intel.com>
      Reported-by: Michael Roth <michael.roth@amd.com
      Reviewed-by: default avatarNikolay Borisov <nik.borisov@suse.com>
      Reviewed-by: default avatarVlastimil Babka <vbabka@suse.cz>
      Tested-by: default avatarMichael Roth <michael.roth@amd.com>
      [ardb: drop unnecessary cpu_relax() call]
      Signed-off-by: default avatarArd Biesheuvel <ardb@kernel.org>
      50e782a8
    • Rafael J. Wysocki's avatar
      Merge branch 'acpi-irq' · 9caa3a2d
      Rafael J. Wysocki authored
      Merge ACPI IRQ management fix for 6.6-rc7 (Sunil V L).
      
      * acpi-irq:
        ACPI: irq: Fix incorrect return value in acpi_register_gsi()
      9caa3a2d
    • Francis Laniel's avatar
      selftests/ftrace: Add new test case which checks non unique symbol · 03b80ff8
      Francis Laniel authored
      If name_show() is non unique, this test will try to install a kprobe on this
      function which should fail returning EADDRNOTAVAIL.
      On kernel where name_show() is not unique, this test is skipped.
      
      Link: https://lore.kernel.org/all/20231020104250.9537-3-flaniel@linux.microsoft.com/
      
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarFrancis Laniel <flaniel@linux.microsoft.com>
      Acked-by: default avatarMasami Hiramatsu (Google) <mhiramat@kernel.org>
      Signed-off-by: default avatarMasami Hiramatsu (Google) <mhiramat@kernel.org>
      03b80ff8
    • Francis Laniel's avatar
      tracing/kprobes: Return EADDRNOTAVAIL when func matches several symbols · b022f0c7
      Francis Laniel authored
      When a kprobe is attached to a function that's name is not unique (is
      static and shares the name with other functions in the kernel), the
      kprobe is attached to the first function it finds. This is a bug as the
      function that it is attaching to is not necessarily the one that the
      user wants to attach to.
      
      Instead of blindly picking a function to attach to what is ambiguous,
      error with EADDRNOTAVAIL to let the user know that this function is not
      unique, and that the user must use another unique function with an
      address offset to get to the function they want to attach to.
      
      Link: https://lore.kernel.org/all/20231020104250.9537-2-flaniel@linux.microsoft.com/
      
      Cc: stable@vger.kernel.org
      Fixes: 413d37d1 ("tracing: Add kprobe-based event tracer")
      Suggested-by: default avatarMasami Hiramatsu <mhiramat@kernel.org>
      Signed-off-by: default avatarFrancis Laniel <flaniel@linux.microsoft.com>
      Link: https://lore.kernel.org/lkml/20230819101105.b0c104ae4494a7d1f2eea742@kernel.org/Acked-by: default avatarMasami Hiramatsu (Google) <mhiramat@kernel.org>
      Signed-off-by: default avatarMasami Hiramatsu (Google) <mhiramat@kernel.org>
      b022f0c7