netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] team: use strlcpy with ethtool_drvinfo fields
@ 2013-01-05 12:53 Flavio Leitner
  2013-01-05 13:17 ` Jiri Pirko
  2013-01-05 14:11 ` Ben Hutchings
  0 siblings, 2 replies; 4+ messages in thread
From: Flavio Leitner @ 2013-01-05 12:53 UTC (permalink / raw)
  To: netdev; +Cc: Ben Hutchings, Jiri Pirko, Flavio Leitner

The fields must be null-terminated.

Signed-off-by: Flavio Leitner <fbl@redhat.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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next] team: use strlcpy with ethtool_drvinfo fields
  2013-01-05 12:53 [PATCH net-next] team: use strlcpy with ethtool_drvinfo fields Flavio Leitner
@ 2013-01-05 13:17 ` Jiri Pirko
  2013-01-05 14:11 ` Ben Hutchings
  1 sibling, 0 replies; 4+ messages in thread
From: Jiri Pirko @ 2013-01-05 13:17 UTC (permalink / raw)
  To: Flavio Leitner; +Cc: netdev, Ben Hutchings

Sat, Jan 05, 2013 at 01:53:10PM CET, fbl@redhat.com wrote:
>The fields must be null-terminated.
>
>Signed-off-by: Flavio Leitner <fbl@redhat.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@resnulli.us>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next] team: use strlcpy with ethtool_drvinfo fields
  2013-01-05 12:53 [PATCH net-next] team: use strlcpy with ethtool_drvinfo fields Flavio Leitner
  2013-01-05 13:17 ` Jiri Pirko
@ 2013-01-05 14:11 ` Ben Hutchings
  2013-01-07  5:12   ` David Miller
  1 sibling, 1 reply; 4+ messages in thread
From: Ben Hutchings @ 2013-01-05 14:11 UTC (permalink / raw)
  To: Flavio Leitner; +Cc: netdev, Jiri Pirko

On Sat, 2013-01-05 at 10:53 -0200, Flavio Leitner wrote:
> The fields must be null-terminated.
> 
> Signed-off-by: Flavio Leitner <fbl@redhat.com>

Acked-by: Ben Hutchings <bhutchings@solarflare.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 = {

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next] team: use strlcpy with ethtool_drvinfo fields
  2013-01-05 14:11 ` Ben Hutchings
@ 2013-01-07  5:12   ` David Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2013-01-07  5:12 UTC (permalink / raw)
  To: bhutchings; +Cc: fbl, netdev, jpirko

From: Ben Hutchings <bhutchings@solarflare.com>
Date: Sat, 5 Jan 2013 14:11:17 +0000

> On Sat, 2013-01-05 at 10:53 -0200, Flavio Leitner wrote:
>> The fields must be null-terminated.
>> 
>> Signed-off-by: Flavio Leitner <fbl@redhat.com>
> 
> Acked-by: Ben Hutchings <bhutchings@solarflare.com>

Applied.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-01-07  5:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-05 12:53 [PATCH net-next] team: use strlcpy with ethtool_drvinfo fields Flavio Leitner
2013-01-05 13:17 ` Jiri Pirko
2013-01-05 14:11 ` Ben Hutchings
2013-01-07  5:12   ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).