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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 14 Jun 2012 20:08:33 +0100
From:	Ben Hutchings <bhutchings@...arflare.com>
To:	Phil Sutter <phil.sutter@...rinet.com>
CC:	<netdev@...r.kernel.org>, <davem@...emloft.net>
Subject: Re: [PATCH] usbnet: sanitise overlong driver information strings

On Thu, 2012-06-14 at 13:18 +0200, Phil Sutter wrote:
> As seen on smsc75xx, driver_info->description being longer than 32
> characters messes up 'ethtool -i' output.

I should make ethtool tolerate that, but yes these are supposed to be
null-terminated strings.

Ben.

> Signed-off-by: Phil Sutter <phil.sutter@...rinet.com>
> ---
>  drivers/net/usb/usbnet.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
> index 9f58330..d4f7256 100644
> --- a/drivers/net/usb/usbnet.c
> +++ b/drivers/net/usb/usbnet.c
> @@ -876,9 +876,9 @@ void usbnet_get_drvinfo (struct net_device *net, struct ethtool_drvinfo *info)
>  {
>  	struct usbnet *dev = netdev_priv(net);
>  
> -	strncpy (info->driver, dev->driver_name, sizeof info->driver);
> -	strncpy (info->version, DRIVER_VERSION, sizeof info->version);
> -	strncpy (info->fw_version, dev->driver_info->description,
> +	strlcpy (info->driver, dev->driver_name, sizeof info->driver);
> +	strlcpy (info->version, DRIVER_VERSION, sizeof info->version);
> +	strlcpy (info->fw_version, dev->driver_info->description,
>  		sizeof info->fw_version);
>  	usb_make_path (dev->udev, info->bus_info, sizeof info->bus_info);
>  }

-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ