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] [thread-next>] [day] [month] [year] [list]
Message-Id: <20170325.200553.661929780985796313.davem@davemloft.net>
Date:   Sat, 25 Mar 2017 20:05:53 -0700 (PDT)
From:   David Miller <davem@...emloft.net>
To:     arnd@...db.de
Cc:     dledford@...hat.com, oulijun@...wei.com, xavier.huwei@...wei.com,
        huangdaode@...ilicon.com, yankejian@...wei.com,
        xieqianqian@...wei.com, weiyongjun1@...wei.com,
        yisen.zhuang@...wei.com, salil.mehta@...wei.com,
        sean.hefty@...el.com, hal.rosenstock@...il.com,
        linux-rdma@...r.kernel.org, linux-kernel@...r.kernel.org,
        netdev@...r.kernel.org
Subject: Re: [RESEND PATCH 2/3] net: hns: avoid gcc-7.0.1 warning for
 uninitialized data

From: Arnd Bergmann <arnd@...db.de>
Date: Fri, 24 Mar 2017 23:02:50 +0100

> hns_dsaf_set_mac_key() calls dsaf_set_field() on an uninitialized field,
> which will then change only a few of its bits, causing a warning with
> the latest gcc:
> 
> hisilicon/hns/hns_dsaf_main.c: In function 'hns_dsaf_set_mac_uc_entry':
> hisilicon/hns/hns_dsaf_reg.h:1046:12: error: 'mac_key.low.bits.port_vlan' may be used uninitialized in this function [-Werror=maybe-uninitialized]
>    (origin) &= (~(mask)); \
>             ^~
> hisilicon/hns/hns_dsaf_main.c: In function 'hns_dsaf_set_mac_mc_entry':
> hisilicon/hns/hns_dsaf_reg.h:1046:12: error: 'mac_key.low.bits.port_vlan' may be used uninitialized in this function [-Werror=maybe-uninitialized]
> hisilicon/hns/hns_dsaf_main.c: In function 'hns_dsaf_add_mac_mc_port':
> hisilicon/hns/hns_dsaf_reg.h:1046:12: error: 'mac_key.low.bits.port_vlan' may be used uninitialized in this function [-Werror=maybe-uninitialized]
> hisilicon/hns/hns_dsaf_main.c: In function 'hns_dsaf_del_mac_entry':
> hisilicon/hns/hns_dsaf_reg.h:1046:12: error: 'mac_key.low.bits.port_vlan' may be used uninitialized in this function [-Werror=maybe-uninitialized]
> hisilicon/hns/hns_dsaf_main.c: In function 'hns_dsaf_rm_mac_addr':
> hisilicon/hns/hns_dsaf_reg.h:1046:12: error: 'mac_key.low.bits.port_vlan' may be used uninitialized in this function [-Werror=maybe-uninitialized]
> hisilicon/hns/hns_dsaf_main.c: In function 'hns_dsaf_del_mac_mc_port':
> hisilicon/hns/hns_dsaf_reg.h:1046:12: error: 'mac_key.low.bits.port_vlan' may be used uninitialized in this function [-Werror=maybe-uninitialized]
> hisilicon/hns/hns_dsaf_main.c: In function 'hns_dsaf_get_mac_uc_entry':
> hisilicon/hns/hns_dsaf_reg.h:1046:12: error: 'mac_key.low.bits.port_vlan' may be used uninitialized in this function [-Werror=maybe-uninitialized]
> hisilicon/hns/hns_dsaf_main.c: In function 'hns_dsaf_get_mac_mc_entry':
> hisilicon/hns/hns_dsaf_reg.h:1046:12: error: 'mac_key.low.bits.port_vlan' may be used uninitialized in this function [-Werror=maybe-uninitialized]
> 
> The code is actually correct since we always set all 16 bits of the
> port_vlan field, but gcc correctly points out that the first
> access does contain uninitialized data.
> 
> This initializes the field to zero first before setting the
> individual bits.
> 
> Fixes: 5483bfcb169c ("net: hns: modify tcam table and set mac key")
> Signed-off-by: Arnd Bergmann <arnd@...db.de>

Applied.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ