lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAA9_cmc9XWCvU=d2qu6rMaV+_sxBeMgrreZWU5ofzAd3dANT9w@mail.gmail.com>
Date:	Wed, 17 Jul 2013 15:39:15 -0700
From:	Dan Williams <djbw@...com>
To:	Paul Bolle <pebolle@...cali.nl>
Cc:	Vinod Koul <vinod.koul@...el.com>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	"dave.jiang" <dave.jiang@...el.com>
Subject: Re: [PATCH] ioatdma: silence GCC warnings

On Mon, Jun 17, 2013 at 3:35 AM, Paul Bolle <pebolle@...cali.nl> wrote:
> Building dma_v3.o triggers two GCC warnings:
>     drivers/dma/ioat/dma_v3.c: In function ‘__ioat3_prep_pq16_lock’:
>     drivers/dma/ioat/dma_v3.c:264:11: warning: array subscript is below array bounds [-Warray-bounds]
>     drivers/dma/ioat/dma_v3.c:264:11: warning: array subscript is below array bounds [-Warray-bounds]
>
> These warnings are caused by pq16_set_src(). It uses "int idx" as an
> index to an eight element array. Changing "idx" to unsigned int silences
> these warnings. Apparently GCC can then determine that "idx" will never
> be negative.
>
> Signed-off-by: Paul Bolle <pebolle@...cali.nl>
> ---

Seems this is fixed in gcc as of 4.7.2, but we can make things quieter
for build testers on older compilers.

> 0) Compile tested only.
>
> 1) These warning were introduced in v3.10-rc1. That must have been
> through commit 7727eaa449 ("ioatdma: Adding support for 16 src PQ ops
> and super extended descriptors").
>
>  drivers/dma/ioat/dma_v3.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/dma/ioat/dma_v3.c b/drivers/dma/ioat/dma_v3.c
> index ca6ea9b..b5102da 100644
> --- a/drivers/dma/ioat/dma_v3.c
> +++ b/drivers/dma/ioat/dma_v3.c
> @@ -251,7 +251,7 @@ static bool is_bwd_noraid(struct pci_dev *pdev)
>  }
>
>  static void pq16_set_src(struct ioat_raw_descriptor *desc[3],
> -                       dma_addr_t addr, u32 offset, u8 coef, int idx)
> +                       dma_addr_t addr, u32 offset, u8 coef, unsigned int idx)

"unsigned int" --> "unsigned"

>  {
>         struct ioat_pq_descriptor *pq = (struct ioat_pq_descriptor *)desc[0];
>         struct ioat_pq16a_descriptor *pq16 =

Just do this hunk as the minimal one line change.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ