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] [day] [month] [year] [list]
Message-ID:
 <BL0PR11MB29131B7261357332CFAF2548E7D52@BL0PR11MB2913.namprd11.prod.outlook.com>
Date: Fri, 7 Mar 2025 13:50:48 +0000
From: <Woojung.Huh@...rochip.com>
To: <o.rempel@...gutronix.de>, <davem@...emloft.net>, <edumazet@...gle.com>,
	<kuba@...nel.org>, <pabeni@...hat.com>, <andrew+netdev@...n.ch>,
	<Thangaraj.S@...rochip.com>, <Rengarajan.S@...rochip.com>
CC: <broonie@...nel.org>, <kernel@...gutronix.de>,
	<linux-kernel@...r.kernel.org>, <netdev@...r.kernel.org>,
	<UNGLinuxDriver@...rochip.com>, <phil@...pberrypi.org>
Subject: RE: [PATCH net v1 1/1] net: usb: lan78xx: Sanitize return values of
 register read/write functions

Add proper maintainers in the list
Thangaraj Samynathan <Thangaraj.S@...rochip.com>
Rengarajan Sundararajan <Rengarajan.S@...rochip.com>

https://web.git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/tree/MAINTAINERS#n24528

> -----Original Message-----
> From: Oleksij Rempel <o.rempel@...gutronix.de>
> Sent: Friday, March 7, 2025 5:12 AM
> To: David S. Miller <davem@...emloft.net>; Eric Dumazet
> <edumazet@...gle.com>; Jakub Kicinski <kuba@...nel.org>; Paolo Abeni
> <pabeni@...hat.com>; Woojung Huh - C21699 <Woojung.Huh@...rochip.com>;
> Andrew Lunn <andrew+netdev@...n.ch>
> Cc: Oleksij Rempel <o.rempel@...gutronix.de>; Mark Brown
> <broonie@...nel.org>; kernel@...gutronix.de; linux-kernel@...r.kernel.org;
> netdev@...r.kernel.org; UNGLinuxDriver <UNGLinuxDriver@...rochip.com>; Phil
> Elwell <phil@...pberrypi.org>
> Subject: [PATCH net v1 1/1] net: usb: lan78xx: Sanitize return values of
> register read/write functions
> 
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the
> content is safe
> 
> usb_control_msg() returns the number of transferred bytes or a negative
> error code. The current implementation propagates the transferred byte
> count, which is unintended. This affects code paths that assume a
> boolean success/failure check, such as the EEPROM detection logic.
> 
> Fix this by ensuring lan78xx_read_reg() and lan78xx_write_reg() return
> only 0 on success and preserve negative error codes.
> 
> This approach is consistent with existing usage, as the transferred byte
> count is not explicitly checked elsewhere.
> 
> Fixes: 8b1b2ca83b20 ("net: usb: lan78xx: Improve error handling in EEPROM
> and OTP operations")
> Reported-by: Mark Brown <broonie@...nel.org>
> Closes: https://lore.kernel.org/all/ac965de8-f320-430f-80f6-
> b16f4e1ba06d@...ena.org.uk
> Signed-off-by: Oleksij Rempel <o.rempel@...gutronix.de>
> ---
>  drivers/net/usb/lan78xx.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c
> index a91bf9c7e31d..137adf6d5b08 100644
> --- a/drivers/net/usb/lan78xx.c
> +++ b/drivers/net/usb/lan78xx.c
> @@ -627,7 +627,7 @@ static int lan78xx_read_reg(struct lan78xx_net *dev, u32
> index, u32 *data)
> 
>         kfree(buf);
> 
> -       return ret;
> +       return ret < 0 ? ret : 0;
>  }
> 
>  static int lan78xx_write_reg(struct lan78xx_net *dev, u32 index, u32 data)
> @@ -658,7 +658,7 @@ static int lan78xx_write_reg(struct lan78xx_net *dev,
> u32 index, u32 data)
> 
>         kfree(buf);
> 
> -       return ret;
> +       return ret < 0 ? ret : 0;
>  }
> 
>  static int lan78xx_update_reg(struct lan78xx_net *dev, u32 reg, u32 mask,
> --
> 2.39.5


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ