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]
Date:	Wed, 20 Jan 2010 03:12:19 +0000
From:	Ben Hutchings <bhutchings@...arflare.com>
To:	Roel Kluin <roel.kluin@...il.com>
Cc:	Solarflare linux maintainers <linux-net-drivers@...arflare.com>,
	Steve Hodgson <shodgson@...arflare.com>,
	netdev@...r.kernel.org, Andrew Morton <akpm@...ux-foundation.org>,
	LKML <linux-kernel@...r.kernel.org>,
	"David S. Miller" <davem@...emloft.net>
Subject: Re: [PATCH] sfc: EFX_ETHTOOL_STAT calculates the offset of the
 efx##source_name's field in both cases

On Wed, 2010-01-20 at 03:08 +0100, Roel Kluin wrote:
> EFX_ETHTOOL_STAT calculated the offset of the efx##source_name's field
> Regardless of whether that field was NULL.
> 
> Signed-off-by: Roel Kluin <roel.kluin@...il.com>
> ---
> This looks like a bug, but I am not sure whether I understood this correctly,
> nor was it tested, was this intended?

The condition is really a type check.  The result should be the same
regardless of whether it is true.

Ben.

> diff --git a/drivers/net/sfc/ethtool.c b/drivers/net/sfc/ethtool.c
> index 6c0bbed..722bac7 100644
> --- a/drivers/net/sfc/ethtool.c
> +++ b/drivers/net/sfc/ethtool.c
> @@ -41,7 +41,7 @@ struct efx_ethtool_stat {
>  	.source = EFX_ETHTOOL_STAT_SOURCE_##source_name,		\
>  	.offset = ((((field_type *) 0) ==				\
>  		      &((struct efx_##source_name *)0)->field) ?	\
> -		    offsetof(struct efx_##source_name, field) :		\
> +		    offsetof(struct efx_##stat_name, field) :		\
>  		    offsetof(struct efx_##source_name, field)),		\
>  	.get_stat = get_stat_function,					\
>  }

-- 
Ben Hutchings, Senior Software Engineer, Solarflare Communications
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