In the Linux kernel, the following vulnerability has been resolved: dmaengine: ioat: disable relaxed ordering before registering the device ioat3_dma_probe() disabled PCIe relaxed ordering after calling dma_async_device_register(), so if an error occurs and the code jumps to err_disable_interrupts, the function returns with the device still registered in the core's dma_device_list while the caller frees the ioatdma_device struct, leaving a dangling registration that anything walking the device list can dereference after it's been freed. Move the capability read/write ahead of dma_async_device_register() instead. Nothing after registration depends on relaxed ordering already being disabled, and nothing before it depends on the device being registered, so this is a plain reordering. It also means every remaining step after registration can't fail, so there's no need to ever have to unregister the device once registered.
https://git.kernel.org/stable/c/e0931234bfa6bd1a468850649edf94453b397f3a
https://git.kernel.org/stable/c/d80ecd990536a6f81aac47c9a0178747a8431831
https://git.kernel.org/stable/c/cef75a63b5dc55bf914bae96ea9590c56a5a7dcb
https://git.kernel.org/stable/c/ccb9c820f4207f5a4f90a4d04ef5e611df140feb
https://git.kernel.org/stable/c/8ff75cb311d89abc59260bec3613461daf4ebafc
https://git.kernel.org/stable/c/60c88a0a5b1be8769933f78b08767cbba3609ece
https://git.kernel.org/stable/c/24cb61494c6ca785b9cad421893033618a63e34d
https://git.kernel.org/stable/c/10d34fbca6e09a6a18d64fa3ebaa3db9f27fc1a6