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]
Date:	Mon, 11 May 2015 13:09:50 -0400 (EDT)
From:	David Miller <davem@...emloft.net>
To:	willemb@...gle.com
Cc:	netdev@...r.kernel.org, eric.dumazet@...il.com,
	david.laight@...lab.com
Subject: Re: [PATCH net-next v2 6/6] packet: rollover statistics

From: Willem de Bruijn <willemb@...gle.com>
Date: Sat,  9 May 2015 17:25:01 -0400

> From: Willem de Bruijn <willemb@...gle.com>
> 
> Rollover indicates exceptional conditions. Export a counter to inform
> socket owners of this state.
> 
> If no socket with sufficient room is found, rollover fails. Also count
> these events.
> 
> Finally, also count when flows are rolled over early thanks to huge
> flow detection, to validate its correctness.
> 
> Tested:
>   Read counters in bench_rollover on all other tests in the patchset
> 
> Signed-off-by: Willem de Bruijn <willemb@...gle.com>
> ---
>  include/uapi/linux/if_packet.h |  7 +++++++
>  net/packet/af_packet.c         | 19 ++++++++++++++++++-
>  net/packet/internal.h          |  3 +++
>  3 files changed, 28 insertions(+), 1 deletion(-)
> 
> diff --git a/include/uapi/linux/if_packet.h b/include/uapi/linux/if_packet.h
> index 053bd10..52b6501 100644
> --- a/include/uapi/linux/if_packet.h
> +++ b/include/uapi/linux/if_packet.h
> @@ -54,6 +54,7 @@ struct sockaddr_ll {
>  #define PACKET_FANOUT			18
>  #define PACKET_TX_HAS_OFF		19
>  #define PACKET_QDISC_BYPASS		20
> +#define PACKET_ROLLOVER_STATS		21
>  
>  #define PACKET_FANOUT_HASH		0
>  #define PACKET_FANOUT_LB		1
> @@ -75,6 +76,12 @@ struct tpacket_stats_v3 {
>  	unsigned int	tp_freeze_q_cnt;
>  };
>  
> +struct tpacket_rollover_stats {
> +	unsigned long	tp_all;
> +	unsigned long	tp_huge;
> +	unsigned long	tp_failed;
> +};

Please do not use variably sized types, especially "long" for user exported
interfaces.  Otherwise you will need to add a compat layer to translate
the data into userspace for 32-bit tasks running on a 64-bit kernel.

If a 32-bit value really is not sufficient, use __aligned_u64.
--
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