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]
Date:   Mon, 6 Jun 2022 07:48:49 +0200
From:   Greg KH <gregkh@...uxfoundation.org>
To:     Pavel Skripkin <paskripkin@...il.com>
Cc:     Larry.Finger@...inger.net, phil@...lpotter.co.uk,
        straube.linux@...il.com, dan.carpenter@...cle.com,
        fmdefrancesco@...il.com, linux-kernel@...r.kernel.org,
        linux-staging@...ts.linux.dev
Subject: Re: [PATCH v2 2/4] staging: r8188eu: add error handling of rtw_read16

On Fri, May 20, 2022 at 12:09:55AM +0300, Pavel Skripkin wrote:
> rtw_read16() reads data from device via USB API which may fail. In case
> of any failure previous code returned stack data to callers, which is
> wrong.
> 
> Fix it by changing rtw_read16() prototype and prevent caller from
> touching random stack data
> 
> Signed-off-by: Pavel Skripkin <paskripkin@...il.com>
> ---
> 
> Changes since v1:
> 	- Fixed style issue
> 
> ---
>  .../staging/r8188eu/hal/rtl8188e_hal_init.c   | 21 ++++++++++++---
>  drivers/staging/r8188eu/hal/rtl8188e_phycfg.c |  8 ++++--
>  drivers/staging/r8188eu/hal/usb_halinit.c     | 27 ++++++++++++++++---
>  drivers/staging/r8188eu/hal/usb_ops_linux.c   | 13 ++++++---
>  drivers/staging/r8188eu/include/rtw_io.h      |  2 +-
>  drivers/staging/r8188eu/os_dep/ioctl_linux.c  |  9 ++++---
>  drivers/staging/r8188eu/os_dep/os_intfs.c     |  6 ++++-
>  7 files changed, 67 insertions(+), 19 deletions(-)
> 
> diff --git a/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c b/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c
> index e67ecbd1ba79..6662ebc30f7b 100644
> --- a/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c
> +++ b/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c
> @@ -249,11 +249,14 @@ static void efuse_read_phymap_from_txpktbuf(
>  		hi32 = cpu_to_le32(rtw_read32(adapter, REG_PKTBUF_DBG_DATA_H));
>  
>  		if (i == 0) {
> +			u16 reg;
> +
>  			/* Although lenc is only used in a debug statement,
>  			 * do not remove it as the rtw_read16() call consumes
>  			 * 2 bytes from the EEPROM source.
>  			 */
> -			rtw_read16(adapter, REG_PKTBUF_DBG_DATA_L);
> +			res = rtw_read16(adapter, REG_PKTBUF_DBG_DATA_L, &reg);
> +			(void)res;

Same here, that line isn't ok.

thanks,

greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ