From: Christoph Hellwig <hch@lst.de>
To: Thomas Tai <thomas.tai@oracle.com>
Cc: konrad.wilk@oracle.com, linux-kernel@vger.kernel.org,
iommu@lists.linux-foundation.org, robin.murphy@arm.com,
Christoph Hellwig <hch@lst.de>
Subject: Re: [PATCH] dma-direct: Fix potential NULL pointer dereference
Date: Wed, 16 Sep 2020 08:19:49 +0200 [thread overview]
Message-ID: <20200916061949.GA8599@lst.de> (raw)
In-Reply-To: <5136ed8d-d37d-8144-a6f3-c23f272d8926@oracle.com>
On Tue, Sep 15, 2020 at 04:46:17PM -0400, Thomas Tai wrote:
> I tried out the suggested changes, and it successfully warned the null
> pointer without panic. I notice that there are some places outside the
> dma-direct, which calls dma_capable().
>
> https://elixir.bootlin.com/linux/v5.9-rc5/source/arch/x86/kernel/amd_gart_64.c#L187
>
> https://elixir.bootlin.com/linux/v5.9-rc5/source/drivers/xen/swiotlb-xen.c#L387
All of these still come in throught the wrappers in kernel/dma/mapping.c.
> Given that the WARN_ON_ONCE already did the intended warning, would you be
> ok that I keep the null checking in dma_capable()?
No, the generic dma mapping layer is the right place.
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
WARNING: multiple messages have this Message-ID (diff)
From: Christoph Hellwig <hch@lst.de>
To: Thomas Tai <thomas.tai@oracle.com>
Cc: Christoph Hellwig <hch@lst.de>,
konrad.wilk@oracle.com, m.szyprowski@samsung.com,
robin.murphy@arm.com, iommu@lists.linux-foundation.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] dma-direct: Fix potential NULL pointer dereference
Date: Wed, 16 Sep 2020 08:19:49 +0200 [thread overview]
Message-ID: <20200916061949.GA8599@lst.de> (raw)
In-Reply-To: <5136ed8d-d37d-8144-a6f3-c23f272d8926@oracle.com>
On Tue, Sep 15, 2020 at 04:46:17PM -0400, Thomas Tai wrote:
> I tried out the suggested changes, and it successfully warned the null
> pointer without panic. I notice that there are some places outside the
> dma-direct, which calls dma_capable().
>
> https://elixir.bootlin.com/linux/v5.9-rc5/source/arch/x86/kernel/amd_gart_64.c#L187
>
> https://elixir.bootlin.com/linux/v5.9-rc5/source/drivers/xen/swiotlb-xen.c#L387
All of these still come in throught the wrappers in kernel/dma/mapping.c.
> Given that the WARN_ON_ONCE already did the intended warning, would you be
> ok that I keep the null checking in dma_capable()?
No, the generic dma mapping layer is the right place.
next prev parent reply other threads:[~2020-09-16 6:19 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-15 14:03 [PATCH] dma-direct: Fix potential NULL pointer dereference Thomas Tai
2020-09-15 14:03 ` Thomas Tai
2020-09-15 14:07 ` Christoph Hellwig
2020-09-15 14:07 ` Christoph Hellwig
2020-09-15 14:08 ` Christoph Hellwig
2020-09-15 14:08 ` Christoph Hellwig
2020-09-15 14:11 ` Thomas Tai
2020-09-15 14:11 ` Thomas Tai
2020-09-15 14:26 ` Christoph Hellwig
2020-09-15 14:26 ` Christoph Hellwig
2020-09-15 14:40 ` Thomas Tai
2020-09-15 14:40 ` Thomas Tai
2020-09-15 15:09 ` Christoph Hellwig
2020-09-15 15:09 ` Christoph Hellwig
2020-09-15 15:12 ` Thomas Tai
2020-09-15 15:12 ` Thomas Tai
2020-09-15 20:46 ` Thomas Tai
2020-09-15 20:46 ` Thomas Tai
2020-09-16 6:19 ` Christoph Hellwig [this message]
2020-09-16 6:19 ` Christoph Hellwig
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=20200916061949.GA8599@lst.de \
--to=hch@lst.de \
--cc=iommu@lists.linux-foundation.org \
--cc=konrad.wilk@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=robin.murphy@arm.com \
--cc=thomas.tai@oracle.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.