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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Wed, 23 Aug 2017 21:02:39 +0200
From:   Arnd Bergmann <arnd@...db.de>
To:     James Smart <james.smart@...adcom.com>,
        Dick Kennedy <dick.kennedy@...adcom.com>,
        "James E.J. Bottomley" <jejb@...ux.vnet.ibm.com>,
        "Martin K. Petersen" <martin.petersen@...cle.com>
Cc:     Arnd Bergmann <arnd@...db.de>, Hannes Reinecke <hare@...e.com>,
        linux-scsi <linux-scsi@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] scsi: lpfc: avoid false-positive gcc-8 warning

On Wed, Aug 23, 2017 at 5:01 PM, Arnd Bergmann <arnd@...db.de> wrote:
> This is an interesting regression with gcc-8, showing a harmless
> warning for correct code:
>
> In file included from include/linux/kernel.h:13:0,
>                  ...
>                  from drivers/scsi/lpfc/lpfc_debugfs.c:23:
> include/linux/printk.h:301:2: error: 'eq' may be used uninitialized in this function [-Werror=maybe-uninitialized]
>   printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
>   ^~~~~~
> In file included from drivers/scsi/lpfc/lpfc_debugfs.c:58:0:
> drivers/scsi/lpfc/lpfc_debugfs.h:451:31: note: 'eq' was declared here
>
> I tried to come up with a reduced test case for gcc here
> a few times, but every time ended up with code that is actually
> wrong with older gcc versions missing the bug and gcc-8 finding
> it. As this is the only false-positive -Wmaybe-uninitialized
> warnign I got with gcc-8 randconfig builds, I'd suggest we
> work around it.
>
> Making the index variable 'unsigned' is enough to shut up
> the warning, as gcc can then see that comparing eqidx to
> phba->io_channel_irqs is fine here.
>
> Signed-off-by: Arnd Bergmann <arnd@...db.de>

Sorry, I have to retract my patch. While it apparently solved the problem
for most randconfig builds, I have now run into another case that it did
not address, and I still get the warning for one caller:

In file included from /git/arm-soc/include/linux/kernel.h:13:0,
                 from /git/arm-soc/arch/x86/include/asm/percpu.h:44,
                 from /git/arm-soc/arch/x86/include/asm/current.h:5,
                 from /git/arm-soc/include/linux/sched.h:11,
                 from /git/arm-soc/include/linux/blkdev.h:4,
                 from /git/arm-soc/drivers/scsi/lpfc/lpfc_debugfs.c:23:
/git/arm-soc/drivers/scsi/lpfc/lpfc_debugfs.c: In function
'lpfc_debug_dump_all_queues':
/git/arm-soc/include/linux/printk.h:301:2: error: 'eq' may be used
uninitialized in this function [-Werror=maybe-uninitialized]
  printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
  ^~~~~~
In file included from /git/arm-soc/drivers/scsi/lpfc/lpfc_debugfs.c:58:0:
/git/arm-soc/drivers/scsi/lpfc/lpfc_debugfs.h:451:31: note: 'eq' was
declared here
  struct lpfc_queue *wq, *cq, *eq;
                               ^~
In file included from /git/arm-soc/include/linux/kernel.h:13:0,
                 from /git/arm-soc/arch/x86/include/asm/percpu.h:44,
                 from /git/arm-soc/arch/x86/include/asm/current.h:5,
                 from /git/arm-soc/include/linux/sched.h:11,
                 from /git/arm-soc/include/linux/blkdev.h:4,
                 from /git/arm-soc/drivers/scsi/lpfc/lpfc_debugfs.c:23:
/git/arm-soc/include/linux/printk.h:301:2: error: 'eq' may be used
uninitialized in this function [-Werror=maybe-uninitialized]
  printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
  ^~~~~~
In file included from /git/arm-soc/drivers/scsi/lpfc/lpfc_debugfs.c:58:0:
/git/arm-soc/drivers/scsi/lpfc/lpfc_debugfs.h:451:31: note: 'eq' was
declared here
  struct lpfc_queue *wq, *cq, *eq;
                               ^~
cc1: all warnings being treated as errors

     Arnd

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ