From: Esteban Zamora <estebanzacr.20@gmail.com>
To: estebanzacr.20@gmail.com
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
Christoph Hellwig <hch@lst.de>,
Marek Szyprowski <m.szyprowski@samsung.com>,
Robin Murphy <robin.murphy@arm.com>,
iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org
Subject: [PATCH] swiotlb: Fix uninitialized pointer on DMA ops
Date: Sat, 18 Aug 2018 13:04:51 -0600 [thread overview]
Message-ID: <1534619091-14258-1-git-send-email-estebanzacr.20@gmail.com> (raw)
The mmap function pointer on swiotlb_dma_ops struct is
uninitialized, which causes a random crash when calling
the dma_mmap_coherent function on platforms where no DMA
address translation hardware is available.
Set this pointer to NULL in order to fix the issue.
Signed-off-by: Esteban Zamora <estebanzacr.20@gmail.com>
---
kernel/dma/swiotlb.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c
index 4f8a6db..9a7718c 100644
--- a/kernel/dma/swiotlb.c
+++ b/kernel/dma/swiotlb.c
@@ -1082,5 +1082,6 @@ const struct dma_map_ops swiotlb_dma_ops = {
.map_page = swiotlb_map_page,
.unmap_page = swiotlb_unmap_page,
.dma_supported = dma_direct_supported,
+ .mmap = NULL,
};
EXPORT_SYMBOL(swiotlb_dma_ops);
--
2.7.4
next reply other threads:[~2018-08-18 19:05 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-18 19:04 Esteban Zamora [this message]
2018-08-19 12:57 ` [PATCH] swiotlb: Fix uninitialized pointer on DMA ops Konrad Rzeszutek Wilk
2018-08-20 10:00 ` Robin Murphy
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=1534619091-14258-1-git-send-email-estebanzacr.20@gmail.com \
--to=estebanzacr.20@gmail.com \
--cc=hch@lst.de \
--cc=iommu@lists.linux-foundation.org \
--cc=konrad.wilk@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=robin.murphy@arm.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;
as well as URLs for NNTP newsgroup(s).