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]
Message-Id: <20070627.154848.112982936.davem@davemloft.net>
Date:	Wed, 27 Jun 2007 15:48:48 -0700 (PDT)
From:	David Miller <davem@...emloft.net>
To:	jchapman@...alix.com
Cc:	netdev@...r.kernel.org
Subject: Re: [PATCH 2/5 2.6.22-rc6] L2TP: Changes to existing ppp and
 socket kernel headers for L2TP

From: James Chapman <jchapman@...alix.com>
Date: Wed, 27 Jun 2007 23:20:38 +0100

> Add struct sockaddr_pppol2tp to carry L2TP-specific address
> information for the PPPoX (PPPoL2TP) socket. Unfortunately we can't
> use the union inside struct sockaddr_pppox because the L2TP-specific
> data is larger than the current size of the union and we must preserve
> the size of struct sockaddr_pppox for binary compatibility.
> 
> Also add a PPPIOCGL2TPSTATS ioctl to allow userspace to obtain
> L2TP counters and state from the kernel.
> 
> Add new if_pppol2tp.h header.
> 
> Signed-off-by: James Chapman <jchapman@...alix.com>

...

> +/* For PPPIOCGL2TPSTATS */
> +struct pppol2tp_ioc_stats {
> +	__u16	tunnel_id;	/* redundant */
> +	__u16	session_id;	/* if zero, get tunnel stats */
> +	__u32	using_ipsec:1;	/* valid only for session_id == 0 */
> +	__u64	tx_packets;
> +	__u64	tx_bytes;
> +	__u64	tx_errors;
> +	__u64	rx_packets;
> +	__u64	rx_bytes;
> +	__u64	rx_seq_discards;
> +	__u64	rx_oos_packets;
> +	__u64	rx_errors;
> +};

This is going to cause problems on compat platforms where
__u64 is aligned on an 8-byte boundary on the 64-bit
variant but it is not on the 32-bit cpu variant.

A way to avoid this is to use the aligned_u64 type from
linux/types.h which ensures 8-byte alignment on all
platforms and thus you won't need to provide s compat
ioctl() handler for your statistics ioctl().

I'll make this change for you so we don't have to go
back and forth again just for this.
-
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