1. 03 May, 2024 3 commits
  2. 02 May, 2024 4 commits
  3. 01 May, 2024 15 commits
  4. 30 Apr, 2024 3 commits
    • Zack Rusin's avatar
      drm/vmwgfx: Fix invalid reads in fence signaled events · a37ef761
      Zack Rusin authored
      Correctly set the length of the drm_event to the size of the structure
      that's actually used.
      
      The length of the drm_event was set to the parent structure instead of
      to the drm_vmw_event_fence which is supposed to be read. drm_read
      uses the length parameter to copy the event to the user space thus
      resuling in oob reads.
      Signed-off-by: default avatarZack Rusin <zack.rusin@broadcom.com>
      Fixes: 8b7de6aa ("vmwgfx: Rework fence event action")
      Reported-by: zdi-disclosures@trendmicro.com # ZDI-CAN-23566
      Cc: David Airlie <airlied@gmail.com>
      CC: Daniel Vetter <daniel@ffwll.ch>
      Cc: Zack Rusin <zack.rusin@broadcom.com>
      Cc: Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>
      Cc: dri-devel@lists.freedesktop.org
      Cc: linux-kernel@vger.kernel.org
      Cc: <stable@vger.kernel.org> # v3.4+
      Reviewed-by: default avatarMaaz Mombasawala <maaz.mombasawala@broadcom.com>
      Reviewed-by: default avatarMartin Krastev <martin.krastev@broadcom.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20240425192748.1761522-1-zack.rusin@broadcom.com
      a37ef761
    • Lyude Paul's avatar
      drm/nouveau/gsp: Use the sg allocator for level 2 of radix3 · 6f572a80
      Lyude Paul authored
      Currently we allocate all 3 levels of radix3 page tables using
      nvkm_gsp_mem_ctor(), which uses dma_alloc_coherent() for allocating all of
      the relevant memory. This can end up failing in scenarios where the system
      has very high memory fragmentation, and we can't find enough contiguous
      memory to allocate level 2 of the page table.
      
      Currently, this can result in runtime PM issues on systems where memory
      fragmentation is high - as we'll fail to allocate the page table for our
      suspend/resume buffer:
      
        kworker/10:2: page allocation failure: order:7, mode:0xcc0(GFP_KERNEL),
        nodemask=(null),cpuset=/,mems_allowed=0
        CPU: 10 PID: 479809 Comm: kworker/10:2 Not tainted
        6.8.6-201.ChopperV6.fc39.x86_64 #1
        Hardware name: SLIMBOOK Executive/Executive, BIOS N.1.10GRU06 02/02/2024
        Workqueue: pm pm_runtime_work
        Call Trace:
         <TASK>
         dump_stack_lvl+0x64/0x80
         warn_alloc+0x165/0x1e0
         ? __alloc_pages_direct_compact+0xb3/0x2b0
         __alloc_pages_slowpath.constprop.0+0xd7d/0xde0
         __alloc_pages+0x32d/0x350
         __dma_direct_alloc_pages.isra.0+0x16a/0x2b0
         dma_direct_alloc+0x70/0x270
         nvkm_gsp_radix3_sg+0x5e/0x130 [nouveau]
         r535_gsp_fini+0x1d4/0x350 [nouveau]
         nvkm_subdev_fini+0x67/0x150 [nouveau]
         nvkm_device_fini+0x95/0x1e0 [nouveau]
         nvkm_udevice_fini+0x53/0x70 [nouveau]
         nvkm_object_fini+0xb9/0x240 [nouveau]
         nvkm_object_fini+0x75/0x240 [nouveau]
         nouveau_do_suspend+0xf5/0x280 [nouveau]
         nouveau_pmops_runtime_suspend+0x3e/0xb0 [nouveau]
         pci_pm_runtime_suspend+0x67/0x1e0
         ? __pfx_pci_pm_runtime_suspend+0x10/0x10
         __rpm_callback+0x41/0x170
         ? __pfx_pci_pm_runtime_suspend+0x10/0x10
         rpm_callback+0x5d/0x70
         ? __pfx_pci_pm_runtime_suspend+0x10/0x10
         rpm_suspend+0x120/0x6a0
         pm_runtime_work+0x98/0xb0
         process_one_work+0x171/0x340
         worker_thread+0x27b/0x3a0
         ? __pfx_worker_thread+0x10/0x10
         kthread+0xe5/0x120
         ? __pfx_kthread+0x10/0x10
         ret_from_fork+0x31/0x50
         ? __pfx_kthread+0x10/0x10
         ret_from_fork_asm+0x1b/0x30
      
      Luckily, we don't actually need to allocate coherent memory for the page
      table thanks to being able to pass the GPU a radix3 page table for
      suspend/resume data. So, let's rewrite nvkm_gsp_radix3_sg() to use the sg
      allocator for level 2. We continue using coherent allocations for lvl0 and
      1, since they only take a single page.
      
      V2:
      * Don't forget to actually jump to the next scatterlist when we reach the
        end of the scatterlist we're currently on when writing out the page table
        for level 2
      Signed-off-by: default avatarLyude Paul <lyude@redhat.com>
      Cc: stable@vger.kernel.org
      Reviewed-by: default avatarBen Skeggs <bskeggs@nvidia.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20240429182318.189668-2-lyude@redhat.com
      6f572a80
    • Lyude Paul's avatar
      drm/nouveau/firmware: Fix SG_DEBUG error with nvkm_firmware_ctor() · 52a6947b
      Lyude Paul authored
      Currently, enabling SG_DEBUG in the kernel will cause nouveau to hit a
      BUG() on startup:
      
        kernel BUG at include/linux/scatterlist.h:187!
        invalid opcode: 0000 [#1] PREEMPT SMP NOPTI
        CPU: 7 PID: 930 Comm: (udev-worker) Not tainted 6.9.0-rc3Lyude-Test+ #30
        Hardware name: MSI MS-7A39/A320M GAMING PRO (MS-7A39), BIOS 1.I0 01/22/2019
        RIP: 0010:sg_init_one+0x85/0xa0
        Code: 69 88 32 01 83 e1 03 f6 c3 03 75 20 a8 01 75 1e 48 09 cb 41 89 54
        24 08 49 89 1c 24 41 89 6c 24 0c 5b 5d 41 5c e9 7b b9 88 00 <0f> 0b 0f 0b
        0f 0b 48 8b 05 5e 46 9a 01 eb b2 66 66 2e 0f 1f 84 00
        RSP: 0018:ffffa776017bf6a0 EFLAGS: 00010246
        RAX: 0000000000000000 RBX: ffffa77600d87000 RCX: 000000000000002b
        RDX: 0000000000000001 RSI: 0000000000000000 RDI: ffffa77680d87000
        RBP: 000000000000e000 R08: 0000000000000000 R09: 0000000000000000
        R10: ffff98f4c46aa508 R11: 0000000000000000 R12: ffff98f4c46aa508
        R13: ffff98f4c46aa008 R14: ffffa77600d4a000 R15: ffffa77600d4a018
        FS:  00007feeb5aae980(0000) GS:ffff98f5c4dc0000(0000) knlGS:0000000000000000
        CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
        CR2: 00007f22cb9a4520 CR3: 00000001043ba000 CR4: 00000000003506f0
        Call Trace:
         <TASK>
         ? die+0x36/0x90
         ? do_trap+0xdd/0x100
         ? sg_init_one+0x85/0xa0
         ? do_error_trap+0x65/0x80
         ? sg_init_one+0x85/0xa0
         ? exc_invalid_op+0x50/0x70
         ? sg_init_one+0x85/0xa0
         ? asm_exc_invalid_op+0x1a/0x20
         ? sg_init_one+0x85/0xa0
         nvkm_firmware_ctor+0x14a/0x250 [nouveau]
         nvkm_falcon_fw_ctor+0x42/0x70 [nouveau]
         ga102_gsp_booter_ctor+0xb4/0x1a0 [nouveau]
         r535_gsp_oneinit+0xb3/0x15f0 [nouveau]
         ? srso_return_thunk+0x5/0x5f
         ? srso_return_thunk+0x5/0x5f
         ? nvkm_udevice_new+0x95/0x140 [nouveau]
         ? srso_return_thunk+0x5/0x5f
         ? srso_return_thunk+0x5/0x5f
         ? ktime_get+0x47/0xb0
         ? srso_return_thunk+0x5/0x5f
         nvkm_subdev_oneinit_+0x4f/0x120 [nouveau]
         nvkm_subdev_init_+0x39/0x140 [nouveau]
         ? srso_return_thunk+0x5/0x5f
         nvkm_subdev_init+0x44/0x90 [nouveau]
         nvkm_device_init+0x166/0x2e0 [nouveau]
         nvkm_udevice_init+0x47/0x70 [nouveau]
         nvkm_object_init+0x41/0x1c0 [nouveau]
         nvkm_ioctl_new+0x16a/0x290 [nouveau]
         ? __pfx_nvkm_client_child_new+0x10/0x10 [nouveau]
         ? __pfx_nvkm_udevice_new+0x10/0x10 [nouveau]
         nvkm_ioctl+0x126/0x290 [nouveau]
         nvif_object_ctor+0x112/0x190 [nouveau]
         nvif_device_ctor+0x23/0x60 [nouveau]
         nouveau_cli_init+0x164/0x640 [nouveau]
         nouveau_drm_device_init+0x97/0x9e0 [nouveau]
         ? srso_return_thunk+0x5/0x5f
         ? pci_update_current_state+0x72/0xb0
         ? srso_return_thunk+0x5/0x5f
         nouveau_drm_probe+0x12c/0x280 [nouveau]
         ? srso_return_thunk+0x5/0x5f
         local_pci_probe+0x45/0xa0
         pci_device_probe+0xc7/0x270
         really_probe+0xe6/0x3a0
         __driver_probe_device+0x87/0x160
         driver_probe_device+0x1f/0xc0
         __driver_attach+0xec/0x1f0
         ? __pfx___driver_attach+0x10/0x10
         bus_for_each_dev+0x88/0xd0
         bus_add_driver+0x116/0x220
         driver_register+0x59/0x100
         ? __pfx_nouveau_drm_init+0x10/0x10 [nouveau]
         do_one_initcall+0x5b/0x320
         do_init_module+0x60/0x250
         init_module_from_file+0x86/0xc0
         idempotent_init_module+0x120/0x2b0
         __x64_sys_finit_module+0x5e/0xb0
         do_syscall_64+0x83/0x160
         ? srso_return_thunk+0x5/0x5f
         entry_SYSCALL_64_after_hwframe+0x71/0x79
        RIP: 0033:0x7feeb5cc20cd
        Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa 48 89 f8 48 89
        f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0
        ff ff 73 01 c3 48 8b 0d 1b cd 0c 00 f7 d8 64 89 01 48
        RSP: 002b:00007ffcf220b2c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000139
        RAX: ffffffffffffffda RBX: 000055fdd2916aa0 RCX: 00007feeb5cc20cd
        RDX: 0000000000000000 RSI: 000055fdd29161e0 RDI: 0000000000000035
        RBP: 00007ffcf220b380 R08: 00007feeb5d8fb20 R09: 00007ffcf220b310
        R10: 000055fdd2909dc0 R11: 0000000000000246 R12: 000055fdd29161e0
        R13: 0000000000020000 R14: 000055fdd29203e0 R15: 000055fdd2909d80
         </TASK>
      
      We hit this when trying to initialize firmware of type
      NVKM_FIRMWARE_IMG_DMA because we allocate our memory with
      dma_alloc_coherent, and DMA allocations can't be turned back into memory
      pages - which a scatterlist needs in order to map them.
      
      So, fix this by allocating the memory with vmalloc instead().
      
      V2:
      * Fixup explanation as the prior one was bogus
      Signed-off-by: default avatarLyude Paul <lyude@redhat.com>
      Reviewed-by: default avatarDave Airlie <airlied@redhat.com>
      Cc: stable@vger.kernel.org
      Link: https://patchwork.freedesktop.org/patch/msgid/20240429182318.189668-1-lyude@redhat.com
      52a6947b
  5. 29 Apr, 2024 1 commit
  6. 28 Apr, 2024 6 commits
  7. 27 Apr, 2024 8 commits
    • Linus Torvalds's avatar
      Merge tag 'rust-fixes-6.9' of https://github.com/Rust-for-Linux/linux · 2c815938
      Linus Torvalds authored
      Pull Rust fixes from Miguel Ojeda:
      
       - Soundness: make internal functions generated by the 'module!' macro
         inaccessible, do not implement 'Zeroable' for 'Infallible' and
         require 'Send' for the 'Module' trait.
      
       - Build: avoid errors with "empty" files and workaround 'rustdoc' ICE.
      
       - Kconfig: depend on '!CFI_CLANG' and avoid selecting 'CONSTRUCTORS'.
      
       - Code docs: remove non-existing key from 'module!' macro example.
      
       - Docs: trivial rendering fix in arch table.
      
      * tag 'rust-fixes-6.9' of https://github.com/Rust-for-Linux/linux:
        rust: remove `params` from `module` macro example
        kbuild: rust: force `alloc` extern to allow "empty" Rust files
        kbuild: rust: remove unneeded `@rustc_cfg` to avoid ICE
        rust: kernel: require `Send` for `Module` implementations
        rust: phy: implement `Send` for `Registration`
        rust: make mutually exclusive with CFI_CLANG
        rust: macros: fix soundness issue in `module!` macro
        rust: init: remove impl Zeroable for Infallible
        docs: rust: fix improper rendering in Arch Support page
        rust: don't select CONSTRUCTORS
      2c815938
    • Linus Torvalds's avatar
      Merge tag 'riscv-for-linus-6.9-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux · 57865f39
      Linus Torvalds authored
      Pull RISC-V fixes from Palmer Dabbelt:
      
       - A fix for TASK_SIZE on rv64/NOMMU, to reflect the lack of user/kernel
         separation
      
       - A fix to avoid loading rv64/NOMMU kernel past the start of RAM
      
       - A fix for RISCV_HWPROBE_EXT_ZVFHMIN on ilp32 to avoid signed integer
         overflow in the bitmask
      
       - The sud_test kselftest has been fixed to properly swizzle the syscall
         number into the return register, which are not the same on RISC-V
      
       - A fix for a build warning in the perf tools on rv32
      
       - A fix for the CBO selftests, to avoid non-constants leaking into the
         inline asm
      
       - A pair of fixes for T-Head PBMT errata probing, which has been
         renamed MAE by the vendor
      
      * tag 'riscv-for-linus-6.9-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux:
        RISC-V: selftests: cbo: Ensure asm operands match constraints, take 2
        perf riscv: Fix the warning due to the incompatible type
        riscv: T-Head: Test availability bit before enabling MAE errata
        riscv: thead: Rename T-Head PBMT to MAE
        selftests: sud_test: return correct emulated syscall value on RISC-V
        riscv: hwprobe: fix invalid sign extension for RISCV_HWPROBE_EXT_ZVFHMIN
        riscv: Fix loading 64-bit NOMMU kernels past the start of RAM
        riscv: Fix TASK_SIZE on 64-bit NOMMU
      57865f39
    • Linus Torvalds's avatar
      Merge tag '6.9-rc5-cifs-fixes-part2' of git://git.samba.org/sfrench/cifs-2.6 · d43df69f
      Linus Torvalds authored
      Pull smb client fixes from Steve French:
       "Three smb3 client fixes, all also for stable:
      
         - two small locking fixes spotted by Coverity
      
         - FILE_ALL_INFO and network_open_info packing fix"
      
      * tag '6.9-rc5-cifs-fixes-part2' of git://git.samba.org/sfrench/cifs-2.6:
        smb3: fix lock ordering potential deadlock in cifs_sync_mid_result
        smb3: missing lock when picking channel
        smb: client: Fix struct_group() usage in __packed structs
      d43df69f
    • Linus Torvalds's avatar
      Merge tag 'i2c-for-6.9-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux · 5d12ed4b
      Linus Torvalds authored
      Pull i2c fixes from Wolfram Sang:
       "Fix a race condition in the at24 eeprom handler, a NULL pointer
        exception in the I2C core for controllers only using target modes,
        drop a MAINTAINERS entry, and fix an incorrect DT binding for at24"
      
      * tag 'i2c-for-6.9-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
        i2c: smbus: fix NULL function pointer dereference
        MAINTAINERS: Drop entry for PCA9541 bus master selector
        eeprom: at24: fix memory corruption race condition
        dt-bindings: eeprom: at24: Fix ST M24C64-D compatible schema
      5d12ed4b
    • Tetsuo Handa's avatar
      profiling: Remove create_prof_cpu_mask(). · 2e5449f4
      Tetsuo Handa authored
      create_prof_cpu_mask() is no longer used after commit 1f44a225 ("s390:
      convert interrupt handling to use generic hardirq").
      Signed-off-by: default avatarTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      2e5449f4
    • Linus Torvalds's avatar
      Merge tag 'soundwire-6.9-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire · 8a5c3ef7
      Linus Torvalds authored
      Pull soundwire fix from Vinod Koul:
      
       - Single AMD driver fix for wake interrupt handling in clockstop mode
      
      * tag 'soundwire-6.9-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire:
        soundwire: amd: fix for wake interrupt handling for clockstop mode
      8a5c3ef7
    • Linus Torvalds's avatar
      Merge tag 'dmaengine-fix-6.9' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine · 6fba14a7
      Linus Torvalds authored
      Pull dmaengine fixes from Vinod Koul:
      
       - Revert pl330 issue_pending waits until WFP state due to regression
         reported in Bluetooth loading
      
       - Xilinx driver fixes for synchronization, buffer offsets, locking and
         kdoc
      
       - idxd fixes for spinlock and preventing the migration of the perf
         context to an invalid target
      
       - idma driver fix for interrupt handling when powered off
      
       - Tegra driver residual calculation fix
      
       - Owl driver register access fix
      
      * tag 'dmaengine-fix-6.9' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine:
        dmaengine: idxd: Fix oops during rmmod on single-CPU platforms
        dmaengine: xilinx: xdma: Clarify kdoc in XDMA driver
        dmaengine: xilinx: xdma: Fix synchronization issue
        dmaengine: xilinx: xdma: Fix wrong offsets in the buffers addresses in dma descriptor
        dma: xilinx_dpdma: Fix locking
        dmaengine: idxd: Convert spinlock to mutex to lock evl workqueue
        idma64: Don't try to serve interrupts when device is powered off
        dmaengine: tegra186: Fix residual calculation
        dmaengine: owl: fix register access functions
        dmaengine: Revert "dmaengine: pl330: issue_pending waits until WFP state"
      6fba14a7
    • Linus Torvalds's avatar
      Merge tag 'phy-fixes-6.9' of git://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy · 63407d30
      Linus Torvalds authored
      Pull phy fixes from Vinod Koul:
      
       - static checker (array size, bounds) fix for marvel driver
      
       - Rockchip rk3588 pcie fixes for bifurcation and mux
      
       - Qualcomm qmp-compbo fix for VCO, register base and regulator name for
         m31 driver
      
       - charger det crash fix for ti driver
      
      * tag 'phy-fixes-6.9' of git://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy:
        phy: ti: tusb1210: Resolve charger-det crash if charger psy is unregistered
        phy: qcom: qmp-combo: fix VCO div offset on v5_5nm and v6
        phy: phy-rockchip-samsung-hdptx: Select CONFIG_RATIONAL
        phy: qcom: m31: match requested regulator name with dt schema
        phy: qcom: qmp-combo: Fix register base for QSERDES_DP_PHY_MODE
        phy: qcom: qmp-combo: Fix VCO div offset on v3
        phy: rockchip: naneng-combphy: Fix mux on rk3588
        phy: rockchip-snps-pcie3: fix clearing PHP_GRF_PCIESEL_CON bits
        phy: rockchip-snps-pcie3: fix bifurcation on rk3588
        phy: freescale: imx8m-pcie: fix pcie link-up instability
        phy: marvell: a3700-comphy: Fix hardcoded array size
        phy: marvell: a3700-comphy: Fix out of bounds read
      63407d30