[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <YbxEzHVdvzCiProP@8bytes.org>
Date: Fri, 17 Dec 2021 09:05:32 +0100
From: Joerg Roedel <joro@...tes.org>
To: Kees Cook <keescook@...omium.org>
Cc: Lu Baolu <baolu.lu@...ux.intel.com>,
David Woodhouse <dwmw2@...radead.org>,
Will Deacon <will@...nel.org>,
Yury Norov <yury.norov@...il.com>,
linux-kernel@...r.kernel.org, iommu@...ts.linux-foundation.org,
linux-hardening@...r.kernel.org
Subject: Re: [PATCH] iommu: Use correctly sized arguments for bit field
On Wed, Dec 15, 2021 at 03:24:32PM -0800, Kees Cook wrote:
> The find.h APIs are designed to be used only on unsigned long arguments.
> This can technically result in a over-read, but it is harmless in this
> case. Regardless, fix it to avoid the warning seen under -Warray-bounds,
> which we'd like to enable globally:
>
> In file included from ./include/linux/bitmap.h:9,
> from drivers/iommu/intel/iommu.c:17:
> drivers/iommu/intel/iommu.c: In function 'domain_context_mapping_one':
> ./include/linux/find.h:119:37: warning: array subscript 'long unsigned int[0]' is partly outside array bounds of 'int[1]' [-Warray-bounds]
> 119 | unsigned long val = *addr & GENMASK(size - 1, 0);
> | ^~~~~
> drivers/iommu/intel/iommu.c:2115:18: note: while referencing 'max_pde'
> 2115 | int pds, max_pde;
> | ^~~~~~~
>
> Signed-off-by: Kees Cook <keescook@...omium.org>
> ---
> drivers/iommu/intel/iommu.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
Applied, thanks.
Powered by blists - more mailing lists