[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f5cba632-421a-f375-3697-51a182a53a32@oracle.com>
Date: Tue, 15 Sep 2020 10:11:51 -0400
From: Thomas Tai <thomas.tai@...cle.com>
To: Christoph Hellwig <hch@....de>
Cc: 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 2020-09-15 10:07 a.m., Christoph Hellwig wrote:
> On Tue, Sep 15, 2020 at 08:03:14AM -0600, Thomas Tai wrote:
>> When booting the kernel v5.9-rc4 on a VM, the kernel would panic when
>> printing a warning message in swiotlb_map(). It is because dev->dma_mask
>> can potentially be a null pointer. Using the dma_get_mask() macro can
>> avoid the NULL pointer dereference.
>
> dma_mask must not be zero. This means drm is calling DMA API functions
> on something weird. This needs to be fixed in the caller.
>
Thanks, Christoph for your comment. The caller already fixed the null
pointer in the latest v5.9-rc5. I am thinking that if we had used the
dma_get_mask(), the kernel couldn't panic and could properly print out
the warning message.
Thomas
Powered by blists - more mailing lists