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

From: Sean Anderson
Date: Thu Oct 17 2024 - 10:48:20 EST


On 10/17/24 10:40, Christoph Hellwig wrote:
> On Thu, Oct 17, 2024 at 10:31:40AM -0400, Sean Anderson wrote:
>> On 10/16/24 04:02, Christoph Hellwig wrote:
>> > 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()))
>>
>> Do we need offset_in_page?
>
> The DMA allocator always returns page aligned memory.
>
>> Since this function returns a virtual address, I think that would be
>> fine.
>
> Ok, I'll look into that. I'll need to check if %p gets obsfucated
> for traces like it does for normal dmesg first, though.
>

I have a patch written up for this; will send it after testing.

--Sean