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]
Date:	Wed, 14 Nov 2007 06:48:27 +0100
From:	Eric Dumazet <dada1@...mosbay.com>
To:	Wang Chen <wangchen@...fujitsu.com>
CC:	davem@...emloft.net, netdev@...r.kernel.org
Subject: Re: [PATCH 2/2] SOCK: add raw6 drops counter

Wang Chen a écrit :
> Add raw drops counter for IPv6 in /proc/net/raw6 .
> 
> Signed-off-by: Wang Chen <wangchen@...fujitsu.com>
> ---
>  raw.c |   15 ++++++++-------
>  1 files changed, 8 insertions(+), 7 deletions(-)
> 
> diff -Nurp linux-2.6.24-rc2.org/net/ipv6/raw.c linux-2.6.24-rc2/net/ipv6/raw.c
> --- linux-2.6.24-rc2.org/net/ipv6/raw.c	2007-11-09 16:38:05.000000000 +0800
> +++ linux-2.6.24-rc2/net/ipv6/raw.c	2007-11-14 09:46:54.000000000 +0800
> @@ -354,14 +354,14 @@ static inline int rawv6_rcv_skb(struct s
>  {
>  	if ((raw6_sk(sk)->checksum || sk->sk_filter) &&
>  	    skb_checksum_complete(skb)) {
> -		/* FIXME: increment a raw6 drops counter here */
> +		atomic_inc(&sk->sk_drops);	

I am not sure the comment was refering to a per socket counter here.

If the frame checksum is bad, we can not be sure the socket is OK, since the 
garbaged bits could be in the tuple that identify the socket.

Maybe here we want to increment a global raw6 drop counter (well, for the 
given ipv6 instance)

>  		kfree_skb(skb);
>  		return 0;
>  	}
>  
>  	/* Charge it to the socket. */
>  	if (sock_queue_rcv_skb(sk,skb)<0) {
> -		/* FIXME: increment a raw6 drops counter here */
> +		atomic_inc(&sk->sk_drops);
>  		kfree_skb(skb);
>  		return 0;
>  	}
> @@ -382,6 +382,7 @@ int rawv6_rcv(struct sock *sk, struct sk
>  	struct raw6_sock *rp = raw6_sk(sk);
>  
>  	if (!xfrm6_policy_check(sk, XFRM_POLICY_IN, skb)) {
> +		atomic_inc(&sk->sk_drops);
>  		kfree_skb(skb);
>  		return NET_RX_DROP;
>  	}
> @@ -405,7 +406,7 @@ int rawv6_rcv(struct sock *sk, struct sk
>  
>  	if (inet->hdrincl) {
>  		if (skb_checksum_complete(skb)) {
> -			/* FIXME: increment a raw6 drops counter here */
> +			atomic_inc(&sk->sk_drops);

Same remark here.

-
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