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:	Sat, 5 Jan 2013 14:17:31 +0100
From:	Jiri Pirko <jpirko@...hat.com>
To:	Flavio Leitner <fbl@...hat.com>
Cc:	netdev <netdev@...r.kernel.org>,
	Ben Hutchings <bhutchings@...arflare.com>
Subject: Re: [PATCH net-next] team: use strlcpy with ethtool_drvinfo fields

Sat, Jan 05, 2013 at 01:53:10PM CET, fbl@...hat.com wrote:
>The fields must be null-terminated.
>
>Signed-off-by: Flavio Leitner <fbl@...hat.com>
>---
> drivers/net/team/team.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
>diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c
>index 78c7d87..e27ac5c 100644
>--- a/drivers/net/team/team.c
>+++ b/drivers/net/team/team.c
>@@ -1747,8 +1747,8 @@ static const struct net_device_ops team_netdev_ops = {
> static void team_ethtool_get_drvinfo(struct net_device *dev,
> 				     struct ethtool_drvinfo *drvinfo)
> {
>-	strncpy(drvinfo->driver, DRV_NAME, 32);
>-	strncpy(drvinfo->version, UTS_RELEASE, 32);
>+	strlcpy(drvinfo->driver, DRV_NAME, sizeof(drvinfo->driver));
>+	strlcpy(drvinfo->version, UTS_RELEASE, sizeof(drvinfo->version));
> }
> 
> static const struct ethtool_ops team_ethtool_ops = {
>-- 
>1.8.0.1
>


Acked-by: Jiri Pirko <jiri@...nulli.us>

--
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