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]
Message-Id: <20200329.221039.801988103648289657.davem@davemloft.net>
Date:   Sun, 29 Mar 2020 22:10:39 -0700 (PDT)
From:   David Miller <davem@...emloft.net>
To:     jacob.e.keller@...el.com
Cc:     netdev@...r.kernel.org, tanhuazhong@...wei.com
Subject: Re: [PATCH net-next] mlx4: fix "initializer element not constant"
 compiler error

From: Jacob Keller <jacob.e.keller@...el.com>
Date: Fri, 27 Mar 2020 14:08:35 -0700

> A recent commit e8937681797c ("devlink: prepare to support region
> operations") used the region_cr_space_str and region_fw_health_str
> variables as initializers for the devlink_region_ops structures.
> 
> This can result in compiler errors:
> drivers/net/ethernet/mellanox//mlx4/crdump.c:45:10: error: initializer
> element is not constant
>    .name = region_cr_space_str,
>            ^
> drivers/net/ethernet/mellanox//mlx4/crdump.c:45:10: note: (near
> initialization for ‘region_cr_space_ops.name’)
> drivers/net/ethernet/mellanox//mlx4/crdump.c:50:10: error: initializer
> element is not constant
>    .name = region_fw_health_str,
> 
> The variables were made to be "const char * const", indicating that both
> the pointer and data were constant. This was enough to resolve this on
> recent GCC (gcc (GCC) 9.2.1 20190827 (Red Hat 9.2.1-1) for this author).
> 
> Unfortunately this is not enough for older compilers to realize that the
> variable can be treated as a constant expression.
> 
> Fix this by introducing macros for the string and use those instead of
> the variable name in the region ops structures.
> 
> Reported-by: tanhuazhong <tanhuazhong@...wei.com>
> Fixes: e8937681797c ("devlink: prepare to support region operations")
> Signed-off-by: Jacob Keller <jacob.e.keller@...el.com>

Applied.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ