[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20200916061949.GA8599@lst.de>
Date: Wed, 16 Sep 2020 08:19:49 +0200
From: Christoph Hellwig <hch@....de>
To: Thomas Tai <thomas.tai@...cle.com>
Cc: Christoph Hellwig <hch@....de>, konrad.wilk@...cle.com,
m.szyprowski@...sung.com, robin.murphy@....com,
iommu@...ts.linux-foundation.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] dma-direct: Fix potential NULL pointer dereference
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.
Powered by blists - more mailing lists