1. 06 Mar, 2024 1 commit
    • Linus Torvalds's avatar
      iov_iter: get rid of 'copy_mc' flag · a50026bd
      Linus Torvalds authored
      This flag is only set by one single user: the magical core dumping code
      that looks up user pages one by one, and then writes them out using
      their kernel addresses (by using a BVEC_ITER).
      
      That actually ends up being a huge problem, because while we do use
      copy_mc_to_kernel() for this case and it is able to handle the possible
      machine checks involved, nothing else is really ready to handle the
      failures caused by the machine check.
      
      In particular, as reported by Tong Tiangen, we don't actually support
      fault_in_iov_iter_readable() on a machine check area.
      
      As a result, the usual logic for writing things to a file under a
      filesystem lock, which involves doing a copy with page faults disabled
      and then if that fails trying to fault pages in without holding the
      locks with fault_in_iov_iter_readable() does not work at all.
      
      We could decide to always just make the MC copy "succeed" (and filling
      the destination with zeroes), and that would then create a core dump
      file that just ignores any machine checks.
      
      But honestly, this single special case has been problematic before, and
      means that all the normal iov_iter code ends up slightly more complex
      and slower.
      
      See for example commit c9eec08b ("iov_iter: Don't deal with
      iter->copy_mc in memcpy_from_iter_mc()") where David Howells
      re-organized the code just to avoid having to check the 'copy_mc' flags
      inside the inner iov_iter loops.
      
      So considering that we have exactly one user, and that one user is a
      non-critical special case that doesn't actually ever trigger in real
      life (Tong found this with manual error injection), the sane solution is
      to just decide that the onus on handling the machine check lines on that
      user instead.
      
      Ergo, do the copy_mc_to_kernel() in the core dump logic itself, copying
      the user data to a stable kernel page before writing it out.
      
      Fixes: f1982740 ("iov_iter: Convert iterate*() to inline funcs")
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarTong Tiangen <tongtiangen@huawei.com>
      Link: https://lore.kernel.org/r/20240305133336.3804360-1-tongtiangen@huawei.com
      Link: https://lore.kernel.org/all/4e80924d-9c85-f13a-722a-6a5d2b1c225a@huawei.com/Tested-by: default avatarDavid Howells <dhowells@redhat.com>
      Reviewed-by: default avatarDavid Howells <dhowells@redhat.com>
      Reviewed-by: default avatarJens Axboe <axboe@kernel.dk>
      Reported-by: default avatarTong Tiangen <tongtiangen@huawei.com>
      Signed-off-by: default avatarChristian Brauner <brauner@kernel.org>
      a50026bd
  2. 05 Mar, 2024 2 commits
  3. 03 Mar, 2024 5 commits
    • Linus Torvalds's avatar
      Linux 6.8-rc7 · 90d35da6
      Linus Torvalds authored
      90d35da6
    • 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
  4. 02 Mar, 2024 8 commits
  5. 01 Mar, 2024 24 commits