1. 03 Mar, 2024 4 commits
    • Linus Torvalds's avatar
      Merge tag 'phy-fixes2-6.8' of git://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy · 58c806d8
      Linus Torvalds authored
      Pull phy fixes from Vinod Koul:
      
        - qcom: m31 pointer err fix, eusb2 fix redundant zero-out loop and v3
          offset fix on qmp-usb
      
        - freescale: fix for dphy alias
      
      * tag 'phy-fixes2-6.8' of git://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy:
        phy: qcom-qmp-usb: fix v3 offsets data
        phy: qualcomm: eusb2-repeater: Rework init to drop redundant zero-out loop
        phy: qcom: phy-qcom-m31: fix wrong pointer pass to PTR_ERR()
        phy: freescale: phy-fsl-imx8-mipi-dphy: Fix alias name to use dashes
      58c806d8
    • Linus Torvalds's avatar
      Merge tag 'dmaengine-fix2-6.8' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine · d57dd2d2
      Linus Torvalds authored
      Pull dmaengine fixes from Vinod Koul:
      
       - dw-edma fixes to improve driver and remote HDMA setup
      
       - fsl-edma fixes for SoC hange, irq init and byte calculations and
         sparse fixes
      
       - idxd: safe user copy of completion record fix
      
       - ptdma: consistent DMA mask fix
      
      * tag 'dmaengine-fix2-6.8' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine:
        dmaengine: ptdma: use consistent DMA masks
        dmaengine: fsl-qdma: add __iomem and struct in union to fix sparse warning
        dmaengine: idxd: Ensure safe user copy of completion record
        dmaengine: fsl-edma: correct max_segment_size setting
        dmaengine: idxd: Remove shadow Event Log head stored in idxd
        dmaengine: fsl-edma: correct calculation of 'nbytes' in multi-fifo scenario
        dmaengine: fsl-qdma: init irq after reg initialization
        dmaengine: fsl-qdma: fix SoC may hang on 16 byte unaligned read
        dmaengine: dw-edma: eDMA: Add sync read before starting the DMA transfer in remote setup
        dmaengine: dw-edma: HDMA: Add sync read before starting the DMA transfer in remote setup
        dmaengine: dw-edma: Add HDMA remote interrupt configuration
        dmaengine: dw-edma: HDMA_V0_REMOTEL_STOP_INT_EN typo fix
        dmaengine: dw-edma: Fix wrong interrupt bit set for HDMA
        dmaengine: dw-edma: Fix the ch_count hdma callback
      d57dd2d2
    • Linus Torvalds's avatar
      Merge tag 'powerpc-6.8-5' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux · e4f79000
      Linus Torvalds authored
      Pull powerpc fixes from Michael Ellerman:
      
       - Fix IOMMU table initialisation when doing kdump over SR-IOV
      
       - Fix incorrect RTAS function name for resetting TCE tables
      
       - Fix fpu_signal selftest failures since a recent change
      
      Thanks to Gaurav Batra and Nathan Lynch.
      
      * tag 'powerpc-6.8-5' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
        selftests/powerpc: Fix fpu_signal failures
        powerpc/rtas: use correct function name for resetting TCE tables
        powerpc/pseries/iommu: IOMMU table is not initialized for kdump over SR-IOV
      e4f79000
    • Linus Torvalds's avatar
      Merge tag 'x86_urgent_for_v6.8_rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 73d35f83
      Linus Torvalds authored
      Pull x86 fixes from Borislav Petkov:
      
       - Do not reserve SETUP_RNG_SEED setup data in the e820 map as it should
         be used by kexec only
      
       - Make sure MKTME feature detection happens at an earlier time in the
         boot process so that the physical address size supported by the CPU
         is properly corrected and MTRR masks are programmed properly, leading
         to TDX systems booting without disable_mtrr_cleanup on the cmdline
      
       - Make sure the different address sizes supported by the CPU are read
         out as early as possible
      
      * tag 'x86_urgent_for_v6.8_rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/e820: Don't reserve SETUP_RNG_SEED in e820
        x86/cpu/intel: Detect TME keyid bits before setting MTRR mask registers
        x86/cpu: Allow reducing x86_phys_bits during early_identify_cpu()
      73d35f83
  2. 02 Mar, 2024 8 commits
  3. 01 Mar, 2024 27 commits
  4. 29 Feb, 2024 1 commit
    • Filipe Manana's avatar
      btrfs: fix double free of anonymous device after snapshot creation failure · e2b54eaf
      Filipe Manana authored
      When creating a snapshot we may do a double free of an anonymous device
      in case there's an error committing the transaction. The second free may
      result in freeing an anonymous device number that was allocated by some
      other subsystem in the kernel or another btrfs filesystem.
      
      The steps that lead to this:
      
      1) At ioctl.c:create_snapshot() we allocate an anonymous device number
         and assign it to pending_snapshot->anon_dev;
      
      2) Then we call btrfs_commit_transaction() and end up at
         transaction.c:create_pending_snapshot();
      
      3) There we call btrfs_get_new_fs_root() and pass it the anonymous device
         number stored in pending_snapshot->anon_dev;
      
      4) btrfs_get_new_fs_root() frees that anonymous device number because
         btrfs_lookup_fs_root() returned a root - someone else did a lookup
         of the new root already, which could some task doing backref walking;
      
      5) After that some error happens in the transaction commit path, and at
         ioctl.c:create_snapshot() we jump to the 'fail' label, and after
         that we free again the same anonymous device number, which in the
         meanwhile may have been reallocated somewhere else, because
         pending_snapshot->anon_dev still has the same value as in step 1.
      
      Recently syzbot ran into this and reported the following trace:
      
        ------------[ cut here ]------------
        ida_free called for id=51 which is not allocated.
        WARNING: CPU: 1 PID: 31038 at lib/idr.c:525 ida_free+0x370/0x420 lib/idr.c:525
        Modules linked in:
        CPU: 1 PID: 31038 Comm: syz-executor.2 Not tainted 6.8.0-rc4-syzkaller-00410-gc02197fc #0
        Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/25/2024
        RIP: 0010:ida_free+0x370/0x420 lib/idr.c:525
        Code: 10 42 80 3c 28 (...)
        RSP: 0018:ffffc90015a67300 EFLAGS: 00010246
        RAX: be5130472f5dd000 RBX: 0000000000000033 RCX: 0000000000040000
        RDX: ffffc90009a7a000 RSI: 000000000003ffff RDI: 0000000000040000
        RBP: ffffc90015a673f0 R08: ffffffff81577992 R09: 1ffff92002b4cdb4
        R10: dffffc0000000000 R11: fffff52002b4cdb5 R12: 0000000000000246
        R13: dffffc0000000000 R14: ffffffff8e256b80 R15: 0000000000000246
        FS:  00007fca3f4b46c0(0000) GS:ffff8880b9500000(0000) knlGS:0000000000000000
        CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
        CR2: 00007f167a17b978 CR3: 000000001ed26000 CR4: 0000000000350ef0
        Call Trace:
         <TASK>
         btrfs_get_root_ref+0xa48/0xaf0 fs/btrfs/disk-io.c:1346
         create_pending_snapshot+0xff2/0x2bc0 fs/btrfs/transaction.c:1837
         create_pending_snapshots+0x195/0x1d0 fs/btrfs/transaction.c:1931
         btrfs_commit_transaction+0xf1c/0x3740 fs/btrfs/transaction.c:2404
         create_snapshot+0x507/0x880 fs/btrfs/ioctl.c:848
         btrfs_mksubvol+0x5d0/0x750 fs/btrfs/ioctl.c:998
         btrfs_mksnapshot+0xb5/0xf0 fs/btrfs/ioctl.c:1044
         __btrfs_ioctl_snap_create+0x387/0x4b0 fs/btrfs/ioctl.c:1306
         btrfs_ioctl_snap_create_v2+0x1ca/0x400 fs/btrfs/ioctl.c:1393
         btrfs_ioctl+0xa74/0xd40
         vfs_ioctl fs/ioctl.c:51 [inline]
         __do_sys_ioctl fs/ioctl.c:871 [inline]
         __se_sys_ioctl+0xfe/0x170 fs/ioctl.c:857
         do_syscall_64+0xfb/0x240
         entry_SYSCALL_64_after_hwframe+0x6f/0x77
        RIP: 0033:0x7fca3e67dda9
        Code: 28 00 00 00 (...)
        RSP: 002b:00007fca3f4b40c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
        RAX: ffffffffffffffda RBX: 00007fca3e7abf80 RCX: 00007fca3e67dda9
        RDX: 00000000200005c0 RSI: 0000000050009417 RDI: 0000000000000003
        RBP: 00007fca3e6ca47a R08: 0000000000000000 R09: 0000000000000000
        R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
        R13: 000000000000000b R14: 00007fca3e7abf80 R15: 00007fff6bf95658
         </TASK>
      
      Where we get an explicit message where we attempt to free an anonymous
      device number that is not currently allocated. It happens in a different
      code path from the example below, at btrfs_get_root_ref(), so this change
      may not fix the case triggered by syzbot.
      
      To fix at least the code path from the example above, change
      btrfs_get_root_ref() and its callers to receive a dev_t pointer argument
      for the anonymous device number, so that in case it frees the number, it
      also resets it to 0, so that up in the call chain we don't attempt to do
      the double free.
      
      CC: stable@vger.kernel.org # 5.10+
      Link: https://lore.kernel.org/linux-btrfs/000000000000f673a1061202f630@google.com/
      Fixes: e03ee2fe ("btrfs: do not ASSERT() if the newly created subvolume already got read")
      Signed-off-by: default avatarFilipe Manana <fdmanana@suse.com>
      Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
      Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
      e2b54eaf