Re: [syzbot] [iommu?] kernel BUG in dma_alloc_attrs

From: Christoph Hellwig
Date: Wed Oct 16 2024 - 04:04:31 EST


The problem is that the dma alloc/free tracing calls virt_to_phys
on the allocated/free memory. But that memory can be vmalloced as
in this case. I think we don't have weirdo allocators or pools any
more that are neither in the direct kernel mapping or vmalloc, so
we might be able to do an

if (is_vmalloc_addr())
page_to_phys(vmalloc_to_page()))
else
virt_to_page()

here. Or just switch to tracing the virtual address to always be
on the safe side.