[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Yu4lyhNFXRJjNc6Y@infradead.org>
Date: Sat, 6 Aug 2022 01:26:50 -0700
From: Christoph Hellwig <hch@...radead.org>
To: Chao Gao <chao.gao@...el.com>
Cc: iommu@...ts.linux-foundation.org, linux-kernel@...r.kernel.org,
hch@...radead.org, m.szyprowski@...sung.com, robin.murphy@....com,
konrad.wilk@...cle.com, jxgao@...gle.com
Subject: Re: [PATCH] swiotlb: avoid potential left shift overflow
On Fri, Aug 05, 2022 at 07:44:38PM +0800, Chao Gao wrote:
> The second operand passed to slot_addr() is declared as int or unsigned int
> in all call sites. The left-shift to get the offset of a slot can overflow
> if swiotlb size is larger than 4G.
>
> Fixes: 26a7e094783d ("swiotlb: refactor swiotlb_tbl_map_single")
> Signed-off-by: Chao Gao <chao.gao@...el.com>
Can you just convert it to an inline function? That will take care
of the typing in a much cleaner way than a cast.
Powered by blists - more mailing lists