public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sean Anderson <sean.anderson@linux.dev>
To: Christoph Hellwig <hch@lst.de>,
	syzbot <syzbot+b4bfacdec173efaa8567@syzkaller.appspotmail.com>
Cc: iommu@lists.linux.dev, linux-kernel@vger.kernel.org,
	m.szyprowski@samsung.com, robin.murphy@arm.com,
	syzkaller-bugs@googlegroups.com
Subject: Re: [syzbot] [iommu?] kernel BUG in dma_alloc_attrs
Date: Thu, 17 Oct 2024 10:31:40 -0400	[thread overview]
Message-ID: <da9db10e-98fd-405c-9167-a29235f5470b@linux.dev> (raw)
In-Reply-To: <20241016080240.GA30380@lst.de>

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?

> 		else
> 			virt_to_page()
> 
> here.  Or just switch to tracing the virtual address to always be
> on the safe side.
> 

Since this function returns a virtual address, I think that would be
fine.

--Sean

  reply	other threads:[~2024-10-17 14:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-15 19:09 [syzbot] [iommu?] kernel BUG in dma_alloc_attrs syzbot
2024-10-16  8:02 ` Christoph Hellwig
2024-10-17 14:31   ` Sean Anderson [this message]
2024-10-17 14:40     ` Christoph Hellwig
2024-10-17 14:48       ` Sean Anderson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=da9db10e-98fd-405c-9167-a29235f5470b@linux.dev \
    --to=sean.anderson@linux.dev \
    --cc=hch@lst.de \
    --cc=iommu@lists.linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=robin.murphy@arm.com \
    --cc=syzbot+b4bfacdec173efaa8567@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox