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]
Message-ID: <AE90C24D6B3A694183C094C60CF0A2F6026B6E3F@saturn3.aculab.com>
Date:	Mon, 30 Jan 2012 11:44:10 -0000
From:	"David Laight" <David.Laight@...LAB.COM>
To:	"Andrea Shepard" <andrea@...sephoneslair.org>,
	<linux-kernel@...r.kernel.org>, <netdev@...r.kernel.org>
Cc:	<khc@...waw.pl>, <davem@...emloft.net>, <mmarek@...e.cz>,
	<jkosina@...e.cz>, <joe@...ches.com>, <justinmattock@...il.com>,
	<gregkh@...e.de>, <alan@...ux.intel.com>, <jdmason@...zu.us>
Subject: RE: [07/22] Cyclades PC300 driver: ioctl() fixes for mixed 64/32-bit systems

 
> +struct pc300_net_stats {
> +	u64 rx_packets;
...
> +	u64 rx_compressed;
> +	u64 tx_compressed;
> +};
> +
>  typedef struct pc300stats {
>  	int hw_type;
>  	u32 line_on;
>  	u32 line_off;
> -	struct net_device_stats gen_stats;
> +	/* Use this instead of net_device_stats, since passing
> +	 * net_device_stats breaks 32-bit user processes on 
> 64-bit kernels,
> +	 * and rtnetlink is unreasonably complicated just to get
> +	 * some statistics.
> +	 */
> +	struct pc300_net_stats net_stats;
>  	falc_t te_stats;
>  } pc300stats_t;

Since 'struct net_device_stats' looks like a common structure,
maybe the 64bit version should be added in the same place??

...
> +struct pc300hw_user {
> +	int type;               /* RSV, X21, etc. */
> +	int bus;                /* Bus (PCI, PMC, etc.) */
> +	int nchan;              /* number of channels */
> +	int irq;                /* interrupt request level */
> +	u32 clock;              /* Board clock */
> +	u8 cpld_id;             /* CPLD ID (TE only) */
> +	u16 cpld_reg1;          /* CPLD reg 1 (TE only) */

You should probably make all the fields fixed sized types and
ensure there is no implicit padding added between fields.

	David


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ