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-next>] [day] [month] [year] [list]
Message-ID: <aeec15d5-6f7a-2c4f-0f90-72c52d082ce8@gmail.com>
Date:   Mon, 24 Oct 2022 15:00:59 +0100
From:   "Colin King (gmail)" <colin.i.king@...il.com>
To:     Johannes Berg <johannes@...solutions.net>,
        "David S. Miller" <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>
Cc:     "linux-wireless@...r.kernel.org" <linux-wireless@...r.kernel.org>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Variables being modified but not used in
 net/wireless/lib80211_crypt_tkip.c

Hi,

I was reviewing some clang scan build static analysis results and found 
an interesting warning:

Source: net/wireless/lib80211_crypt_tkip.c

net/wireless/lib80211_crypt_tkip.c:667:7: warning: variable 'iv32' set 
but not used [-Wunused-but-set-variable]
                 u32 iv32 = tkey->tx_iv32;

The variables iv32 and iv16 are being decremented, but are not 
referenced after that. The seq[] array is being updated with the 
pre-decremented values. Is that correct?

         if (seq) {
                 /* Return the sequence number of the last transmitted 
frame. */
                 u16 iv16 = tkey->tx_iv16;
                 u32 iv32 = tkey->tx_iv32;
                 if (iv16 == 0)
                         iv32--;
                 iv16--;
                 seq[0] = tkey->tx_iv16;
                 seq[1] = tkey->tx_iv16 >> 8;
                 seq[2] = tkey->tx_iv32;
                 seq[3] = tkey->tx_iv32 >> 8;
                 seq[4] = tkey->tx_iv32 >> 16;
                 seq[5] = tkey->tx_iv32 >> 24;
         }

         return TKIP_KEY_LEN;

Colin

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ