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]
Date:   Wed, 12 Oct 2022 14:10:33 +0100
From:   "Colin King (gmail)" <colin.i.king@...il.com>
To:     Larry Finger <Larry.Finger@...inger.net>
Cc:     Kalle Valo <kvalo@...nel.org>,
        "David S. Miller" <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>,
        Paolo Abeni <pabeni@...hat.com>,
        "linux-wireless@...r.kernel.org" <linux-wireless@...r.kernel.org>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: rtlwifi: missing return value in

Hi,

Static analysis with cppcheck has found an issue with a function that 
returns an int value but there is a code path that does not return a 
value causing undefined behaviour:

Source: drivers/net/wireless/realtek/rtlwifi/usb.c function 
_rtl_rx_get_padding - introduced by commit:

commit 354d0f3c40fb40193213e40f3177ff528798ca8d
Author: Larry Finger <Larry.Finger@...inger.net>
Date:   Wed Sep 25 12:57:47 2013 -0500

     rtlwifi: Fix smatch warnings in usb.c

The issue occurs when NET_IP_ALIGN is zero and when len >= sizeof(*hdr), 
then the following return is *not* taken:

	/* make function no-op when possible */
         if (NET_IP_ALIGN == 0 || len < sizeof(*hdr))
                 return 0

and then execution reaches the end of the function where no return value 
is returned because the #if NET_IP_ALIGN != 0 is false so the return 
padding hunk of the code is not compiled in.

Colin

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ