From: Christoph Hellwig <hch@lst.de>
To: Eric Auger <eric.auger@redhat.com>
Cc: linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org,
eric.auger.pro@gmail.com, robin.murphy@arm.com, hch@lst.de
Subject: Re: [PATCH] dma-mapping: Protect dma_addressing_limited against NULL dma_mask
Date: Mon, 22 Jul 2019 13:43:03 +0200 [thread overview]
Message-ID: <20190722114303.GA32052@lst.de> (raw)
In-Reply-To: <20190722111449.29258-1-eric.auger@redhat.com>
I posted a fix that takes care of this in SCSI this morning:
https://marc.info/?l=linux-scsi&m=156378725427719&w=2
I suspect for virtio-blk we should do the same.
> static inline bool dma_addressing_limited(struct device *dev)
> {
> - return min_not_zero(*dev->dma_mask, dev->bus_dma_mask) <
> - dma_get_required_mask(dev);
> + return dev->dma_mask ? min_not_zero(*dev->dma_mask, dev->bus_dma_mask) <
> + dma_get_required_mask(dev) : false;
But to be on the safe side we could still do an early return here,
but it should have a WARN_ON_ONCE.
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
prev parent reply other threads:[~2019-07-22 11:43 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-22 11:14 [PATCH] dma-mapping: Protect dma_addressing_limited against NULL dma_mask Eric Auger
2019-07-22 11:43 ` Christoph Hellwig [this message]
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=20190722114303.GA32052@lst.de \
--to=hch@lst.de \
--cc=eric.auger.pro@gmail.com \
--cc=eric.auger@redhat.com \
--cc=iommu@lists.linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--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