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: <96ad92ca-c3ad-8e31-9802-46f298bbc9fa@redhat.com>
Date:   Tue, 28 Mar 2017 10:10:23 +0200
From:   Ivan Vecera <ivecera@...hat.com>
To:     Jiri Pirko <jiri@...nulli.us>
Cc:     David Miller <davem@...emloft.net>, netdev@...r.kernel.org,
        arkadis@...lanox.com, idosch@...lanox.com, mlxsw@...lanox.com,
        jhs@...atatu.com, roopa@...ulusnetworks.com, f.fainelli@...il.com,
        vivien.didelot@...oirfairelinux.com, john.fastabend@...il.com,
        andrew@...n.ch, simon.horman@...ronome.com
Subject: Re: [patch net-next 0/8] Add support for pipeline debug (dpipe)

Dne 28.3.2017 v 09:59 Jiri Pirko napsal(a):
> Tue, Mar 28, 2017 at 09:57:22AM CEST, jiri@...nulli.us wrote:
>> Tue, Mar 28, 2017 at 09:42:58AM CEST, ivecera@...hat.com wrote:
>>> Dne 28.3.2017 v 09:10 Jiri Pirko napsal(a):
>>>> Tue, Mar 28, 2017 at 12:48:34AM CEST, davem@...emloft.net wrote:
>>>>>
>>>>> Please fix up these warnings and resubmit:
>>>>>
>>>>> drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c: In function ‘mlxsw_sp_rif_counter_free’:
>>>>> drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c:208:2: warning: ‘p_counter_index’ may be used uninitialized in this function [-Wmaybe-uninitialized]
>>>>>  mlxsw_sp_rif_counter_edit(mlxsw_sp, rif->rif_index,
>>>>>  ^
>>>>
>>>> This is I believe also gcc bug. Code looks fine. I'm not getting the warning
>>>> with gcc 6
>>>>
>>> No it is not a gcc bug. The function mlxsw_sp_rif_counter_free() is not
>>> static so the compiler cannot know all its callers and so 'dir' parameter can
>>> be theoretically anything.
>>> You call mlxsw_sp_rif_p_counter_get() there it assumes dir can be only
>>> MLXSW_SP_RIF_COUNTER_EGRESS or MLXSW_SP_RIF_COUNTER_INGRESS so initializes
>>> *pp_counter_index only for them. For any other value the value is
>>> uninitialized.
>>
>> Interesting, why gcc 6.2.1 is silent then?
>
> Oh, I see that it is not :) My bad, will fix, thanks!
>
Probably because 'dir' is enumeration and this gcc assumes that any caller uses 
only defined enum values.

Ivan

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ